本文整理汇总了PHP中xdebug_disable函数的典型用法代码示例。如果您正苦于以下问题:PHP xdebug_disable函数的具体用法?PHP xdebug_disable怎么用?PHP xdebug_disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xdebug_disable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($config = array())
{
$this->config = array_merge($this->defaults, $config);
ob_start();
$this->checkFolderStructure();
if ($this->config['log_errors']) {
ini_set('log_errors', 1);
ini_set('error_log', $this->config['payload'] . DIRECTORY_SEPARATOR . $this->config['error_log']);
}
if ($this->config['show_errors']) {
ini_set('display_errors', 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
error_reporting(E_ALL | E_STRICT);
} else {
error_reporting(0);
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
// TODO: send mail on fatal errors
}
set_error_handler(array($this, 'handleError'));
set_exception_handler(array($this, 'handleException'));
register_shutdown_function(array($this, 'shutdownHandler'), $this);
}
示例2: Execute
protected function Execute($code)
{
try {
error_reporting(-1);
ini_set('display_errors', false);
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
set_error_handler(array($this, 'HandleError'));
ob_start();
$this->BeforeExecute();
$this->exec_data['Result'] = eval($code);
$this->AfterExecute();
$this->exec_data['Output'] = ob_get_clean();
if (!$this->exec_data['Output']) {
unset($this->exec_data['Output']);
}
restore_error_handler();
} catch (Exception $ex) {
if (!isset($this->exec_data['Errors'])) {
$this->exec_data['Errors'] = array();
}
$this->exec_data['Errors'][] = $ex;
}
}
示例3: execute
function execute(HTTPRequestCustom $request)
{
session_start();
$data = PersistenceContext::get_querier()->select_single_row(PREFIX . 'member', array('user_id'), 'WHERE login=:user_login', array('user_login' => $_SESSION['wpimport']['default_author']));
$_SESSION['wpimport']['wppath'] = substr($_SESSION['wpimport']['wppath'], -1) != '/' ? $_SESSION['wpimport']['wppath'] . '/' : $_SESSION['wpimport']['wppath'];
$_SESSION['wpimport']['phpboostpath'] = substr($_SESSION['wpimport']['phpboostpath'], -1) != '/' ? $_SESSION['wpimport']['phpboostpath'] . '/' : $_SESSION['wpimport']['phpboostpath'];
define('WP_PATH', $_SESSION['wpimport']['wppath']);
define('PBOOST_PATH', $_SESSION['wpimport']['phpboostpath']);
define('IMPORTER_LIST', $_SESSION['wpimport']['importer']);
define('PHPBOOST_CAT_IMAGE', $_SESSION['wpimport']['default_cat_image']);
define('FILESYSTEM_IMPORT_LOCATION', $_SESSION['wpimport']['import_location']);
define('DEFAULT_AUTHOR_ID', $data['user_id']);
ini_set('max_execution_time', 0);
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
ob_start();
echo 'Start import : ' . date('H:i:s') . PHP_EOL;
echo '-----' . PHP_EOL . PHP_EOL;
$success = (require_once __DIR__ . '/../WP2PhpBoost/wp2phpboost.php');
echo 'Clean cache...' . PHP_EOL;
AppContext::get_cache_service()->clear_cache();
echo PHP_EOL . PHP_EOL;
echo '-----' . PHP_EOL;
echo 'End import : ' . date('H:i:s');
$logs = ob_get_clean();
return new JSONResponse(array('success' => $success, 'logs' => utf8_decode($logs)));
}
示例4: testFatalError
public function testFatalError()
{
if (extension_loaded('xdebug')) {
xdebug_disable();
}
non_existing_function();
}
示例5: testLoadVendorDatabaseBadMask
public function testLoadVendorDatabaseBadMask()
{
// Disable PHPUnit's error handler which would stop execution upon the
// first error.
\PHPUnit_Framework_Error_Notice::$enabled = false;
// Disable all console error output
$displayErrors = ini_get('display_errors');
$logErrors = ini_get('log_errors');
ini_set('display_errors', false);
ini_set('log_errors', false);
if (extension_loaded('xdebug')) {
xdebug_disable();
}
// Invoke the tested method
$input = array("13/37\tshort7", "00:00:5E:00:53:00\tshort");
MacAddress::loadVendorDatabase($input);
// Restore error handling
\PHPUnit_Framework_Error_Notice::$enabled = true;
if (ini_get('xdebug.default_enable')) {
xdebug_enable();
}
ini_set('display_errors', $displayErrors);
ini_set('log_errors', $logErrors);
// Test the generated error
$lastError = error_get_last();
$this->assertEquals(E_USER_NOTICE, $lastError['type']);
$this->assertEquals('Ignoring MAC address 13/37 because mask is not a multiple of 4.', $lastError['message']);
// Parsing should continue after error.
$expected = array(array('address' => '00005E005300', 'length' => 12, 'vendor' => 'short'));
$reflectionClass = new \ReflectionClass('Library\\MacAddress');
$this->assertEquals($expected, $reflectionClass->getStaticProperties()['_vendorList']);
}
示例6: testFatalError
public function testFatalError()
{
if (extension_loaded('xdebug')) {
xdebug_disable();
}
eval('class FatalTest {}');
}
示例7: JsHttpRequest
/**
* Constructor.
*
* Create new JsHttpRequest backend object and attach it
* to script output buffer. As a result - script will always return
* correct JavaScript code, even in case of fatal errors.
*
* QUERY_STRING is in form of: PHPSESSID=<sid>&a=aaa&b=bbb&JsHttpRequest=<id>-<loader>
* where <id> is a request ID, <loader> is a loader name, <sid> - a session ID (if present),
* PHPSESSID - session parameter name (by default = "PHPSESSID").
*
* If an object is created WITHOUT an active AJAX query, it is simply marked as
* non-active. Use statuc method isActive() to check.
*/
function JsHttpRequest($enc)
{
global $JsHttpRequest_Active;
$GLOBALS['_RESULT'] =& $this->RESULT;
if (preg_match('/^(.*)(?:&|^)_JsRequest=(?:(\\d+)-)?([^&]+)((?:&|$).*)$/s', @$_SERVER['QUERY_STRING'], $m)) {
$this->ID = $m[2];
$this->LOADER = strtolower($m[3]);
$_SERVER['QUERY_STRING'] = preg_replace('/^&+|&+$/s', '', preg_replace('/(^|&)' . session_name() . '=[^&]*&?/s', '&', $m[1] . $m[4]));
unset($_GET['_JsRequest'], $_REQUEST['_JsRequest'], $_GET[session_name()], $_POST[session_name()], $_REQUEST[session_name()]);
$this->_unicodeConvMethod = function_exists('mb_convert_encoding') ? 'mb' : (function_exists('iconv') ? 'iconv' : null);
$this->_emergBuffer = str_repeat('a', 1024 * 200);
$this->_uniqHash = md5('Request' . microtime() . getmypid());
$this->_prevDisplayErrors = ini_get('display_errors');
ini_set('display_errors', $this->_magic);
//
ini_set('error_prepend_string', $this->_uniqHash . ini_get('error_prepend_string'));
ini_set('error_append_string', ini_get('error_append_string') . $this->_uniqHash);
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
// else Fatal errors are not catched
ob_start(array(&$this, "_obHandler"));
$JsHttpRequest_Active = true;
$this->setEncoding($enc);
$file = $line = null;
$headersSent = version_compare(PHP_VERSION, "4.3.0") < 0 ? headers_sent() : headers_sent($file, $line);
if ($headersSent) {
trigger_error("HTTP headers are already sent" . ($line !== null ? " in {$file} on line {$line}" : " somewhere in the script") . ". " . "Possibly you have an extra space (or a newline) before the first line of the script or any library. " . "Please note that JsHttpRequest uses its own Content-Type header and fails if " . "this header cannot be set. See header() function documentation for more details", E_USER_ERROR);
exit;
}
} else {
$this->reset();
}
}
示例8: __construct
/**
* Class constructor.
*
* @param string The error message
* @param int The error code
*/
public function __construct($message = null, $code = 0)
{
$this->setName('sfStopException');
// disable xdebug to avoid backtrace in error log
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
parent::__construct($message, $code);
}
示例9: disableXDebug
private function disableXDebug()
{
if (!extension_loaded('xdebug')) {
return;
}
ini_set('xdebug.scream', 0);
ini_set('xdebug.max_nesting_level', 8192);
ini_set('xdebug.show_exception_trace', 0);
xdebug_disable();
}
示例10: debug
public static function debug($flag)
{
error_reporting(E_ALL);
ini_set('html_errors', $flag);
ini_set('display_errors', $flag);
ini_set('display_startup_errors', $flag);
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
}
示例11: _getSOAP
private function _getSOAP()
{
ini_set("soap.wsdl_cache_enabled", "0");
$url_webservices = "https://webservice.elastix.org/modules/installations/webservice/registerWSDL.wsdl";
/* La presencia de xdebug activo interfiere con las excepciones de
* SOAP arrojadas por SoapClient, convirtiéndolas en errores
* fatales. Por lo tanto se desactiva la extensión. */
if (function_exists("xdebug_disable")) {
xdebug_disable();
}
return @new SoapClient($url_webservices);
}
示例12: execute
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('');
if (extension_loaded('xdebug')) {
/**
* This will disable only showing stack traces on error conditions.
*/
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
$output->writeln('<error>It is highly recommended to disable the XDebug extension before invoking this command.</error>');
}
$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7, new \PhpParser\Lexer\Emulative(['usedAttributes' => ['comments', 'startLine', 'endLine', 'startTokenPos', 'endTokenPos']]));
/** @var Application $application */
$application = $this->getApplication();
$application->compiler = new Compiler();
$em = EventManager::getInstance();
$context = new Context($output, $application, $em);
$fileParser = new FileParser($parser, $this->getCompiler());
$path = $input->getArgument('path');
if (is_dir($path)) {
$directoryIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS));
$output->writeln('Scanning directory <info>' . $path . '</info>');
$count = 0;
/** @var SplFileInfo $file */
foreach ($directoryIterator as $file) {
if ($file->getExtension() !== 'php') {
continue;
}
$context->debug($file->getPathname());
$count++;
}
$output->writeln("Found <info>{$count} files</info>");
if ($count > 100) {
$output->writeln('<comment>Caution: You are trying to scan a lot of files; this might be slow. For bigger libraries, consider setting up a dedicated platform or using ci.lowl.io.</comment>');
}
$output->writeln('');
/** @var SplFileInfo $file */
foreach ($directoryIterator as $file) {
if ($file->getExtension() !== 'php') {
continue;
}
$fileParser->parserFile($file->getPathname(), $context);
}
} elseif (is_file($path)) {
$fileParser->parserFile($path, $context);
}
/**
* Step 2 Recursive check ...
*/
$application->compiler->compile($context);
}
示例13: 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();
}
}
示例14: getSoapClient
public function getSoapClient()
{
if (empty($this->__soapClient)) {
if (function_exists('xdebug_disable')) {
@xdebug_disable();
}
try {
$this->__soapClient = @new SoapClient($this->owner->wsdl, $this->owner->config);
} catch (SoapFault $e) {
Yii::log(__METHOD__ . ' No connection to SoapService: ' . $e->getMessage() . "\n\n" . CVarDumper::dumpAsString($this->owner), 'warning', 'soap.behavior');
}
}
return $this->__soapClient;
}
示例15: getService
/**
*
* @return \ws\komerci\KomerciServiceFacade
*/
public function getService()
{
if ($this->service) {
return $this->service;
}
try {
xdebug_disable();
$this->service = new KomerciServiceFacade(self::SERVICES_URI);
$this->service->setLogger($this->logger);
return $this->service;
} catch (\Exception $e) {
throw new KomerciException($e);
}
}