當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Debug\Debug類代碼示例

本文整理匯總了PHP中Symfony\Component\Debug\Debug的典型用法代碼示例。如果您正苦於以下問題:PHP Debug類的具體用法?PHP Debug怎麽用?PHP Debug使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Debug類的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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。