当前位置: 首页>>代码示例>>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;未经允许,请勿转载。