本文整理汇总了PHP中DBG::activate方法的典型用法代码示例。如果您正苦于以下问题:PHP DBG::activate方法的具体用法?PHP DBG::activate怎么用?PHP DBG::activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBG
的用法示例。
在下文中一共展示了DBG::activate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPage
public function getPage()
{
if (!empty($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'logout') {
$this->logout();
}
if (isset($_GET['debug_update']) && $_GET['debug_update'] === 'true') {
\DBG::activate(DBG_PHP | DBG_DB | DBG_LOG);
}
if (isset($_POST['doGroup']) && $_POST['doGroup']) {
if (!empty($_POST['pgUsername']) && !empty($_POST['pgPassword'])) {
if ($userId = $this->auth($_POST['pgUsername'], $_POST['pgPassword'])) {
$_SESSION['contrexx_update']['user_id'] = $userId;
$_SESSION['contrexx_update']['step'] = 5;
$_SESSION['contrexx_update']['version'] = $_POST['pgCmsVersion'];
$_SESSION['contrexx_update']['migrate_lang_ids'] = explode(',', $_POST['pgMigrateLangIds']);
$_SESSION['contrexx_update']['copyFilesFinished'] = true;
$_SESSION['contrexx_update']['content_stats'] = true;
$_SESSION['contrexx_update']['inactive_content_languages_checked'] = true;
$_SESSION['contrexx_update']['content_migrated'] = true;
}
}
}
if ($this->auth() || $this->login()) {
$this->setStep();
$this->showStep();
}
$this->setPlaceholders();
if ($this->ajax) {
die($this->objJson->encode(array('content' => $this->html['content'], 'logout' => $this->html['logout'], 'navigation' => $this->html['navigation'], 'dialog' => $this->html['dialog'], 'timeout' => $this->html['timeout'])));
}
return $this->objTemplate->get();
}
示例2: execute
protected function execute()
{
switch ($this->mode) {
case self::MODE_DQL:
$this->result = '';
$strQuery = trim($this->code);
$lister = new \Cx\Core_Modules\Listing\Controller\ListingController(function (&$offset, &$count, &$criteria, &$order) use($strQuery) {
return \Env::get('em')->createQuery($strQuery);
});
try {
$table = new \BackendTable($lister->getData());
$this->result = $table->toHtml() . $lister;
} catch (\Exception $e) {
$this->result = 'Could not execute query (' . $e->getMessage() . ')!';
}
break;
case self::MODE_PHP:
$dbgMode = \DBG::getMode();
try {
// This error handler catches all Warnings and Notices and some Strict errors
\DBG::activate(DBG_PHP);
set_error_handler(array($this, 'phpErrorsAsExceptionsHandler'));
$this->errrorHandlerActive = true;
// Since DBG catches the rest (E_PARSE) let's use that
ob_start();
$function = create_function('$em, $cx', '' . $this->code . ';');
$dbgContents = ob_get_clean();
\DBG::activate($dbgMode);
if (!is_callable($function)) {
// parse exception
throw new SandboxException($dbgContents);
}
$this->result = var_export($function(\Env::get('em'), \Env::get('cx')), true);
restore_error_handler();
$this->errrorHandlerActive = false;
} catch (\Exception $e) {
\DBG::activate($dbgMode);
restore_error_handler();
$this->errrorHandlerActive = false;
$this->result = get_class($e) . ': ' . $e->getMessage();
}
break;
default:
break;
}
}
示例3: restoreDebuggingParams
/**
* Expands debugging behaviour with behaviour stored in session if specified and active.
*
* @access private
*/
private function restoreDebuggingParams()
{
if (isset($_SESSION['debugging']) && $_SESSION['debugging']) {
DBG::activate(DBG::getMode() | $_SESSION['debugging_flags']);
}
}
示例4: getPage
//.........这里部分代码省略.........
break;
case 'cart':
self::cart();
break;
case 'discounts':
self::discounts();
break;
case 'login':
self::login();
break;
case 'paypalIpnCheck':
// OBSOLETE -- Handled by PaymentProcessing::checkIn() now
$objPaypal = new \PayPal();
$objPaypal->ipnCheck();
exit;
case 'sendpass':
self::view_sendpass();
break;
case 'changepass':
self::_changepass();
break;
// Test for PayPal IPN.
// *DO NOT* remove this! Needed for site testing.
// Test for PayPal IPN.
// *DO NOT* remove this! Needed for site testing.
case 'testIpn':
\PayPal::testIpn();
// die()s!
// Test for PayPal IPN validation
// *DO NOT* remove this! Needed for site testing.
// die()s!
// Test for PayPal IPN validation
// *DO NOT* remove this! Needed for site testing.
case 'testIpnValidate':
\PayPal::testIpnValidate();
// die()s!
// Test mail body generation
// *DO NOT* remove this! Needed for site testing.
// die()s!
// Test mail body generation
// *DO NOT* remove this! Needed for site testing.
case 'testMail':
// Test with
// http://localhost/contrexx_300/de/index.php?section=Shop&act=testMail&key=&order_id=5
//MailTemplate::errorHandler();die();
$order_id = !empty($_GET['order_id']) ? $_GET['order_id'] : 10;
$key = !empty($_GET['key']) ? $_GET['key'] : 'order_confirmation';
$arrSubstitution = Orders::getSubstitutionArray($order_id);
$customer_id = $arrSubstitution['CUSTOMER_ID'];
$objCustomer = Customer::getById($customer_id);
if (!$objCustomer) {
die("Failed to get Customer for ID {$customer_id}");
return false;
}
$arrSubstitution += $objCustomer->getSubstitutionArray($customer_id) + self::getSubstitutionArray();
$arrMailTemplate = array('section' => 'Shop', 'key' => $key, 'lang_id' => $arrSubstitution['LANG_ID'], 'substitution' => &$arrSubstitution, 'to' => 'reto.kohli@comvation.com');
\DBG::activate(DBG_LOG_FIREPHP);
// DBG::activate(DBG_LOG_FILE);
die(nl2br(contrexx_raw2xhtml(var_export($arrMailTemplate, true))));
// DBG::log(MailTemplate::send($arrMailTemplate) ? "Sent successfully" : "Sending FAILED!");
// DBG::deactivate(DBG_LOG_FILE);
break;
case 'testAttachment':
\Cx\Core\MailTemplate\Controller\MailTemplate::send(array('from' => 'reto.kohli@comvation.com', 'to' => 'reto.kohli@comvation.com', 'subject' => 'Test Attachment', 'message' => 'Test', 'attachments' => array(0 => 'images/content/banner/qualidator.gif', 'images/content/banner/itnews.gif' => 'Sch�nes Bild')));
die("Done!");
case 'pricelist':
self::send_pricelist();
break;
case 'terms':
// Static content only (fttb)
break;
// TODO: Add Order history view (see History.class.php)
// case 'history':
// self::view_history();
// break;
// TODO: Add Order history view (see History.class.php)
// case 'history':
// self::view_history();
// break;
case 'destroy':
self::destroyCart();
// TODO: Experimental
// self::destroyCart(true);
// No break on purpose
// TODO: Experimental
// self::destroyCart(true);
// No break on purpose
case 'lastFive':
case 'products':
default:
self::view_product_overview();
}
// Note that the Shop Navbar *MUST* be set up *after* the request
// has been processed, otherwise the cart info won't be up to date!
self::setNavbar();
// TODO: Set the Messages in the global template instead when that's ready
\Message::show(self::$objTemplate);
//\DBG::deactivate();
return self::$objTemplate->get();
}
示例5: sql2Yaml
protected function sql2Yaml($sql)
{
\DBG::activate(DBG_PHP);
$em = \Env::get('em');
$em->getConfiguration()->setMetadataDriverImpl(new \Doctrine\ORM\Mapping\Driver\DatabaseDriver($em->getConnection()->getSchemaManager()));
$cmf = new \Doctrine\ORM\Tools\DisconnectedClassMetadataFactory();
$cmf->setEntityManager($em);
return;
$metadata = $cmf->getMetadataFor('ContrexxContentPage');
//$metadata = $cmf->getAllMetadata();
$exporter = $cme->getExporter('yml', '/path/to/export/yml');
$exporter->setMetadata($metadata);
return $exporter->export();
}
示例6: restoreDebuggingParams
/**
* Expands debugging behaviour with behaviour stored in session if specified and active.
*
* @access protected
*/
protected function restoreDebuggingParams()
{
if (isset($this['debugging']) && $this['debugging']) {
\DBG::activate(\DBG::getMode() | $this['debugging_flags']);
}
}