• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP xdebug_is_enabled函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中xdebug_is_enabled函数的典型用法代码示例。如果您正苦于以下问题:PHP xdebug_is_enabled函数的具体用法?PHP xdebug_is_enabled怎么用?PHP xdebug_is_enabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: checkXDebug

 /**
  * @throws \RuntimeException
  */
 protected function checkXDebug()
 {
     if (extension_loaded('xdebug') && xdebug_is_enabled() && ini_get('xdebug.max_nesting_level') < 200) {
         $errorMessage = 'Please change PHP ini setting "xdebug.max_nesting_level". ' . 'Please change it to a value >= 200. ' . 'Your current value is ' . ini_get('xdebug.max_nesting_level');
         throw new \RuntimeException($errorMessage);
     }
 }
开发者ID:ktomk,项目名称:n98-magerun2,代码行数:10,代码来源:PreCheckPhp.php


示例2: xdebugIsEnabled

 public static function xdebugIsEnabled()
 {
     if (extension_loaded('xdebug')) {
         return (bool) xdebug_is_enabled();
     }
     return false;
 }
开发者ID:eric-burel,项目名称:twentyparts,代码行数:7,代码来源:Debugger.class.php


示例3: _before

 public function _before(\Codeception\TestCase $test)
 {
     if (!$this->client) {
         if (!strpos($this->config['url'], '://')) {
             // not valid url
             foreach ($this->getModules() as $module) {
                 if ($module instanceof \Codeception\Lib\Framework) {
                     $this->client = $module->client;
                     $this->isFunctional = true;
                     break;
                 }
             }
         } else {
             if (!$this->hasModule('PhpBrowser')) {
                 throw new ModuleConfigException(__CLASS__, "For REST testing via HTTP please enable PhpBrowser module");
             }
             $this->client = $this->getModule('PhpBrowser')->client;
         }
         if (!$this->client) {
             throw new ModuleConfigException(__CLASS__, "Client for REST requests not initialized.\nProvide either PhpBrowser module, or a framework module which shares FrameworkInterface");
         }
     }
     $this->headers = array();
     $this->params = array();
     $this->response = "";
     $this->client->setServerParameters(array());
     if ($this->config['xdebug_remote'] && function_exists('xdebug_is_enabled') && xdebug_is_enabled() && ini_get('xdebug.remote_enable') && !$this->isFunctional) {
         $cookie = new Cookie('XDEBUG_SESSION', $this->config['xdebug_remote'], null, '/');
         $this->client->getCookieJar()->set($cookie);
     }
 }
开发者ID:huynt57,项目名称:bluebee-uet.com,代码行数:31,代码来源:REST.php


示例4: traceStop

function traceStop()
{
    if (!function_exists('xdebug_is_enabled') || !xdebug_is_enabled()) {
        return;
    }
    xdebug_stop_trace();
}
开发者ID:alencarmo,项目名称:OCF,代码行数:7,代码来源:xdebug.php


示例5: isXdebugActive

 /**
  * XDebug Helper Functions.
  */
 public static function isXdebugActive()
 {
     if (extension_loaded('xdebug') and xdebug_is_enabled()) {
         return true;
     }
     return false;
 }
开发者ID:ksst,项目名称:kf,代码行数:10,代码来源:XDebug.php


示例6: _initialize

 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param  KObjectConfig $config An optional ObjectConfig object with configuration options.
  * @return void
  */
 protected function _initialize(KObjectConfig $config)
 {
     if (extension_loaded('xdebug') && xdebug_is_enabled() && getenv('JOOMLATOOLS_BOX')) {
         $level = self::ERROR_DEVELOPMENT;
         $type = self::TYPE_ALL;
     } else {
         $level = JDEBUG ? E_ERROR | E_PARSE : self::ERROR_REPORTING;
         $type = JDEBUG ? self::TYPE_ALL : false;
     }
     $config->append(array('exception_type' => $type, 'error_reporting' => $level));
     parent::_initialize($config);
 }
开发者ID:daodaoliang,项目名称:nooku-framework,代码行数:20,代码来源:handler.php


示例7: soapclient

 private function soapclient($host)
 {
     $xdebug_enabled = function_exists('xdebug_is_enabled') ? xdebug_is_enabled() : false;
     if ($xdebug_enabled) {
         xdebug_disable();
     }
     set_error_handler('esx_init_error_handler');
     $this->soap = new SoapClient('https://' . $host . '/sdk/vimService.wsdl', array('location' => 'https://' . $host . '/sdk/', 'uri' => 'urn:vim25', 'exceptions' => true, 'soap_version' => '1.1', 'trace' => true, 'cache_wsdl' => WSDL_CACHE_BOTH, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
     restore_error_handler();
     if ($xdebug_enabled) {
         xdebug_enable();
     }
 }
开发者ID:gunesahmet,项目名称:php-esx,代码行数:13,代码来源:class_esx.php


示例8: _before

 public function _before(\Codeception\TestCase $test)
 {
     if (!$this->client) {
         if (!strpos($this->config['url'], '://')) {
             // not valid url
             foreach ($this->getModules() as $module) {
                 if ($module instanceof \Codeception\Util\Framework) {
                     $this->client = $module->client;
                     $this->is_functional = true;
                     break;
                 }
             }
         } else {
             if (!$this->hasModule('PhpBrowser')) {
                 throw new ModuleConfigException(__CLASS__, "For REST testing via HTTP please enable PhpBrowser module");
             }
             $this->client = $this->getModule('PhpBrowser')->session->getDriver()->getClient();
         }
         if (!$this->client) {
             throw new ModuleConfigException(__CLASS__, "Client for REST requests not initialized.\nProvide either PhpBrowser module, or a framework module which shares FrameworkInterface");
         }
     }
     $this->headers = array();
     $this->params = array();
     $this->response = "";
     $this->client->setServerParameters(array());
     $timeout = $this->config['timeout'];
     if ($this->config['xdebug_remote'] && function_exists('xdebug_is_enabled') && xdebug_is_enabled() && ini_get('xdebug.remote_enable')) {
         $cookie = new Cookie('XDEBUG_SESSION', $this->config['xdebug_remote'], null, '/');
         $this->client->getCookieJar()->set($cookie);
         // timeout is disabled, so we can debug gently :)
         $timeout = 0;
     }
     if (method_exists($this->client, 'getClient')) {
         $clientConfig = $this->client->getClient()->getConfig();
         $curlOptions = $clientConfig->get('curl.options');
         $curlOptions[CURLOPT_TIMEOUT] = $timeout;
         $clientConfig->set('curl.options', $curlOptions);
     }
 }
开发者ID:pfz,项目名称:codeception,代码行数:40,代码来源:REST.php


示例9: __construct

 public function __construct($wsdl, $options = array('exceptions' => 1))
 {
     $xdebugIsDisabled = false;
     try {
         if (function_exists('xdebug_is_enabled') && xdebug_is_enabled()) {
             xdebug_disable();
             $xdebugIsDisabled = true;
         }
         if (!isset($options['exceptions'])) {
             $options['exceptions'] = 1;
         }
         @parent::__construct($wsdl, $options);
         if ($xdebugIsDisabled) {
             xdebug_enable();
         }
     } catch (SoapFault $e) {
         if ($xdebugIsDisabled) {
             xdebug_enable();
         }
         throw new RuntimeException(sprintf('Failed initialize SoapClient. Error: "%s"', $e->getMessage()));
     }
 }
开发者ID:fightmaster,项目名称:php-wsdl-proxy-generator,代码行数:22,代码来源:SoapClient.php


示例10: checkDeprecatedAttributes

 /**
  * Checks for deprecated attributes and warns the developer - only displays a 
  * message if debugging is enabled.
  *
  * @see  http://dev.w3.org/html5/html4-differences/#absent-attributes
  */
 protected static function checkDeprecatedAttributes($tag, $attrs)
 {
     $deprecated[RenderContext::LANG_HTML]['5'] = array('a' => array('charset', 'coords', 'rev', 'shape'), 'area' => array('nohref'), 'body' => array('alink', 'background', 'bgcolor', 'link', 'text', 'vlink'), 'br' => array('clear'), 'caption' => array('align'), 'col' => array('align', 'char', 'charoff', 'valign', 'width'), 'colgroup' => array('align', 'char', 'charoff', 'valign', 'width'), 'div' => array('align'), 'dl' => array('compact'), 'h1' => array('align'), 'h2' => array('align'), 'h3' => array('align'), 'h4' => array('align'), 'h5' => array('align'), 'h6' => array('align'), 'head' => array('profile'), 'hr' => array('align', 'noshade', 'size', 'width'), 'html' => array('version'), 'iframe' => array('align', 'frameborder', 'marginheight', 'longdesc', 'marginwidth', 'scrolling'), 'img' => array('align', 'hspace', 'longdesc', 'name', 'vspace'), 'input' => array('align'), 'legend' => array('align'), 'li' => array('type'), 'link' => array('charset', 'rev', 'target'), 'menu' => array('compact'), 'meta' => array('scheme'), 'object' => array('align', 'archive', 'border', 'classid', 'codebase', 'codetype', 'declare', 'hspace', 'standby', 'vspace'), 'ol' => array('compact', 'type'), 'p' => array('align'), 'param' => array('type', 'valuetype'), 'pre' => array('width'), 'table' => array('align', 'bgcolor', 'border', 'cellpadding', 'cellspacing', 'frame', 'rules', 'width'), 'tbody' => array('align', 'char', 'charoff', 'valign'), 'td' => array('abbr', 'align', 'axis', 'bgcolor', 'char', 'charoff', 'height', 'nowrap', 'scope', 'valign', 'width'), 'tfoot' => array('align', 'char', 'charoff', 'valign'), 'th' => array('abbr', 'align', 'axis', 'bgcolor', 'char', 'charoff', 'height', 'nowrap', 'valign', 'width'), 'thead' => array('align', 'char', 'charoff', 'valign'), 'tr' => array('align', 'bgcolor', 'char', 'charoff', 'valign'), 'ul' => array('compact', 'type'));
     $deprecated[RenderContext::LANG_XHTML]['5'] =& $deprecated[RenderContext::LANG_HTML]['5'];
     $ctx = RenderContext::get();
     $x = $deprecated;
     if (array_key_exists($ctx->getLanguage(), $x)) {
         $x = $x[$ctx->getLanguage()];
         if (array_key_exists("{$ctx->getVersion()}", $x)) {
             $x = $x[$ctx->getVersion()];
             if (in_array($tag, array_keys($x))) {
                 $x = $x[$tag];
                 foreach ($attrs as $a) {
                     if (!in_array($a, $x)) {
                         continue;
                     }
                     $restore_xdebug = false;
                     if (extension_loaded('xdebug')) {
                         $restore_xebug = xdebug_is_enabled();
                         # A complete stack trace is overkill for a deprecation error
                         xdebug_disable();
                     }
                     trigger_error("'{$tag}[{$a}]' is deprecated or removed in {$ctx->getLanguage()} {$ctx->getVersion()}", E_USER_DEPRECATED);
                     if ($restore_xdebug) {
                         xdebug_enable();
                     }
                 }
             }
         }
     }
 }
开发者ID:ngnpope,项目名称:jerity,代码行数:37,代码来源:Tag.php


示例11: connect

 /**
  * connect to the database; returns Doctrine connection
  *
  * @access public
  * @return object
  **/
 public static function connect($opt = array())
 {
     self::setExceptionHandler();
     if (!self::$conn) {
         $config = new \Doctrine\DBAL\Configuration();
         $config->setSQLLogger(new Doctrine\DBAL\Logging\DebugStack());
         if (!defined('CAT_DB_NAME') && file_exists(dirname(__FILE__) . '/../../../config.php')) {
             include dirname(__FILE__) . '/../../../config.php';
         }
         $connectionParams = array('charset' => 'utf8', 'driver' => 'pdo_mysql', 'dbname' => isset($opt['DB_NAME']) ? $opt['DB_NAME'] : CAT_DB_NAME, 'host' => isset($opt['DB_HOST']) ? $opt['DB_HOST'] : CAT_DB_HOST, 'password' => isset($opt['DB_PASSWORD']) ? $opt['DB_PASSWORD'] : CAT_DB_PASSWORD, 'user' => isset($opt['DB_USERNAME']) ? $opt['DB_USERNAME'] : CAT_DB_USERNAME, 'port' => isset($opt['DB_PORT']) ? $opt['DB_PORT'] : CAT_DB_PORT);
         if (function_exists('xdebug_is_enabled')) {
             $xdebug_state = xdebug_is_enabled();
         } else {
             $xdebug_state = false;
         }
         if (function_exists('xdebug_disable')) {
             xdebug_disable();
         }
         try {
             self::$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
         } catch (\PDO\PDOException $e) {
             $this->setError($e->message);
             CAT_Object::printFatalError($e->message);
         }
         if (function_exists('xdebug_enable') && $xdebug_state) {
             xdebug_enable();
         }
     }
     self::restoreExceptionHandler();
     return self::$conn;
 }
开发者ID:ircoco,项目名称:BlackCatCMS,代码行数:37,代码来源:DB.php


示例12: __construct

 protected final function __construct()
 {
     // Turn error reporting off as it is displayed in debugger mode only!
     ini_set('display_errors', false);
     // Show ALL errors & notices
     error_reporting(E_ALL ^ E_NOTICE);
     ini_set('ignore_repeated_errors', true);
     ini_set('ignore_repeated_source', true);
     // Enable HTML Error messages
     ini_set('html_errors', true);
     ini_set('docref_root', 'http://docs.php.net/manual/en/');
     ini_set('docref_ext', '.php');
     // Define the Error & Exception handlers
     set_error_handler(array(&$this, 'errorLogger'), ini_get('error_reporting'));
     set_exception_handler(array(&$this, 'exceptionHandler'));
     // Enable debugger
     if (isset($GLOBALS['config']) && is_object($GLOBALS['config'])) {
         $this->_enabled = (bool) $GLOBALS['config']->get('config', 'debug');
         $ip_string = $GLOBALS['config']->get('config', 'debug_ip_addresses');
         if (!empty($ip_string)) {
             if (strstr($ip_string, ',')) {
                 $ip_addresses = explode(',', $ip_string);
                 if (!in_array(get_ip_address(), $ip_addresses)) {
                     $this->_enabled = false;
                 }
             } else {
                 if ($ip_string !== get_ip_address()) {
                     $this->_enabled = false;
                 }
             }
         }
     }
     //If its time to clear the cache
     if (isset($_GET['debug-cache-clear'])) {
         $GLOBALS['cache']->clear();
         $GLOBALS['cache']->tidy();
         httpredir(currentPage(array('debug-cache-clear')));
     }
     //Check for xdebug
     if (extension_loaded('xdebug') && function_exists('xdebug_is_enabled')) {
         $this->_xdebug = xdebug_is_enabled();
     }
     $this->_debug_timer = $this->_getTime();
     // Check register_globals
     if (ini_get('register_globals')) {
         trigger_error('register_globals are enabled. It is highly recommended that you disable this in your PHP configuration, as it is a large security hole, and may wreak havoc.', E_USER_WARNING);
     }
     Sanitize::cleanGlobals();
 }
开发者ID:Geotex,项目名称:v6,代码行数:49,代码来源:debug.class.php


示例13: extension_loaded

">
						<?php 
echo $core_lang->get_value($lang_order[0]);
?>
					</div>
					&#41;
				</span>
				<span class="labs-platform"><?php 
echo $lang->running_on(CORE_TITLE, CORE_VERSION, PHP_VERSION);
?>
</span>
			</div>
		</div>

		<?php 
$xdebug_enabled = extension_loaded('xdebug') && xdebug_is_enabled();
?>

		<div id="content">
			<div class="content">
				<ul id="toolbar">
					<li data-href=""><?php 
echo $lang->button_run;
?>
</li>
					<?php 
if ($xdebug_enabled) {
    $extra_class = isset($_GET['class']) ? 'class=' . urlencode($_GET['class']) . '&' : null;
    ?>
					<li data-href="?<?php 
    echo $extra_class;
开发者ID:rentalhost,项目名称:core,代码行数:31,代码来源:page.php


示例14: die

if (!class_exists('SemanticMediaWiki') || ($version = SemanticMediaWiki::getVersion()) === null) {
    die("\\Semantic MediaWiki is not available, please check your LocalSettings or Composer settings.\n");
}
// @codingStandardsIgnoreStart phpcs, ignore --sniffs=Generic.Files.LineLength.MaxExceeded
print sprintf("\n%-20s%s\n", "Semantic MediaWiki:", $version . ' (' . implode(', ', SemanticMediaWiki::getEnvironment()) . ')');
// @codingStandardsIgnoreEnd
if (is_readable($path = __DIR__ . '/../vendor/autoload.php')) {
    print sprintf("%-20s%s\n", "MediaWiki:", $GLOBALS['wgVersion'] . " (Extension vendor autoloader)");
} elseif (is_readable($path = __DIR__ . '/../../../vendor/autoload.php')) {
    print sprintf("%-20s%s\n", "MediaWiki:", $GLOBALS['wgVersion'] . " (MediaWiki vendor autoloader)");
} else {
    die('To run tests it is required that packages are installed using Composer.');
}
print sprintf("%-20s%s\n", "Site language:", $GLOBALS['wgLanguageCode']);
$dateTimeUtc = new \DateTime('now', new \DateTimeZone('UTC'));
print sprintf("\n%-20s%s\n", "Execution time:", $dateTimeUtc->format('Y-m-d h:i'));
if (extension_loaded('xdebug') && xdebug_is_enabled()) {
    print sprintf("%-20s%s\n\n", "Xdebug:", phpversion('xdebug') . ' (enabled)');
} else {
    print sprintf("%-20s%s\n\n", "Xdebug:", 'Disabled (or not installed)');
}
/**
 * Available to aid third-party extensions therefore any change should be made with
 * care
 *
 * @since  2.0
 */
$autoloader = (require $path);
$autoloader->addPsr4('SMW\\Tests\\Utils\\', __DIR__ . '/phpunit/Utils');
$autoloader->addClassMap(array('SMW\\Tests\\TestEnvironment' => __DIR__ . '/phpunit/TestEnvironment.php', 'SMW\\Tests\\MwDBaseUnitTestCase' => __DIR__ . '/phpunit/MwDBaseUnitTestCase.php', 'SMW\\Tests\\ByJsonTestCaseProvider' => __DIR__ . '/phpunit/ByJsonTestCaseProvider.php', 'SMW\\Tests\\JsonTestCaseFileHandler' => __DIR__ . '/phpunit/JsonTestCaseFileHandler.php', 'SMW\\Test\\QueryPrinterTestCase' => __DIR__ . '/phpunit/QueryPrinterTestCase.php', 'SMW\\Test\\QueryPrinterRegistryTestCase' => __DIR__ . '/phpunit/QueryPrinterRegistryTestCase.php'));
return $autoloader;
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:31,代码来源:autoloader.php


示例15: getTrace

 /**
  * Gets the backgrace from an exception.
  *
  * If xdebug is installed
  *
  * @param Exception $e
  * @return array
  */
 protected function getTrace(\Exception $e)
 {
     $traces = $e->getTrace();
     // Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default
     if (!$e instanceof \ErrorException) {
         return $traces;
     }
     if (!Misc::isLevelFatal($e->getSeverity())) {
         return $traces;
     }
     if (!extension_loaded('xdebug') || !xdebug_is_enabled()) {
         return array();
     }
     // Use xdebug to get the full stack trace and remove the shutdown handler stack trace
     $stack = array_reverse(xdebug_get_function_stack());
     $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
     $traces = array_diff_key($stack, $trace);
     return $traces;
 }
开发者ID:ExplodingCabbage,项目名称:whoops,代码行数:27,代码来源:Inspector.php


示例16: get_connection

 /**
  * Connect to the web service and return the connection
  *
  * @since 0.1
  * @throws SoapFault for the following conditions:
  *         Invalid username/password
  *         WSDL error/unavailable (note that XDebug must be disabled otherwise this becomes a un-catchable fatal.  This can be done with xdebug_disable() followed by xdebug_enable() )
  * @return SoapClient connection to the web service
  */
 private function get_connection()
 {
     if (is_object($this->client)) {
         return $this->client;
     }
     $enable_xdebug = function_exists('xdebug_is_enabled') && xdebug_is_enabled() ? true : false;
     // disable xdebug
     if (function_exists('xdebug_disable')) {
         xdebug_disable();
     }
     // setup a new SoapClient and don't cache the WSDL
     $this->client = @new SoapClient($this->endpoint, array('cache_wsdl' => 'WSDL_CACHE_NONE'));
     // enable xdebug
     if ($enable_xdebug && function_exists('xdebug_enable')) {
         xdebug_enable();
     }
     return $this->client;
 }
开发者ID:costinelmarin,项目名称:woocommerce-sage-erp-connector,代码行数:27,代码来源:class-wc-sage-erp-connector-api.php


示例17: __construct

 /**
  *    Sets the name of the test suite.
  *    @param string $label    Name sent at the start and end
  *                            of the test.
  *    @access public
  */
 function __construct($label = false)
 {
     $this->_label = $label ? $label : get_class($this);
     $this->_test_cases = array();
     $this->_old_track_errors = ini_get('track_errors');
     $this->_xdebug_is_enabled = function_exists('xdebug_is_enabled') ? xdebug_is_enabled() : false;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:13,代码来源:test_case.php


示例18: fetchLog

    function fetchLog()
    {
        global $cfg;
        if ($cfg['servertype'] == 'prod') {
            return "";
        }
        if ($this->enabled) {
            $this->printed = true;
            ob_start();
            ?>
	    <div id="log">
	        <table id="log" border="1" summary="table">
	    	<thead>
			<?php 
            print LogEntry::getHeader();
            ?>
	    	</thead>
	    	<tbody>
			<?php 
            for ($i = count($this->entries) - 1; $i >= 0; $i--) {
                $row = $this->entries[$i];
                print $row->getEntry();
            }
            ?>
	    	    <tr>
			    <?php 
            $peak_mem = sprintf("%.3f MB", memory_get_peak_usage() / 1000000);
            $memory_limit = ini_get('memory_limit');
            if (function_exists("xdebug_is_enabled") && xdebug_is_enabled()) {
                $time_in_db = Dbase::get_all_timer_info();
                $time = sprintf("%.3f ms", xdebug_time_index() * 1000);
            }
            echo <<<EOT
\t\t<pre>
\t\tFinal Debugging Info
\t\tTotal time taken      : {$time}
\t\tPeak Memory Used      : {$peak_mem}
\t\tTime spend in DB      : {$time_in_db}
\t\tMemory Limit          : {$memory_limit};
\t\t</pre>
EOT;
            ?>
	    	    </tr>
	    	</tbody>
	        </table>
	    </div>
	    <?php 
            return ob_get_clean();
            //return  "Log: ".$this->getLevel()."\n".str_replace("<br />","\n", $this->msg)." ";
        }
    }
开发者ID:rajnishp,项目名称:bjs,代码行数:51,代码来源:ShopbookLogger.php


示例19: GroupTest

 function GroupTest($label)
 {
     $this->_label = $label;
     $this->_test_cases = array();
     $this->_old_track_errors = ini_get('track_errors');
     $this->_xdebug_is_enabled = function_exists('xdebug_is_enabled') ? xdebug_is_enabled() : false;
 }
开发者ID:BackupTheBerlios,项目名称:phpbase-svn,代码行数:7,代码来源:simple_test.php


示例20: render

 public function render($nameOrModel, $values = null)
 {
     if ($nameOrModel instanceof Model) {
         $model = $nameOrModel;
         $nameOrModel = $model->getTemplate();
         if (empty($nameOrModel)) {
             throw new Exception\DomainException(sprintf('%s: received View Model argument, but template is empty', __METHOD__));
         }
         $options = $model->getOptions();
         foreach ($options as $setting => $value) {
             $method = 'set' . $setting;
             if (method_exists($this, $method)) {
                 $this->{$method}($value);
             }
             unset($method, $setting, $value);
         }
         unset($options);
         // Give view model awareness via ViewModel helper
         $helper = $this->plugin('view_model');
         $helper->setCurrent($model);
         $values = $model->getVariables();
         unset($model);
     }
     $this->__engine->set('doctype', $this->doctype());
     $this->__engine->set('headTitle', $this->headTitle());
     $this->__engine->set('headScript', $this->headScript());
     $this->__engine->set('headLink', $this->headLink());
     $this->__engine->set('headMeta', $this->headMeta());
     $this->__engine->set('headStyle', $this->headStyle());
     $this->__engine->set('content', '');
     $values = $values ?: array();
     foreach ($values as $key => $value) {
         $this->__engine->set($key, $value);
     }
     if ($this->__purgeCacheBeforeRender) {
         $cacheFolder = $this->__engine->getPhpCodeDestination();
         if (is_dir($cacheFolder)) {
             foreach (new DirectoryIterator($cacheFolder) as $cacheItem) {
                 if (strncmp($cacheItem->getFilename(), 'tpl_', 4) != 0 || $cacheItem->isdir()) {
                     continue;
                 }
                 @unlink($cacheItem->getPathname());
             }
         }
     }
     $template = $this->resolver($nameOrModel);
     $this->__engine->setTemplate($template);
     unset($nameOrModel);
     unset($template);
     if ($this->__compressWhitespace == true) {
         $this->__engine->addPreFilter(new PHPTAL_PreFilter_Compress());
     }
     try {
         $result = $this->__engine->execute();
     } catch (PHPTAL_TemplateException $e) {
         // If the exception is a root PHPTAL_TemplateException
         // rather than a subclass of this exception and xdebug is enabled,
         // it will have already been picked up by xdebug, if enabled, and
         // should be shown like any other php error.
         // Any subclass of PHPTAL_TemplateException can be handled by
         // the phptal internal exception handler as it gives a useful
         // error output
         if (get_class($e) == 'PHPTAL_TemplateException' && function_exists('xdebug_is_enabled') && xdebug_is_enabled()) {
             exit;
         }
         throw $e;
     }
     return $result;
 }
开发者ID:niterain,项目名称:ZF2_PhpTalModule,代码行数:69,代码来源:PhpTalRenderer.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP xdebug_memory_usage函数代码示例发布时间:2022-05-23
下一篇:
PHP xdebug_get_profiler_filename函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap