features/upload/routes.php
Expected 1 space after FUNCTION keyword; 0 found Open
Open
$app->post('/upload/:id', function($id) use ($app) {
- Exclude checks
Blank line found at end of control structure Open
Open
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( ! move_uploaded_file($tempFile,$targetFile) ) {
- Exclude checks
Expected 1 blank line at end of file; 3 found Open
Open
});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Step One: Put our uploaded files somewhere
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
shell_exec("mkdir -p $targetPath");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$targetPath = "{$upload_base_path}{$ds}{$id}{$ds}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// we're making directories here
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Step Two: Send the file somewhere and expect a URL back
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// end. That will save the image to the the database.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Ensure we have somewhere to upload to
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
header("Content-Type: application/json");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$config = Configuration::get_configuration();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$tempFile = $_FILES['file']['tmp_name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Step Three: Add the URL of the file as an image for the event
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Lucky us, we just have to call renderImage on the front
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$ds = DIRECTORY_SEPARATOR;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$app->log->error("Nothing to upload.");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$upload_base_path = $config['upload_dir'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$options = Configuration::get_configuration('upload');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo json_encode(array("location" => $location));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( ! move_uploaded_file($tempFile,$targetFile) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$app->response->status(500);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$app->log->error("File Uploaded");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$app->response->status(400);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!empty($_FILES)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$targetFile = $targetPath. $_FILES['file']['name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$app->log->error("Error saving uploaded file.");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// We're grouping uploades by their associated event so
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$location = $response['location'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return;
- Exclude checks
No space found after comma in function call Open
Open
if ( ! move_uploaded_file($tempFile,$targetFile) ) {
- Exclude checks
Whitespace found at end of line Open
Open
$ds = DIRECTORY_SEPARATOR;
- Exclude checks
Whitespace found at end of line Open
Open
}
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( ! move_uploaded_file($tempFile,$targetFile) ) {
- Exclude checks