Created
August 12, 2016 22:15
-
-
Save angelxmoreno/7558f6a8a9995edcd772a14d3b173848 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Phalcon\Mvc\Application as PhalconApplication; | |
use Phalcon\Config as PhalconConfig; | |
error_reporting(E_ALL); | |
define('DS', DIRECTORY_SEPARATOR); | |
define('WEBROOT_PATH', __DIR__ . DS); | |
define('ROOT_PATH', dirname(WEBROOT_PATH) . DS); | |
define('APP_PATH', ROOT_PATH . 'app' . DS); | |
define('CONFIG_PATH', APP_PATH . 'config' . DS); | |
define('CACHE_PATH', ROOT_PATH . 'cache' . DS); | |
define('VIEWS_PATH', ROOT_PATH . 'views' . DS); | |
try { | |
/** | |
* Read the configuration | |
*/ | |
$config_array = include CONFIG_PATH . 'config.php'; | |
$config = new PhalconConfig($config_array); | |
/** | |
* Read auto-loader | |
*/ | |
include CONFIG_PATH . 'loader.php'; | |
/** | |
* Read services | |
*/ | |
include CONFIG_PATH . 'services.php'; | |
/** | |
* Handle the request | |
*/ | |
$application = new PhalconApplication($di); | |
echo $application->handle()->getContent(); | |
} catch (\Exception $e) { | |
echo $e->getMessage() . '<br>'; | |
echo '<pre>' . $e->getTraceAsString() . '</pre>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment