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

PHP xdebug_enable函数代码示例

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

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



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

示例1: 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']);
 }
开发者ID:patrickpreuss,项目名称:Braintacle,代码行数:32,代码来源:MacAddressTest.php


示例2: 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


示例3: setEnabled

 /**
  * Enables or disables debugging.  This includes:
  *
  *  - Toggling xdebug
  *  - Toggling error display
  *
  * @param  boolean  $enabled  true to enable debugging, false to disable.
  */
 public static function setEnabled($enabled)
 {
     self::$enabled = (bool) $enabled;
     if ($enabled) {
         if (extension_loaded('xdebug')) {
             xdebug_enable();
         }
         ini_set('display_errors', 'on');
     } else {
         if (extension_loaded('xdebug')) {
             xdebug_disable();
         }
         ini_set('display_errors', 'off');
     }
 }
开发者ID:ngnpope,项目名称:jerity,代码行数:23,代码来源:Debug.php


示例4: __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


示例5: check

 /**
  * Perform the actual check and return a ResultInterface
  *
  * @return ResultInterface
  */
 public function check()
 {
     try {
         if (function_exists('xdebug_disable')) {
             xdebug_disable();
         }
         @new \SoapClient($this->wsdlUrl, array('cache_wsdl' => WSDL_CACHE_NONE, 'trace' => true, 'exceptions' => true, 'stream_context' => $this->context));
         if (function_exists('xdebug_enable')) {
             xdebug_enable();
         }
         return $this->success();
     } catch (\SoapFault $e) {
         $error = error_get_last();
         if ($error !== null && $error['message'] == $e->getMessage()) {
             // Overwrites E_ERROR with E_USER_NOTICE as seen in http://stackoverflow.com/a/36667322
             // Added @ to suppress the error
             @trigger_error($e->getMessage());
         }
         return $this->failure();
     } catch (\Exception $e) {
         return $this->failure();
     }
 }
开发者ID:procergs,项目名称:meurs-monitor-bundle,代码行数:28,代码来源:Wsdl.php


示例6: initializeClient

 /**
  * Initializes Soap Client with WSDL and an options array
  *
  * @throws CouldNotConnectException
  */
 protected function initializeClient()
 {
     // Store some specific soap-client related data locally
     // so it can be injected in the SoapClient and compared
     // for changes later
     $this->wsdl = $this->request->getLocation();
     $this->clientOptions = $this->request->getOptions();
     // store hash to make it possible to detect changes to the client
     $this->clientHash = $this->makeSoapClientHash();
     $xdebugEnabled = extension_loaded('xdebug') && xdebug_is_enabled();
     try {
         // temporarily disable xdebug to prevent PHP Fatal error
         // while constructing SoapClient
         if ($xdebugEnabled) {
             xdebug_disable();
         }
         $this->client = app($this->soapClientClass, [$this->wsdl, $this->clientOptions]);
         if ($xdebugEnabled) {
             xdebug_enable();
         }
     } catch (SoapFault $e) {
         throw new CouldNotConnectException($e->getMessage(), $e->getCode(), $e);
     } catch (Exception $e) {
         throw new CouldNotConnectException($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:czim,项目名称:laravel-service,代码行数:31,代码来源:SoapService.php


示例7: 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


示例8: XDebug

 public static function XDebug($enabled = true)
 {
     if (!function_exists('xdebug_enable')) {
         return false;
     }
     if ($enabled) {
         ini_set('xdebug.collect_vars', 'on');
         ini_set('xdebug.collect_params', '1');
         ini_set('xdebug.dump_globals', 'off');
         ini_set('xdebug.dump.SERVER', 'REQUEST_URI');
         ini_set('xdebug.show_local_vars', 'off');
         xdebug_enable();
     } else {
         if (function_exists('xdebug_disable')) {
             xdebug_disable();
         }
         ini_set('xdebug.collect_vars', 'off');
         ini_set('xdebug.collect_params', '0');
     }
     return true;
 }
开发者ID:Acidburn0zzz,项目名称:OEM,代码行数:21,代码来源:Framework.php


示例9: __call

 /**
  * là c'est pour pouvoir s'en servir comme soapclient, avec du $soap->methode($arg1, $arg2) de maniere 
  * transparente
  * on y fait des eventuels traitements => si on a killé entre temps, on reconstruit
  * => si on a du csv qui arrive, on convertit en array php
  * @param type $name
  * @param type $arguments
  * @return type 
  */
 public function __call($name, $arguments)
 {
     // On desactive xDebug car c'est lui qui bug comme expliqué dans ces threads:
     // http://stackoverflow.com/questions/1406632/checking-a-url-is-valid-from-php-soap-client
     // http://bugs.xdebug.org/view.php?id=249
     xdebug_disable();
     try {
         // si killé entre temps ou jamais initialisé, on recrée
         if (!isset($this->client) && isset($this->wsdl)) {
             $this->initialize();
         }
     } catch (SoapFault $e) {
         throw new OrchestraException('Impossible de joindre le serveur centrale.', $e);
     }
     try {
         // on applique sur notre soap client
         $rtn = call_user_func_array(array($this->client, $name), $arguments);
     } catch (SoapFault $e) {
         throw new OrchestraException('Erreur d\'exécution sur la fonction ' . $name . ' au niveau du serveur centrale.', $e);
     }
     xdebug_enable();
     // on est obligé de faire une requete pour chopper un cookie, donc on attends la premiere
     if ($this->firstUse) {
         // le "PHPSESSID" c'est pas generique, vaudrait mieux chopper tout les cookies
         $this->cookie = $this->client->_cookies["PHPSESSID"][0];
         $_SESSION['SOAP'][$this->wsdl] = $this->cookie;
         $this->firstUse = false;
     }
     // si on detecte du csv (check si ","), on decode
     if (strpos($rtn, '","') != false) {
         $rtn = $this->str_getcsv_lines($rtn);
         if (count($rtn) == 1) {
             $rtn = array_pop($rtn);
         }
     }
     return $rtn;
 }
开发者ID:buckutt,项目名称:Archives,代码行数:46,代码来源:Soap.class.php


示例10: 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


示例11: define

 * Test environment constants
 */
define('PHPILLOW_TEST_ENV_SET_UP', true);
/**
 * Set timezone to get clearly defined dates
 */
date_default_timezone_set('UTC');
require __DIR__ . '/../vendor/autoload.php';
require dirname(__FILE__) . '/helper/general.php';
/**
 * Fix error reporting settings for test runs
 */
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', true);
if (function_exists('xdebug_enable')) {
    xdebug_enable(true);
}
/**
 * Set up mocks and fakes for the current test environment
 *
 * @package Tests
 * @version $Revision$
 * @license http://www.gnu.org/licenses/gpl-3.0.txt GPL
 */
class phpillowTestEnvironmentSetup
{
    /**
     * Reset database depending on provided options
     *
     * @param array $options
     * @return void
开发者ID:paulocarvalhodesign,项目名称:PHPillow,代码行数:31,代码来源:test_environment.php


示例12: enable

 /**
  * Enable showing stack traces on error conditions.
  * @return void
  */
 public function enable()
 {
     xdebug_enable();
 }
开发者ID:Keegomyneego,项目名称:cockamamei,代码行数:8,代码来源:Xdebug.php


示例13: xdebug_enable

require_once 'GLA_PostFinalize.cc.php';
require_once 'GLA.cc.php';
require_once 'GT.cc.php';
require_once 'GIST.cc.php';
require_once 'JoinLHS.cc.php';
require_once 'JoinLHSHash.cc.php';
require_once 'JoinRHS.cc.php';
require_once 'JoinMergeWorkFuncs.cc.php';
require_once 'Cleaner.cc.php';
require_once 'Cache.cc.php';
require_once 'Cluster.cc.php';
require_once 'grokit_codegen.php';
require_once 'codegen_helpers.php';
require_once 'Make.php';
/*************** HELPER FUNCTIONS ************************/
xdebug_enable();
/*************** COMMAND LINE PARSING *********************/
if ($argc < 2) {
    echo "Usage: php Process.php query.json";
    exit(1);
}
if (!file_exists($argv[1])) {
    echo "File " . $argv[1] . " cannot be read";
    exit(1);
}
$configFile = './config/default.json';
if ($argc >= 3) {
    $configFile = $argv[2];
}
if (!file_exists($configFile)) {
    echo "Configuration file " . $configFile . " does not exist" . PHP_EOL;
开发者ID:gokulp,项目名称:grokit,代码行数:31,代码来源:Process.php


示例14: testRegister

    function testRegister()
    {
        $f = tempnam('/', 'test');
        $this->assertTrue(false !== $f);
        error_reporting(-1);
        $h = new InDepthErrorHandler(null, array('scream' => E_PARSE, 'trace' => 0));
        InDepthErrorHandler::register($h, $f);
        $h = InDepthErrorHandler::getHandler();
        $h->getLogger()->loggedGlobals = array();
        try {
            user_error('fake user error', E_USER_ERROR);
            $this->assertFalse(true);
        } catch (\Patchwork\PHP\InDepthRecoverableErrorException $e) {
            $h->handleUncaughtException($e);
        }
        if (function_exists('xdebug_disable')) {
            xdebug_disable();
        }
        eval("");
        // Uncatchable E_COMPILE_WARNING
        if (function_exists('xdebug_disable')) {
            xdebug_enable();
        }
        error_reporting(0);
        @eval('abc');
        // Parse error to populate error_get_last()
        InDepthErrorHandler::shutdown();
        error_reporting(-1);
        $e = file_get_contents($f);
        unlink($f);
        $this->assertStringMatchesFormat('*** php-error ***
{"_":"1:array:3",
  "time": "%s %dus - %fms - %fms",
  "mem": "%d - %d",
  "data": {"_":"4:array:4",
    "mesg": "Uncaught \\\\Patchwork\\\\PHP\\\\InDepthRecoverableErrorException: fake user error",
    "type": "E_ERROR ' . __FILE__ . ':43",
    "level": "1/-1",
    "exception": {"_":"8:Patchwork\\\\PHP\\\\InDepthRecoverableErrorException",
      "context": {"_":"9:array:2",
        "f": "' . $f . '",
        "h": {"_":"11:Patchwork\\\\PHP\\\\InDepthErrorHandler",
          "*:loggedErrors": -1,
          "*:screamErrors": 4,
          "*:thrownErrors": 4437,
          "*:scopedErrors": 0,
          "*:tracedErrors": 0,
          "*:logger": {"_":"17:Patchwork\\\\PHP\\\\Logger",
            "lineFormat": "%s",
            "loggedGlobals": [],
            "*:uniqId": %d,
            "*:logStream": {"_":"21:resource:stream",
              "~:wrapper_type": "plainfile",
              "~:stream_type": "STDIO",
              "~:mode": "ab",
              "~:unread_bytes": 0,
              "~:seekable": true,
              "~:uri": "/tmp/test%s",
              "~:timed_out": false,
              "~:blocked": true,
              "~:eof": false
            },
            "*:prevTime": %f,
            "*:startTime": %f,
            "*:isFirstEvent": true
          },
          "*:loggedTraces": []
        }
      },
      "*:message": "fake user error",
      "*:code": 0,
      "*:file": "' . __FILE__ . '",
      "*:line": 43,
      "*:severity": "E_USER_ERROR",
      "~:hash": "%x"
    }
  }
}
***
[%s] PHP Warning:  Unexpected character in input:  ' . "''" . ' (ASCII=1) state=0 in ' . __FILE__ . '(52) : eval()\'d code on line 1
*** php-error ***
{"_":"1:array:3",
  "time": "%s %dus - %fms - %fms",
  "mem": "%d - %d",
  "data": {"_":"4:array:3",
    "mesg": "syntax error, unexpected ' . (PHP_VERSION_ID >= 50400 ? 'end of file' : '$end') . '",
    "type": "E_PARSE ' . __FILE__ . '(56) : eval()\'d code:1",
    "level": "4/0"
  }
}
***
', $e);
    }
开发者ID:nicolas-grekas,项目名称:Patchwork,代码行数:93,代码来源:InDepthErrorHandlerTest.php


示例15: testMaximumNesting

 public function testMaximumNesting()
 {
     if (!function_exists('xdebug_is_enabled')) {
         $this->markTestSkipped('xDebug is not installed');
     }
     $xdebug_start = !xdebug_is_enabled();
     if ($xdebug_start) {
         xdebug_enable();
     }
     ini_set('xdebug.max_nesting_level', 200);
     $file = new \SplTempFileObject();
     for ($i = 0; $i < 500; $i++) {
         $file->fwrite("1,2,3\n");
     }
     $reader = new CsvReader($file);
     $reader->rewind();
     $reader->setStrict(true);
     $reader->setColumnHeaders(array('one', 'two'));
     $current = $reader->current();
     $this->assertEquals(null, $current);
     if ($xdebug_start) {
         xdebug_disable();
     }
 }
开发者ID:megamanhxh,项目名称:data-import,代码行数:24,代码来源:CsvReaderTest.php


示例16: checkFileExist

 public function checkFileExist($args)
 {
     $fileID = $args[0];
     if (strlen($fileID) > 0) {
         if (function_exists('xdebug_disable')) {
             xdebug_disable();
         }
         try {
             return true;
         } catch (Google_ServiceException $e) {
             if ($e->getCode() == 404) {
             }
             return false;
         } catch (Exception $e) {
             if ($e->getCode() == 404) {
                 //print "The event doesn't exist";
             }
             return false;
         }
         if (function_exists('xdebug_enable')) {
             xdebug_enable();
         }
     } else {
         return false;
     }
 }
开发者ID:olif-fm,项目名称:olif,代码行数:26,代码来源:ControllerOAuth.php


示例17: testStart

    function testStart()
    {
        $f = tempnam('/', 'test');
        $this->assertTrue(false !== $f);
        error_reporting(E_ALL | E_STRICT);
        ErrorHandler::start($f);
        $h = ErrorHandler::getHandler();
        $h->tracedErrors = 0;
        $h->getLogger()->loggedGlobals = array();
        try {
            user_error('fake user error', E_USER_ERROR);
            $this->assertFalse(true);
        } catch (\Patchwork\PHP\RecoverableErrorException $e) {
            $h->handleException($e);
        }
        if (function_exists('xdebug_disable')) {
            xdebug_disable();
        }
        eval("");
        // Uncatchable E_COMPILE_WARNING
        if (function_exists('xdebug_disable')) {
            xdebug_enable();
        }
        error_reporting(0);
        @eval('abc');
        // Parse error to populate error_get_last()
        $h->scream = E_PARSE;
        ErrorHandler::shutdown();
        error_reporting(E_ALL | E_STRICT);
        $h->unregister();
        $e = file_get_contents($f);
        unlink($f);
        $this->assertStringMatchesFormat('*** php-error ***
{"_":"1:array:3",
  "time": "%s %dus - %fms - %fms",
  "mem": "%d - %d",
  "data": {"_":"4:array:4",
    "mesg": "Uncaught exception: fake user error",
    "type": "E_USER_ERROR ' . __FILE__ . ':23",
    "level": "256/32767",
    "scope": {"_":"8:array:1",
      "0": {"_":"9:Patchwork\\\\PHP\\\\RecoverableErrorException",
        "scope": {"_":"10:array:2",
          "f": "' . $f . '",
          "h": {"_":"12:Patchwork\\\\PHP\\\\ErrorHandler",
            "scream": 4433,
            "thrownErrors": 0,
            "scopedErrors": 4867,
            "tracedErrors": 0,
            "*:logger": {"_":"17:Patchwork\\\\PHP\\\\Logger",
              "writeLock": true,
              "lineFormat": "%s",
              "loggedGlobals": [],
              "*:logStream": {"_":"21:resource:stream",
                "wrapper_type": "plainfile",
                "stream_type": "STDIO",
                "mode": "ab",
                "unread_bytes": 0,
                "seekable": true,
                "uri": "' . $f . '",
                "timed_out": false,
                "blocked": true,
                "eof": false
              },
              "*:prevTime": %f,
              "*:startTime": %f,
              "*:isFirstEvent": true
            },
            "*:loggedTraces": [],
            "*:registeredErrors": 32767
          }
        },
        "*:message": "fake user error",
        "*:code": 0,
        "*:file": "' . __FILE__ . '",
        "*:line": 23,
        "*:severity": "E_USER_ERROR"
      }
    }
  }
}
***
[%s] PHP Warning:  Unexpected character in input:  ' . "''" . ' (ASCII=1) state=0 in ' . __FILE__ . '(32) : eval()\'d code on line 1
*** php-error ***
{"_":"1:array:3",
  "time": "%s %dus - %fms - %fms",
  "mem": "%d - %d",
  "data": {"_":"4:array:3",
    "mesg": "syntax error, unexpected ' . (PHP_VERSION_ID >= 50400 ? 'end of file' : '$end') . '",
    "type": "E_PARSE ' . __FILE__ . '(36) : eval()\'d code:1",
    "level": "4/0"
  }
}
***
', $e);
    }
开发者ID:nicolas-grekas,项目名称:Patchwork-sandbox,代码行数:96,代码来源:ErrorHandlerTest.php


示例18: 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


示例19: _disableErrorReporting

 function _disableErrorReporting()
 {
     ini_set('track_errors', $this->_old_track_errors);
     if ($this->_xdebug_is_enabled) {
         xdebug_enable();
     }
 }
开发者ID:BackupTheBerlios,项目名称:phpbase-svn,代码行数:7,代码来源:simple_test.php


示例20: gjShowErrors

function gjShowErrors()
{
    //call this first after session start
    error_reporting(E_ALL);
    //for test if sessionstart put it after error_reporting
    ini_set('display_errors', 1);
    // 1 to display errors
    ini_set('log_errors', 1);
    global $gjDebug;
    global $gjLocal;
    //usually have to set this in php.ini
    //xdebug_disable();
    //xdebug.collect_assignments
    ini_set('xdebug.collect_includes', '1');
    ini_set('xdebug.collect_params', '1');
    //terse is 1
    ini_set('xdebug.collect_return', '1');
    ini_set('xdebug.collect_vars', '1');
    //for xdebug_get_declared_vars().
    //xdebug.coverage_enable
    ini_set('xdebug.default_enable', '1');
    ini_set('xdebug.dump.SERVER', 'REQUEST_URI,REQUEST_METHOD');
    ini_set('xdebug.dump.GET', '*');
    ini_set('xdebug.dump.SESSION', '*');
    ini_set('xdebug.dump.REQUEST', '*');
    ini_set('xdebug.dump.FILES', '*');
    ini_set('xdebug.dump.COOKIE', '*');
    ini_set('xdebug.dump_globals', '1');
    //xdebug.dump_undefined
    //xdebug.extended_info  only in php.ini
    //xdebug.file_link_format for IDE
    //xdebug.idekey
    //xdebug.manual_url ,link to php manual  defualt http://www.php.net
    ini_set('xdebug.max_nesting_level', '50');
    //xdebug.overload_var_dump
    //xdebug.profiler_append
    //xdebug.profiler_enable
    // ... more profiler options
    // ... more remote options
    ini_set('xdebug.scream', '1');
    // xdebug.show_exception_trace
    ini_set('xdebug.show_local_vars', '1');
    //xdebug.show_mem_delta
    //xdebug.trace_enable_trigger
    ini_set('xdebug.trace_format', '0');
    //0 is for the editor 1 is for IDEs 2 is html
    // xdebug.trace_options
    //xdebug.trace_output_dir  /tmp
    // bad  see php.ini ini_set('xdebug.trace_output_name', 'F:\tmp');
    ini_set('xdebug.var_display_max_children', '128');
    ini_set('xdebug.var_display_max_data', '-1');
    ini_set('xdebug.var_display_max_depth', '-1');
    //not set up on hosted accounts
    if ($gjLocal) {
        try {
            xdebug_enable();
            if (xdebug_is_enabled()) {
                echo 'stack traces are enabled - debugging<BR>';
                //xdebug_start_error_collection();
                echo 'xdebug_memory_usage() ' . number_format(xdebug_memory_usage()) . '<BR>';
                xdebug_start_trace();
            } else {
                echo 'not debugging<br>';
            }
        } catch (Exception $e) {
            echo 'Caught Exception -> message: ', $e->getMessage(), "\n";
            //   or if extended over ridden exception var_dump e->getMessage()
        }
    }
    /*
    xdebug_start_error_collection();
    Starts recording all notices, warnings and errors and prevents their display
    Xdebug will cause PHP not to display any notices, warnings or errors.
    Instead, they are formatted according to Xdebug's normal error formatting rules
    (ie, the error table with the red exclamation mark) and then stored in a buffer.
    This will continue until you call .
    xdebug_stop_error_collection();
    This buffer's contents can be retrieved by calling
    xdebug_get_collected_errors()
    */
    /*
    $bt = debug_backtrace();
    - Generates a user-level error/warning/notice message
    trigger_error("I want a backtrace", E_USER_ERROR);
    debug_print_backtrace() - Prints a backtrace
    */
}
开发者ID:gmgj,项目名称:gjsoap,代码行数:87,代码来源:gj_utility.inc.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP xdebug_get_code_coverage函数代码示例发布时间:2022-05-23
下一篇:
PHP xdebug_disable函数代码示例发布时间: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