Skip to content

Instantly share code, notes, and snippets.

@angelxmoreno
Created August 12, 2016 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelxmoreno/7558f6a8a9995edcd772a14d3b173848 to your computer and use it in GitHub Desktop.
Save angelxmoreno/7558f6a8a9995edcd772a14d3b173848 to your computer and use it in GitHub Desktop.
<?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