예제 #1
0
 /**
  * after event
  */
 public function afterExecuteRoute()
 {
     // todo debug mode
     $toolbar = new \Fabfuel\Prophiler\Toolbar($this->di->get('profiler'));
     $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request());
     //echo $toolbar->render();
     //$this->view->disable();
 }
예제 #2
0
파일: index.php 프로젝트: tresemece/monte
<?php

error_reporting(-1);
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
try {
    if (!defined('DIRS')) {
        define('DIRS', DIRECTORY_SEPARATOR);
    }
    if (!defined('ROOTFULLPATH')) {
        define('ROOTFULLPATH', dirname(__DIR__));
    }
    if (!defined('TRACK')) {
        define('TRACK', TRUE);
    }
    require_once ROOTFULLPATH . '/vendor/autoload.php';
    $profiler = new \Fabfuel\Prophiler\Profiler();
    $bootstrap = $profiler->start('Bootstrap', ['lorem' => 'ipsum'], 'Application');
    require_once 'bootstrap/Load.php';
    $di = new \Phalcon\DI\FactoryDefault();
    $di->setShared('profiler', $profiler);
    $Load = new Load($di);
    $app = $Load->run();
    $profiler->stop($bootstrap);
    echo $app->handle()->getContent();
} catch (\Phalcon\Exception $e) {
    echo $e->getMessage();
}
$toolbar = new \Fabfuel\Prophiler\Toolbar($profiler);
$toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request());
//echo $toolbar->render();
 /**
  * initialize() Initial all global objects
  * @access public
  * @return null
  */
 public function initialize()
 {
     /**
      * @TODO Global Search library
      */
     /**$s = (new \Phalcon\Searcher\Searcher())->setSearchList([
     			'\Models\Categories'	=>	['title', 'description', 'alias'],
     			'\Models\Currency'		=>	['code', 'name'],
     			'\Models\Engines'		=>	['host', 'name', 'description'],
     			'\Models\Users'			=>	['login', 'name', 'surname'],
     		])->useStrict(false)->setQuery('qqqq')->getResult();
     		*/
     // load configurations
     $this->_config = $this->di->get('config');
     if ($this->_config->logger->enable) {
         $this->_logger = $this->di->get('logger');
     }
     // setup breadcrumbs
     $this->_breadcrumbs = $this->di->get('breadcrumbs');
     // setup navigation
     $navigation = $this->di->get('navigation');
     $navigation->setActiveNode($this->router->getActionName(), $this->router->getControllerName(), $this->router->getModuleName());
     if (APPLICATION_ENV == 'development') {
         // add toolbar to the layout
         $toolbar = new \Fabfuel\Prophiler\Toolbar($this->di->get('profiler'));
         $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request());
         $this->view->setVar('toolbar', $toolbar);
     }
     // global view variables
     $this->view->setVars(['user' => $this->_user, 'breadcrumbs' => $this->_breadcrumbs, 'navigation' => $navigation]);
 }