當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ErrorHandler::started方法代碼示例

本文整理匯總了PHP中Zend\Stdlib\ErrorHandler::started方法的典型用法代碼示例。如果您正苦於以下問題:PHP ErrorHandler::started方法的具體用法?PHP ErrorHandler::started怎麽用?PHP ErrorHandler::started使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Stdlib\ErrorHandler的用法示例。


在下文中一共展示了ErrorHandler::started方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 public function tearDown()
 {
     // be sure the error handler has been stopped
     if (ErrorHandler::started()) {
         ErrorHandler::stop();
         $this->fail('ErrorHandler not stopped');
     }
 }
開發者ID:ninahuanca,項目名稱:zf2,代碼行數:8,代碼來源:CommonAdapterTest.php

示例2: testStarted

 public function testStarted()
 {
     $this->assertFalse(ErrorHandler::started());
     ErrorHandler::start();
     $this->assertTrue(ErrorHandler::started());
     ErrorHandler::stop();
     $this->assertFalse(ErrorHandler::started());
 }
開發者ID:pnaq57,項目名稱:zf2demo,代碼行數:8,代碼來源:ErrorHandlerTest.php

示例3: fromString

 /**
  * Loads the SOAP message from a string.
  * 
  * @param string $soapData
  * @throws SoapException\LoadSoapDataException
  */
 public function fromString($soapData)
 {
     $dom = $this->getDom();
     try {
         ErrorHandler::start();
         $dom->loadXML($soapData);
         ErrorHandler::stop(true);
     } catch (\Exception $e) {
         if (ErrorHandler::started()) {
             ErrorHandler::stop();
         }
         throw new SoapException\LoadSoapDataException($e->getMessage());
     }
     $rootElement = $dom->documentElement;
     if ('envelope' != strtolower($rootElement->localName)) {
         throw new SoapException\LoadSoapDataException(sprintf("Invalid root element '%s'", $rootElement->localName));
     }
 }
開發者ID:ivan-novakov,項目名稱:php-saml-ecp-client,代碼行數:24,代碼來源:Message.php

示例4: isValid

 /**
  * {@inheritdoc}
  * @see \Saml\Ecp\Response\Validator\ValidatorInterface::isValid()
  */
 public function isValid(ResponseInterface $response)
 {
     $valid = false;
     $schemaFile = $this->getOption(self::OPT_SOAP_ENVELOPE_XSD);
     if (null === $schemaFile) {
         throw new GeneralException\MissingOptionException(self::OPT_SOAP_ENVELOPE_XSD);
     }
     if (!file_exists($schemaFile)) {
         throw new GeneralException\FileNotFoundException($schemaFile);
     }
     if (!is_file($schemaFile)) {
         throw new GeneralException\InvalidFileException(sprintf("Invalid file: '%s'", $schemaFile));
     }
     if (!is_readable($schemaFile)) {
         throw new GeneralException\InvalidFileException(sprintf("File not readable: '%s'", $schemaFile));
     }
     try {
         $soapMessage = $response->getSoapMessage();
     } catch (\Exception $e) {
         $this->addMessage(sprintf("Error loading SOAP message: [%s] %s", get_class($e), $e->getMessage()));
         return false;
     }
     $dom = $soapMessage->getDom();
     try {
         ErrorHandler::start();
         if ($dom->schemaValidate($schemaFile)) {
             $valid = true;
         }
         ErrorHandler::stop(true);
     } catch (\Exception $e) {
         $this->addMessage(sprintf("Failed schema validate (schema:%s): [%s] %s", $schemaFile, get_class($e), $e->getMessage()));
     }
     if (ErrorHandler::started()) {
         ErrorHandler::stop();
     }
     return $valid;
 }
開發者ID:ivan-novakov,項目名稱:php-saml-ecp-client,代碼行數:41,代碼來源:SoapEnvelope.php

示例5: write

 /**
  * Log a message to this writer.
  *
  * @param array $event log data event
  * @return void
  */
 public function write(array $event)
 {
     foreach ($this->filters as $filter) {
         if (!$filter->filter($event)) {
             return;
         }
     }
     $errorHandlerStarted = false;
     if ($this->convertWriteErrorsToExceptions && !ErrorHandler::started()) {
         ErrorHandler::start($this->errorsToExceptionsConversionLevel);
         $errorHandlerStarted = true;
     }
     try {
         $this->doWrite($event);
     } catch (\Exception $e) {
         if ($errorHandlerStarted) {
             ErrorHandler::stop();
             $errorHandlerStarted = false;
         }
         throw $e;
     }
     if ($errorHandlerStarted) {
         $error = ErrorHandler::stop();
         $errorHandlerStarted = false;
         if ($error) {
             throw new Exception\RuntimeException("Unable to write", 0, $error);
         }
     }
 }
開發者ID:eltondias,項目名稱:Relogio,代碼行數:35,代碼來源:AbstractWriter.php


注:本文中的Zend\Stdlib\ErrorHandler::started方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。