本文整理汇总了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();
}
示例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'));
}
示例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']);
}
}
示例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();
}
}
示例5: __construct
public function __construct($environment, $debug)
{
parent::__construct($environment, $debug);
if ($debug) {
Debug::enable();
}
$this->initPropel();
}
示例6: __construct
public function __construct(array $values = array())
{
if ($values['debug']) {
Debug::enable();
}
parent::__construct($values);
$this->registerLogger($this);
$this->registerTwig($this);
}
示例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);
}
}
示例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;
}
示例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'));
}
示例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';
}
示例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;
}
示例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();
}
}
示例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);
}
示例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);
}
示例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;
}