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


PHP stream_wrapper_restore函數代碼示例

本文整理匯總了PHP中stream_wrapper_restore函數的典型用法代碼示例。如果您正苦於以下問題:PHP stream_wrapper_restore函數的具體用法?PHP stream_wrapper_restore怎麽用?PHP stream_wrapper_restore使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: disable

 /**
  * @inheritDoc
  */
 public function disable()
 {
     self::$requestCallback = null;
     stream_wrapper_restore('http');
     stream_wrapper_restore('https');
     $this->status = self::DISABLED;
 }
開發者ID:alnutile,項目名稱:drunatra,代碼行數:10,代碼來源:StreamWrapperHook.php

示例2: endTestSuite

 /**
  * Restore PHP built-in HTTP stream wrapper and perform any other clean-up.
  *
  * @param \PHPUnit_Framework_TestSuite $suite
  * @return bool
  */
 public function endTestSuite(\PHPUnit_Framework_TestSuite $suite)
 {
     foreach ($this->wrappers as $wrapper) {
         \stream_wrapper_restore($wrapper);
     }
     return TRUE;
 }
開發者ID:QuickenLoans,項目名稱:interception,代碼行數:13,代碼來源:InterceptionListener.php

示例3: restoreDefault

 public static function restoreDefault()
 {
     // Reset static values
     self::$_returnValues = array();
     self::$_arguments = array();
     // Restore original stream wrapper
     stream_wrapper_restore('php');
 }
開發者ID:razvansividra,項目名稱:pnlzf2-1,代碼行數:8,代碼來源:PHPInput.php

示例4: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     // Restore the built-in HTTP wrapper for other unit tests.
     \stream_wrapper_restore('http');
     // Clean up all ignore files.
     $removeFiles = \glob(FIXTURES_PATH . DIRECTORY_SEPARATOR . 'ignore*');
     \array_map('unlink', $removeFiles);
 }
開發者ID:QuickenLoans,項目名稱:interception,代碼行數:8,代碼來源:HttpClientTest.php

示例5: testCanGetRawPostDataFromInputStream

 public function testCanGetRawPostDataFromInputStream()
 {
     stream_wrapper_unregister("php");
     stream_wrapper_register("php", PhpStreamMock::class);
     file_put_contents('php://input', 'Unit-Test');
     $postRequest = new PostRequest(RequestInfo::fromEnv(), [], []);
     $this->assertEquals('Unit-Test', $postRequest->getRawData());
     stream_wrapper_restore("php");
 }
開發者ID:fortuneglobe,項目名稱:icehawk,代碼行數:9,代碼來源:PostRequestTest.php

示例6: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     \stream_wrapper_restore('http');
     \stream_wrapper_restore('https');
     // TODO: Move this where it will execute after the entire suite runs.
     // Clean up all ignore files.
     $removeFiles = \glob(FIXTURES_PATH . DIRECTORY_SEPARATOR . 'ignore*');
     \array_map('unlink', $removeFiles);
 }
開發者ID:QuickenLoans,項目名稱:interception,代碼行數:9,代碼來源:HttpTest.php

示例7: testCanCreateFromRawPost

 public function testCanCreateFromRawPost()
 {
     // Prep php://input with mocked data
     MockPhpStream::setStartingData(json_encode($this->messageData));
     stream_wrapper_unregister('php');
     stream_wrapper_register('php', __NAMESPACE__ . '\\MockPhpStream');
     $message = Message::fromRawPostData();
     $this->assertInstanceOf('Aws\\Sns\\MessageValidator\\Message', $message);
     stream_wrapper_restore("php");
 }
開發者ID:njbhatt18,項目名稱:Amazon_API,代碼行數:10,代碼來源:MessageTest.php

示例8: testCanAccessRawDataFromRequest

 public function testCanAccessRawDataFromRequest()
 {
     stream_wrapper_unregister("php");
     stream_wrapper_register("php", PhpStreamMock::class);
     file_put_contents('php://input', 'Unit-Test');
     $postRequest = new PostRequest(RequestInfo::fromEnv(), [], []);
     $command = new TestDomainCommand($postRequest);
     $this->assertEquals('Unit-Test', $command->getBody());
     stream_wrapper_restore("php");
 }
開發者ID:fortuneglobe,項目名稱:icehawk,代碼行數:10,代碼來源:DomainCommandTest.php

示例9: reset

 public static function reset()
 {
     foreach (self::$existingWrappers as $wrapper) {
         stream_wrapper_unregister($wrapper);
         if (in_array($wrapper, self::$originalWrappers)) {
             stream_wrapper_restore($wrapper);
         }
     }
     self::$originalWrappers = array();
     self::$existingWrappers = array();
 }
開發者ID:jimbojsb,項目名稱:spray,代碼行數:11,代碼來源:Spray.php

示例10: capture

 /**
  * Capture output
  *
  * @param   lang.Runnable r
  * @param   array<string, string> initial
  * @return  array<string, string>
  */
 public static function capture(Runnable $r, $initial = [])
 {
     self::$streams = $initial;
     stream_wrapper_unregister('php');
     stream_wrapper_register('php', __CLASS__);
     try {
         $r->run();
     } finally {
         stream_wrapper_restore('php');
     }
     return self::$streams;
 }
開發者ID:johannes85,項目名稱:core,代碼行數:19,代碼來源:ChannelWrapper.class.php

示例11: testCanCreateFromRawPost

 public function testCanCreateFromRawPost()
 {
     $_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] = 'Notification';
     // Prep php://input with mocked data
     MockPhpStream::setStartingData(json_encode($this->messageData));
     stream_wrapper_unregister('php');
     stream_wrapper_register('php', __NAMESPACE__ . '\\MockPhpStream');
     $message = Message::fromRawPostData();
     $this->assertInstanceOf('Aws\\Sns\\Message', $message);
     stream_wrapper_restore("php");
     unset($_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE']);
 }
開發者ID:adityapooniya,項目名稱:aws-php-sns-message-validator,代碼行數:12,代碼來源:MessageTest.php

示例12: locateClassByName

 /**
  * Attempt to locate a class by name.
  *
  * If class already exists, simply use internal reflection API to get the
  * filename and store it.
  *
  * If class does not exist, we make an assumption that whatever autoloaders
  * that are registered will be loading a file. We then override the file://
  * protocol stream wrapper to "capture" the filename we expect the class to
  * be in, and then restore it. Note that class_exists will cause an error
  * that it cannot find the file, so we squelch the errors by overriding the
  * error handler temporarily.
  *
  * @param string $className
  * @return string
  */
 private function locateClassByName($className)
 {
     if (class_exists($className, false) || interface_exists($className, false) || trait_exists($className, false)) {
         return (new \ReflectionClass($className))->getFileName();
     }
     self::$autoloadLocatedFile = null;
     $previousErrorHandler = set_error_handler(function () {
     });
     stream_wrapper_unregister('file');
     stream_wrapper_register('file', self::class);
     class_exists($className);
     stream_wrapper_restore('file');
     set_error_handler($previousErrorHandler);
     return self::$autoloadLocatedFile;
 }
開發者ID:stof,項目名稱:BetterReflection,代碼行數:31,代碼來源:AutoloadSourceLocator.php

示例13: SoapClientAuth

 /**
  * 
  * @param string $wsdl
  * @param array $options 
  */
 function SoapClientAuth($wsdl, $options = NULL)
 {
     stream_wrapper_unregister('https');
     stream_wrapper_unregister('http');
     stream_wrapper_register('https', 'streamWrapperHttpAuth');
     stream_wrapper_register('http', 'streamWrapperHttpAuth');
     if ($options) {
         $this->Username = $options['login'];
         streamWrapperHttpAuth::$Username = $this->Username;
         $this->Password = $options['password'];
         streamWrapperHttpAuth::$Password = $this->Password;
     }
     parent::SoapClient($wsdl, $options ? $options : array());
     stream_wrapper_restore('https');
     stream_wrapper_restore('http');
 }
開發者ID:RooseveltJavier,項目名稱:Proyecto,代碼行數:21,代碼來源:soapclientauth.php

示例14: capture

 /**
  * Capture output
  *
  * @param   lang.Runnable r
  * @param   array<string, string> initial
  * @return  array<string, string>
  */
 public static function capture(Runnable $r, $initial = array())
 {
     self::$streams = $initial;
     stream_wrapper_unregister('php');
     stream_wrapper_register('php', __CLASS__);
     try {
         $r->run();
     } catch (Exception $e) {
     }
     ensure($e);
     stream_wrapper_restore('php');
     if ($e) {
         throw $e;
     }
     return self::$streams;
 }
開發者ID:Gamepay,項目名稱:xp-framework,代碼行數:23,代碼來源:ChannelWrapper.class.php

示例15: testCanGetBodyDataFromInputStream

 /**
  * @runInSeparateProcess
  */
 public function testCanGetBodyDataFromInputStream()
 {
     stream_wrapper_unregister("php");
     stream_wrapper_register("php", PhpStreamMock::class);
     file_put_contents('php://input', 'body data');
     $requestInfo = new RequestInfo(['REQUEST_METHOD' => 'POST', 'REQUEST_URI' => '/domain/test_body_data']);
     $expectedWriteRequest = new WriteRequest($requestInfo, new WriteRequestInput('body data', []));
     $requestHandler = $this->getMockBuilder(HandlesPostRequest::class)->getMockForAbstractClass();
     $requestHandler->expects($this->once())->method('handle')->with($this->equalTo($expectedWriteRequest));
     $writeRoute = new WriteRoute(new Literal('/domain/test_body_data'), $requestHandler);
     $config = $this->getMockBuilder(ConfiguresIceHawk::class)->getMockForAbstractClass();
     $config->method('getRequestInfo')->willReturn($requestInfo);
     $config->expects($this->once())->method('getWriteRoutes')->willReturn([$writeRoute]);
     $writeRequestHandler = new WriteRequestHandler($config, new EventPublisher());
     $writeRequestHandler->handleRequest();
     stream_wrapper_restore("php");
 }
開發者ID:icehawk,項目名稱:icehawk,代碼行數:20,代碼來源:WriteRequestHandlerTest.php


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