Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2.  
  3. define('BASE_DIR', dirname(__DIR__));
  4. define('APP_DIR', BASE_DIR . '/app');
  5.  
  6. $config_file = '/vagrant/site/app/config/config.php';
  7. define('APP_ENV', 'dev');
  8. define('APP_PROJECT', 'xxxx.yyyy');
  9. define('APP_URL', 'xxxx.yyyy');
  10. define('DEV_ADD_TRACE_TO_ERRORS', true);
  11. ini_set('display_errors', 1);
  12.  
  13. error_reporting(E_ALL);
  14.  
  15. try {
  16.     /**
  17.      * Read the configuration
  18.      */
  19.     require_once($config_file);
  20.  
  21.     /**
  22.      * Read auto-loader
  23.      */
  24.     include __DIR__ . "/../app/config/loader.php";
  25.  
  26.     /**
  27.      * Read services
  28.      */
  29.     include __DIR__ . "/../app/config/services.php";
  30.     /**
  31.      * Handle the request
  32.      */
  33.     $application = new Phalcon\Mvc\Application($di);
  34.  
  35.     echo $application->handle()->getContent();
  36.  
  37. } catch (Exception $e) {
  38.     if (APP_ENV == 'dev') {
  39.         echo $e->getMessage(), '<br>';
  40.         echo nl2br(htmlentities($e->getTraceAsString()));
  41.         error_log('#f344f5s ' . $e->getMessage() . ' |||| ' . $e->getTraceAsString());
  42.  
  43.     } else {
  44.         error_log('#esite5a4d ' . $e->getMessage() . ' |||| ' . $e->getTraceAsString());
  45.         mail('removed_for_public', 'ERROR @ xxxx.yy', $e->getMessage() . ' ||| ' . $e->getTraceAsString());
  46.         $response = new Phalcon\Http\Response();
  47.         $response->setStatusCode(404, "Not Found");
  48.         $response->setContent("Page not found.");
  49.         $response->send();
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement