当前位置: 首页>>代码示例>>PHP>>正文


PHP Debug::enable方法代码示例

本文整理汇总了PHP中Symfony\Component\Debug\Debug::enable方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::enable方法的具体用法?PHP Debug::enable怎么用?PHP Debug::enable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Debug\Debug的用法示例。


在下文中一共展示了Debug::enable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: boot

 public function boot()
 {
     parent::boot();
     if (!$this->container->getParameter('bzion.miscellaneous.development')) {
         if ($this->getEnvironment() != 'prod' || $this->isDebug()) {
             throw new ForbiddenDeveloperAccessException('You are not allowed to access this page in a non-production ' . 'environment. Please change the "development" configuration ' . 'value and clear the cache before proceeding.');
         }
     }
     if (in_array($this->getEnvironment(), array('profile', 'dev'), true)) {
         Debug::enable();
     }
     Service::setGenerator($this->container->get('router')->getGenerator());
     Service::setEnvironment($this->getEnvironment());
     Service::setModelCache(new ModelCache());
     Service::setContainer($this->container);
     $this->setUpTwig();
     // Ratchet doesn't support PHP's native session storage, so use our own
     // if we need it
     if (Service::getParameter('bzion.features.websocket.enabled') && $this->getEnvironment() !== 'test') {
         $storage = new NativeSessionStorage(array(), new DatabaseSessionHandler());
         $session = new Session($storage);
         Service::getContainer()->set('session', $session);
     }
     Notification::initializeAdapters();
 }
开发者ID:kleitz,项目名称:bzion,代码行数:25,代码来源:AppKernel.php

示例2: __construct

 public function __construct($environment = 'prod', $debug = false)
 {
     // dev, prod or schell
     define('Ki_ENVIRONMENT', $environment);
     define('Ki_DEBUG', is_bool($debug) ? $debug : false);
     if (Ki_DEBUG) {
         Debug::enable();
     } else {
         ini_set('display_errors', 0);
     }
     if (!in_array(Ki_ENVIRONMENT, array('dev', 'prod', 'shell'))) {
         throw new \Exception("El entorno '" . Ki_ENVIRONMENT . "' no está permitido en el sistema.");
     }
     // Agrega la instancia del kernel al contenedor de servicios.
     // Util para ser usada cuando de desde realizar una sub peticion dende en controlador.
     Service::instance('kernel', $this);
     // Registra la bolsa temporal en la session
     $session = Service::get('session');
     $session->registerBag(Service::get('temporary_bag'));
     $session->start();
     // Carga la configuracion del proyecto
     Service::get('config')->loadConfigGlobal();
     // Carga la configuracion de los bundles
     $this->registerBundles();
     // Carga la clase translator
     Service::get('translator')->loader(Service::get('session')->getLocale());
     $this->registerProviders();
     $this->registerListeners();
     if (Ki_ENVIRONMENT == 'shell') {
         Service::get('shell')->console();
         return;
     }
     parent::__construct(Service::get('event'), Service::get('kernel.resolver'));
 }
开发者ID:kodazzi,项目名称:framework,代码行数:34,代码来源:Kernel.php

示例3: boot

 public function boot(Container $c)
 {
     // Confio no parametro 'debug' pois ele pode ter mudado durante
     // a fase de configuração por algum provider ou pelo proprio user
     if ($c['debug']) {
         Debug::enable($c['debug.error_level'], $c['debug.display_errors']);
     }
 }
开发者ID:brodaproject,项目名称:broda,代码行数:8,代码来源:DebugProvider.php

示例4: __construct

 public function __construct($apiKey, $secretKey, $debug = false)
 {
     $this->apiKey = $apiKey;
     $this->secretKey = $secretKey;
     if ($debug && class_exists('\\Symfony\\Component\\Debug\\Debug')) {
         \Symfony\Component\Debug\Debug::enable();
     }
 }
开发者ID:bitblower,项目名称:mailjet-api-php,代码行数:8,代码来源:Client.php

示例5: __construct

 public function __construct($environment, $debug)
 {
     parent::__construct($environment, $debug);
     if ($debug) {
         Debug::enable();
     }
     $this->initPropel();
 }
开发者ID:puterakahfi,项目名称:thelia,代码行数:8,代码来源:Thelia.php

示例6: __construct

 public function __construct(array $values = array())
 {
     if ($values['debug']) {
         Debug::enable();
     }
     parent::__construct($values);
     $this->registerLogger($this);
     $this->registerTwig($this);
 }
开发者ID:vikbert,项目名称:silex-bootstrap,代码行数:9,代码来源:Application.php

示例7: __construct

 public function __construct($environment = 'prod', $debug = false)
 {
     $this->environment = $environment;
     $this->debug = $debug;
     $this->packages = $this->registerPackages();
     if ($this->debug) {
         Debug::enable(-1, true);
     }
 }
开发者ID:sitesupra,项目名称:sitesupra,代码行数:9,代码来源:Supra.php

示例8: bootKernel

 public static function bootKernel()
 {
     $loader = (require_once __DIR__ . '/../../../../app/bootstrap.php.cache');
     Debug::enable();
     require_once __DIR__ . '/../../../../app/AppKernel.php';
     $kernel = new \AppKernel('dev', true);
     $kernel->loadClassCache();
     $kernel->boot();
     return $kernel;
 }
开发者ID:pr0coder,项目名称:Inkstand,代码行数:10,代码来源:PackageEvents.php

示例9: __construct

 /**
  * Constructs Application
  *
  * @param EventDispatcherInterface $dispatcher  The Symfony event dispatcher
  * @param string                   $name        The application name
  * @param string                   $version     The version
  * @param string                   $environment The environment
  * @param bool                     $debug       Whether to enable debug mode
  */
 public function __construct(EventDispatcherInterface $dispatcher, string $name, string $version, string $environment, bool $debug)
 {
     $this->environment = $environment;
     $this->debug = $debug;
     if ($this->debug) {
         Debug::enable();
     }
     parent::__construct($name, $version);
     $this->setDispatcher($dispatcher);
     $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The environment name'));
     $this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode'));
 }
开发者ID:novuso,项目名称:common-bundle,代码行数:21,代码来源:Application.php

示例10: indexAction

 /**
  * @Route("/ss", name="homepage")
  */
 public function indexAction(Request $request)
 {
     Debug::enable();
     echo 'dddd';
     $category = new Category();
     $category->setName('ddd');
     $category->setDescription('dd');
     //$category->setSlug('dd');
     $em = $this->getDoctrine()->getManager();
     $em->persist($category);
     echo 'ddd';
 }
开发者ID:kamalsolimen,项目名称:symfony-blog,代码行数:15,代码来源:DefaultController.php

示例11: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     /* init's the silex app and create the schema */
     global $app;
     Debug::enable();
     $app = new \Silex\Application();
     require 'config/test.php';
     /* seperate config for the test db */
     require 'src/app.php';
     self::createSchema();
     $app['session.test'] = true;
 }
开发者ID:Jestemrique,项目名称:SilexSkeletonORM,代码行数:12,代码来源:bootstrap.php

示例12: doAppEngineCheck

 public static function doAppEngineCheck()
 {
     if (Environment::onDevAppServer()) {
         // turn on error reporting and debugging
         Debug::enable(E_ERROR | E_PARSE);
         // fix Dev AppServer XML-loading bug
         Environment::fixXmlFileLoaderBug();
     }
     if (self::onAppEngine() || self::onDevAppServer()) {
         self::checkBucketName();
     }
 }
开发者ID:bshaffer,项目名称:appengine-symfony-starter-project,代码行数:12,代码来源:Environment.php

示例13: runCLI

 public static function runCLI($environment = 'dev', $debug = true)
 {
     set_time_limit(0);
     $input = new ArgvInput();
     $environment = $input->getParameterOption(array('--env', '-e'), $environment);
     $debug = !$input->hasParameterOption(array('--no-debug', '')) && $environment !== 'prod';
     if ($debug) {
         Debug::enable();
     }
     $kernel = new static($environment, $debug);
     $application = new Application($kernel);
     $application->run($input);
 }
开发者ID:morki,项目名称:bounce-bundle,代码行数:13,代码来源:Kernel.php

示例14: start

 /**
  * Startet das Debugging. In diesem Modus werden alle Fehler
  * ausgegeben. Der Symfony-Debugger wird aktiviert und der
  * Cache wird deaktiviert
  */
 public function start()
 {
     Logging::info('Debug: ON');
     $this->active = true;
     $_SESSION['DEBUG'] = true;
     // Error-Ausgabe einschalten
     ini_set('display_errors', 1);
     ini_set('error_reporting', E_ALL);
     // Symfony Debugging aktivieren
     \Symfony\Component\Debug\Debug::enable();
     Cache::disable();
     Profiler::setActive(true);
 }
开发者ID:new-frontiers,项目名称:nostromo-debug,代码行数:18,代码来源:Debug.php

示例15: initialize

 /**
  * Initialize the Silex Application
  *
  * Register services and routes
  * Set basic properties
  *
  * @return Synapse\Application
  */
 public function initialize()
 {
     // Create the application object
     $app = new Application();
     $this->setEnvironment($app);
     $this->registerConfig($app);
     // Handle init config
     $initConfig = $app['config']->load('init');
     if ($initConfig['debug']) {
         Debug::enable();
         $app['debug'] = true;
     }
     return $app;
 }
开发者ID:bodetree,项目名称:synapse-base,代码行数:22,代码来源:ApplicationInitializer.php


注:本文中的Symfony\Component\Debug\Debug::enable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。