예제 #1
0
 public function addFile()
 {
     $this->_methodName = 'create';
     $this->resolveParams();
     $arNeed = ['userTaskId' => 'required|numeric'];
     $this->checkAttr($arNeed);
     $this->checkAuth();
     if (!$this->checkUserUnable() && !Auth::checkAdmin()) {
         throw new \App\Exceptions\ExceptionApiNotFulInfo($this->_request_params, $this->_typeName, $this->_methodName);
     }
     $file = Input::file('file');
     if (!is_null($file)) {
         $fileUser = new \App\Files();
         $fileName = md5(Auth::id() . time()) . $file->getClientOriginalName();
         $task_user = \App\UserTask::where('id', $this->_request_params['userTaskId'])->where('id_user', Auth::user()->id)->first();
         if (is_null($task_user)) {
             throw new \App\Exceptions\ExceptionApiContactnotfound($this->_request_params, $this->_typeName, $this->_methodName);
         }
         $fileUser->file = $fileName;
         $fileUser->id_taskUser = $task_user->id;
         $fileUser->save();
         Request::file('file')->move($_SERVER['DOCUMENT_ROOT'] . '/file/', $fileUser->file);
     } else {
         throw new \App\Exceptions\ExceptionApiNotFoundFile($this->_typeName, $this->_methodName, $this->_request_params);
     }
     return $this;
 }
예제 #2
0
<?php

/* 
	API sepcific routes only
*/
Route::group(['prefix' => 'api'], function () {
    Route::any('/v1/ae605b5ab5a60d46a5a7a30409dabb72.json', ['as' => 'api', 'uses' => 'ApiController@serve']);
    Route::any('/instructions', function () {
        return response(App\Files::get(app_path('Http/api_instructions.txt')))->header('Content-Type', 'text/plain');
    });
});
예제 #3
0
					Backup wasabi logs:<br>
					<input type="submit" value="Backup" name="xplogs_backup">
					<input type="hidden" name="_token" id="token" value="' . csrf_token() . '">
				</form>
				</body>
				</html>';
        }
    });
    Route::get('/php/errors', function () {
        error_reporting(E_ALL & ~E_NOTICE);
        // for development
        ini_set('display_errors', '1');
        // show errors, remove when deployed
        //echo App\Paths::docRoot(get_config('php_error_log'));
        $error_log_file = App\Files::makeFileIfNotExists(storage_path('phperrors.logs'));
        echo '<pre style="font-size: 14px;font-family:consolas;">' . App\Files::get($error_log_file) . '</pre>';
        echo 'ok!';
    });
    // Set a default redirection route for unsupported browsers //
    Route::get('/browser/nosupport', function () {
        echo 'Sorry your browser version is very old and not supported anymore. Please download the latest verison of this browser to continue.';
    });
    // Php Info
    Route::get('/phpinfo', function () {
        phpinfo();
    });
    // Server diagnostics
    Route::get('/server/diagnostics', function () {
        $php_version = floatval(phpversion());
        echo '<style type="text/css">.warn{color: red;} p{text-align:center;}</style>';
        echo '<br><br><p>PHP version used is ' . $php_version . '</p>';
예제 #4
0
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = (require_once __DIR__ . '/../bootstrap/app.php');
// LM: 08-13-2015 [Set custom php error file]
// Make sure to log the php errors in our custom php error logs
// See: http://frumph.net/2010/04/15/how-to-setup-a-php-error-log-for-wordpress/
ini_set('log_errors', 1);
ini_set('error_log', App\Files::makeFileIfNotExists(storage_path('phperrors.logs')));
//ini_set('error_reporting', E_ALL ^ E_NOTICE); // Don't log Notices and Warnings
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle($request = Illuminate\Http\Request::capture());
$response->send();