<?php
use \FileHosting\Models;
use \FileHosting\Helpers\Helper;
$app->get('/[upload]', function ($request, $response, $args) {
$this->logger->info("Главная страница");
$args['project_folder']=$this->settings['project_folder'];
return $this->view->render($response, 'upload.html', $args);
})->setName('main');
$app->post('/upload', function ($request, $response, $args) {
$this->logger->info("Кнопка: отправить файл");
$args['project_folder']=$this->settings['project_folder'];
//Создаём объект FileModel
$file=new Models\FileModel();
$file->setName($_FILES['file_to_upload']['name']);
$file->size=$_FILES['file_to_upload']['size'];
$file->comment=$_POST['comment'];
//Копируем файл на сервер
$args['status']=$this->filesFM->addFile($file,$this->settings['upload_folder']);
//Записываем в БД
if ($args['status']) {
$this->filesGW->addFile($file);
}
//Представление
return $this->view->render($response, 'upload.html', $args);
});
$app->get('/files_list', function ($request, $response, $args){
$this->logger->info("Страница последних загрузок");
$args['project_folder']=$this->settings['project_folder'];
$args['upload_folder']=$this->settings['upload_folder'];
$args['files']=$this->filesGW->getLastFiles(100);
return $this->view->render($response, 'files_list.html', $args);
})->setName('files_list');
$app->get('/show_file/{id}', function ($request, $response, $args){
$this->logger->info("Просмотр файла");
$args['project_folder']=$this->settings['project_folder'];
$args['upload_folder']=$this->settings['upload_folder'];
$args['file']=$this->filesGW->getFile($args['id']);
return $this->view->render($response, 'show_file.html', $args);
})->setName('show_file');
$app->get('/download/{id}', function ($request, $response, $args) {
$this->logger->info("Загрузка файла");
$args['project_folder']=$this->settings['project_folder'];
$file=$this->filesGW->getFile($args['id']);
$url=$this->settings['upload_folder'];
$url.=$file->path;
$url.=$file->name;
$response = $response->withHeader('Content-Disposition', 'attachment');
$response = $response->withHeader('Location', $url);
return $this->view->render($response, 'download.html', $args);
})->setName('download');
PD9waHAKdXNlIFxGaWxlSG9zdGluZ1xNb2RlbHM7CnVzZSBcRmlsZUhvc3RpbmdcSGVscGVyc1xIZWxwZXI7CgokYXBwLT5nZXQoJy9bdXBsb2FkXScsIGZ1bmN0aW9uICgkcmVxdWVzdCwgJHJlc3BvbnNlLCAk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5zZXR0aW5nc1sndXBsb2FkX2ZvbGRlciddOwogICAgJGFyZ3NbJ2ZpbGUnXT0kdGhpcy0+ZmlsZXNHVy0+Z2V0RmlsZSgkYXJnc1snaWQnXSk7CgogICAgcmV0dXJuICR0aGlzLT52aWV3LT5yZW5kZXIoJHJlc3BvbnNlLCAnc2hvd19maWxlLmh0bWwnLCAkYXJncyk7Cn0pLT5zZXROYW1lKCdzaG93X2ZpbGUnKTsKCgoKCgokYXBwLT5nZXQoJy9kb3dubG9hZC97aWR9JywgZnVuY3Rpb24gKCRyZXF1ZXN0LCAkcmVzcG9uc2UsICRhcmdzKSB7CiAgICAkdGhpcy0+bG9nZ2VyLT5pbmZvKCLQl9Cw0LPRgNGD0LfQutCwINGE0LDQudC70LAiKTsKICAgICRhcmdzWydwcm9qZWN0X2ZvbGRlciddPSR0aGlzLT5zZXR0aW5nc1sncHJvamVjdF9mb2xkZXInXTsKICAgICAgICAKICAgICRmaWxlPSR0aGlzLT5maWxlc0dXLT5nZXRGaWxlKCRhcmdzWydpZCddKTsKCiAgICAkdXJsPSR0aGlzLT5zZXR0aW5nc1sndXBsb2FkX2ZvbGRlciddOwogICAgJHVybC49JGZpbGUtPnBhdGg7CiAgICAkdXJsLj0kZmlsZS0+bmFtZTsKCiAgICAkcmVzcG9uc2UgPSAkcmVzcG9uc2UtPndpdGhIZWFkZXIoJ0NvbnRlbnQtRGlzcG9zaXRpb24nLCAnYXR0YWNobWVudCcpOwogICAgJHJlc3BvbnNlID0gJHJlc3BvbnNlLT53aXRoSGVhZGVyKCdMb2NhdGlvbicsICR1cmwpOwogICAgcmV0dXJuICR0aGlzLT52aWV3LT5yZW5kZXIoJHJlc3BvbnNlLCAnZG93bmxvYWQuaHRtbCcsICRhcmdzKTsKfSktPnNldE5hbWUoJ2Rvd25sb2FkJyk7
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:2: error: illegal character: '\'
use \FileHosting\Models;
^
Main.java:2: error: illegal character: '\'
use \FileHosting\Models;
^
Main.java:3: error: illegal character: '\'
use \FileHosting\Helpers\Helper;
^
Main.java:3: error: illegal character: '\'
use \FileHosting\Helpers\Helper;
^
Main.java:3: error: illegal character: '\'
use \FileHosting\Helpers\Helper;
^
Main.java:5: error: class, interface, or enum expected
$app->get('/[upload]', function ($request, $response, $args) {
^
Main.java:5: error: unclosed character literal
$app->get('/[upload]', function ($request, $response, $args) {
^
Main.java:5: error: unclosed character literal
$app->get('/[upload]', function ($request, $response, $args) {
^
Main.java:7: error: class, interface, or enum expected
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:7: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:7: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:7: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:7: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:9: error: class, interface, or enum expected
return $this->view->render($response, 'upload.html', $args);
^
Main.java:9: error: unclosed character literal
return $this->view->render($response, 'upload.html', $args);
^
Main.java:9: error: unclosed character literal
return $this->view->render($response, 'upload.html', $args);
^
Main.java:10: error: class, interface, or enum expected
})->setName('main');
^
Main.java:10: error: unclosed character literal
})->setName('main');
^
Main.java:10: error: unclosed character literal
})->setName('main');
^
Main.java:13: error: class, interface, or enum expected
$app->post('/upload', function ($request, $response, $args) {
^
Main.java:13: error: unclosed character literal
$app->post('/upload', function ($request, $response, $args) {
^
Main.java:13: error: unclosed character literal
$app->post('/upload', function ($request, $response, $args) {
^
Main.java:15: error: class, interface, or enum expected
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:15: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:15: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:15: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:15: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:18: error: class, interface, or enum expected
$file=new Models\FileModel();
^
Main.java:18: error: illegal character: '\'
$file=new Models\FileModel();
^
Main.java:20: error: class, interface, or enum expected
$file->setName($_FILES['file_to_upload']['name']);
^
Main.java:20: error: unclosed character literal
$file->setName($_FILES['file_to_upload']['name']);
^
Main.java:20: error: unclosed character literal
$file->setName($_FILES['file_to_upload']['name']);
^
Main.java:20: error: unclosed character literal
$file->setName($_FILES['file_to_upload']['name']);
^
Main.java:20: error: unclosed character literal
$file->setName($_FILES['file_to_upload']['name']);
^
Main.java:21: error: class, interface, or enum expected
$file->size=$_FILES['file_to_upload']['size'];
^
Main.java:21: error: unclosed character literal
$file->size=$_FILES['file_to_upload']['size'];
^
Main.java:21: error: unclosed character literal
$file->size=$_FILES['file_to_upload']['size'];
^
Main.java:21: error: unclosed character literal
$file->size=$_FILES['file_to_upload']['size'];
^
Main.java:21: error: unclosed character literal
$file->size=$_FILES['file_to_upload']['size'];
^
Main.java:22: error: class, interface, or enum expected
$file->comment=$_POST['comment'];
^
Main.java:22: error: unclosed character literal
$file->comment=$_POST['comment'];
^
Main.java:22: error: unclosed character literal
$file->comment=$_POST['comment'];
^
Main.java:25: error: class, interface, or enum expected
$args['status']=$this->filesFM->addFile($file,$this->settings['upload_folder']);
^
Main.java:25: error: unclosed character literal
$args['status']=$this->filesFM->addFile($file,$this->settings['upload_folder']);
^
Main.java:25: error: unclosed character literal
$args['status']=$this->filesFM->addFile($file,$this->settings['upload_folder']);
^
Main.java:25: error: unclosed character literal
$args['status']=$this->filesFM->addFile($file,$this->settings['upload_folder']);
^
Main.java:25: error: unclosed character literal
$args['status']=$this->filesFM->addFile($file,$this->settings['upload_folder']);
^
Main.java:27: error: class, interface, or enum expected
if ($args['status']) {
^
Main.java:27: error: unclosed character literal
if ($args['status']) {
^
Main.java:27: error: unclosed character literal
if ($args['status']) {
^
Main.java:29: error: class, interface, or enum expected
}
^
Main.java:32: error: unclosed character literal
return $this->view->render($response, 'upload.html', $args);
^
Main.java:32: error: unclosed character literal
return $this->view->render($response, 'upload.html', $args);
^
Main.java:33: error: class, interface, or enum expected
});
^
Main.java:36: error: class, interface, or enum expected
$app->get('/files_list', function ($request, $response, $args){
^
Main.java:36: error: unclosed character literal
$app->get('/files_list', function ($request, $response, $args){
^
Main.java:36: error: unclosed character literal
$app->get('/files_list', function ($request, $response, $args){
^
Main.java:38: error: class, interface, or enum expected
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:38: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:38: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:38: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:38: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:40: error: class, interface, or enum expected
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:40: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:40: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:40: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:40: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:41: error: class, interface, or enum expected
$args['files']=$this->filesGW->getLastFiles(100);
^
Main.java:41: error: unclosed character literal
$args['files']=$this->filesGW->getLastFiles(100);
^
Main.java:41: error: unclosed character literal
$args['files']=$this->filesGW->getLastFiles(100);
^
Main.java:43: error: class, interface, or enum expected
return $this->view->render($response, 'files_list.html', $args);
^
Main.java:43: error: unclosed character literal
return $this->view->render($response, 'files_list.html', $args);
^
Main.java:43: error: unclosed character literal
return $this->view->render($response, 'files_list.html', $args);
^
Main.java:44: error: class, interface, or enum expected
})->setName('files_list');
^
Main.java:44: error: unclosed character literal
})->setName('files_list');
^
Main.java:44: error: unclosed character literal
})->setName('files_list');
^
Main.java:48: error: class, interface, or enum expected
$app->get('/show_file/{id}', function ($request, $response, $args){
^
Main.java:48: error: unclosed character literal
$app->get('/show_file/{id}', function ($request, $response, $args){
^
Main.java:48: error: unclosed character literal
$app->get('/show_file/{id}', function ($request, $response, $args){
^
Main.java:50: error: class, interface, or enum expected
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:50: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:50: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:50: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:50: error: unclosed character literal
$args['project_folder']=$this->settings['project_folder'];
^
Main.java:52: error: class, interface, or enum expected
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:52: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:52: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:52: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:52: error: unclosed character literal
$args['upload_folder']=$this->settings['upload_folder'];
^
Main.java:53: error: class, interface, or enum expected
$args['file']=$this->filesGW->getFile($args['id']);
^
Main.java:53: error: unclosed character literal
$args['file']=$this->filesGW->getFile($args['id']);
^
Main.java:53: error: unclosed character literal
$args['file']=$this->filesGW->getFile($args['id']);
^
Main.java:53: error: unclosed character literal
$args['file']=$this->filesGW->getFile($args['id']);
^
Main.java:53: error: unclosed character literal
$args['file']=$this->filesGW->getFile($args['id']);
^
Main.java:55: error: class, interface, or enum expected
return $this->view->render($response, 'show_file.html', $args);
^
Main.java:55: error: unclosed character literal
return $this->view->render($response, 'show_file.html', $args);
^
Main.java:55: error: unclosed character literal
return $this->view->render($response, 'show_file.html', $args);
^
100 errors