Exemplo n.º 1
0
 private function _registerServices()
 {
     $debug = new ModeDebug();
     $debug->listen(Phalcon_Debug);
     $this->manager = new ApplicationManager();
     $this->include_file('autoloader.php');
     // Autoload Service
     $this->include_file('routers.php');
     // Read Router
     $this->include_file('services.php');
     // Read services
     $this->setDI($this->manager);
 }
Exemplo n.º 2
0
 private function _registerServices()
 {
     $debug = new ModeDebug();
     $debug->listen(Phalcon_Debug);
     $manager = new ApplicationManager();
     include_once $this->pathConfig . '/autoloader.php';
     // Read auto-loader
     include_once $this->pathConfig . '/routers.php';
     // Read Router
     include_once $this->pathConfig . '/services.php';
     // Read services
     $this->setDI($manager);
 }
Exemplo n.º 3
0
 /**
  * Initializes debug
  *
  * @param array $options
  */
 protected function initDebug($options = array())
 {
     $config = $this->di['config'];
     // Create the new object
     $debug = new PhDebug();
     // Store it in the Di container
     // Settings cones from the include
     if ('1' == $config->application->debug) {
         $debug->listen();
     }
     $this->di['debug'] = $debug;
 }
Exemplo n.º 4
0
<?php

use Phalcon\Debug, Phalcon\Mvc\Micro, Phalcon\Exception;
/* debug settings */
error_reporting(E_ALL);
$debug = new Debug();
$debug->listen();
/* include config files */
$config = (require __DIR__ . '/config/config.php');
$config->merge(require __DIR__ . '/config/database.php');
require __DIR__ . '/config/loader.php';
require __DIR__ . '/config/services.php';
/* app */
try {
    $app = new Micro($di);
    require __DIR__ . '/users.php';
    $app->handle();
} catch (Exception $e) {
    echo "Phalcon: " . $e->getMessage();
} catch (PDOException $e) {
    echo "PDO: " . $e->getMessage();
}
Exemplo n.º 5
0
 /**
  * @return Debug
  */
 public function getDebugger()
 {
     if ($this->debugger) {
         return $this->debugger;
     }
     $debugger = new Debug();
     $debugger->setShowFileFragment(true);
     $debugger->listen(true, true);
     return $this->debugger = $debugger;
 }
Exemplo n.º 6
0
 /**
  *
  * @param type $options
  */
 protected function initEnvironment($options = [])
 {
     $config = $this->_di->get('config');
     $environment = $config->application->environment != 'production' ? true : false;
     if ($environment) {
         ini_set('display_errors', true);
         $debug = new Debug();
         $debug->listen();
     } else {
         ini_set('display_errors', false);
         error_reporting(-1);
     }
     set_error_handler(['\\SysPhalcon\\Plugins\\Error', 'normal']);
     set_exception_handler(['SysPhalcon\\Plugins\\Error', 'exception']);
     register_shutdown_function(['SysPhalcon\\Plugins\\Error', 'shutdown']);
 }