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

PHP stream_wrapper_restore函数代码示例

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

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



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


示例16: url_stat

 public function url_stat($path, $flags)
 {
     restore_error_handler();
     //запрос stat проводим к реальной файловой системе
     stream_wrapper_restore("file") or die(__FILE__ . __LINE__);
     //$filename = self::parse_path(parse_url($path,PHP_URL_PATH));
     // если адрес выполняемого скрипта фейковый, то просто подставляем исполняемый файл
     //if(file_exists($filename)) {
     //    $stat=stat($filename);
     //} else {
     $stat = stat(__FILE__);
     //}
     stream_wrapper_unregister("file") or die(__FILE__ . __LINE__);
     stream_wrapper_register("file", get_class($this)) or die(__FILE__ . __LINE__);
     //set_error_handler(array(static::CLASSNAME,"xsltErrorHandler"));
     return $stat;
 }
开发者ID:servandserv,项目名称:happymeal,代码行数:17,代码来源:StreamWrapper.php


示例17: callWsMethod

 function callWsMethod($methodName, $paramArray)
 {
     try {
         if ($methodName == 'DeleteDws' || $methodName == 'GetListCollection') {
             $strResult = "";
             $strResult = $this->client->{$methodName}($paramArray = "");
             return $strResult;
         } else {
             $strResult = "";
             $strResult = $this->client->{$methodName}($paramArray);
             return $strResult;
         }
     } catch (SoapFault $fault) {
         echo 'Fault code: ' . $fault->faultcode;
         echo 'Fault string: ' . $fault->faultstring;
     }
     stream_wrapper_restore('http');
 }
开发者ID:nshong,项目名称:processmaker,代码行数:18,代码来源:class.pmTrSharepoint.php


示例18: __construct

 /**
  *
  * @param string $wsdl
  * @param array $options
  */
 public function __construct($wsdl, $options = NULL)
 {
     $wrappers = stream_get_wrappers();
     stream_wrapper_unregister('http');
     stream_wrapper_register('http', '\\Thybag\\Auth\\StreamWrapperHttpAuth');
     if (in_array("https", $wrappers)) {
         stream_wrapper_unregister('https');
         stream_wrapper_register('https', '\\Thybag\\Auth\\StreamWrapperHttpAuth');
     }
     if ($options) {
         $this->Username = $options['login'];
         \Thybag\Auth\StreamWrapperHttpAuth::$Username = $this->Username;
         $this->Password = $options['password'];
         \Thybag\Auth\StreamWrapperHttpAuth::$Password = $this->Password;
     }
     parent::SoapClient($wsdl, $options ? $options : array());
     stream_wrapper_restore('http');
     if (in_array("https", $wrappers)) {
         stream_wrapper_restore('https');
     }
 }
开发者ID:Devlopers-Studio,项目名称:PHP-SharePoint-Lists-API,代码行数:26,代码来源:SoapClientAuth.php


示例19: __construct

 /**
  *
  * @param String $url The WSDL url
  * @param Array $data Soap options, it should contain ntlm_username and ntlm_password fields
  * @param LoggerAwareInterface|LoggerInterface $logger
  * @throws Exception
  * @see \SoapClient::__construct()
  */
 public function __construct($url, $data, LoggerInterface $logger = null)
 {
     if ($logger) {
         $this->setLogger($logger);
     }
     $this->options = $data;
     if (empty($data['ntlm_username']) && empty($data['ntlm_password'])) {
         parent::__construct($url, $data);
     } else {
         $this->use_ntlm = true;
         HttpStream\NTLMStream::$user = $data['ntlm_username'];
         HttpStream\NTLMStream::$password = $data['ntlm_password'];
         stream_wrapper_unregister('http');
         if (!stream_wrapper_register('http', '\\NTLMSoap\\HttpStream\\NTLMStream')) {
             throw new Exception("Unable to register HTTP Handler");
         }
         $time_start = microtime(true);
         parent::__construct($url, $data);
         if (!empty($this->logger) && ($end_time = microtime(true) - $time_start) > 0.1) {
             $this->logger->debug("WSDL Timer", array("time" => $end_time, "url" => $url));
         }
         stream_wrapper_restore('http');
     }
 }
开发者ID:rifayman,项目名称:NTLMSoap,代码行数:32,代码来源:Client.php


示例20: restore

 /**
  * Restores the original file stream wrapper status.
  *
  * @return void
  */
 public function restore()
 {
     stream_wrapper_restore(self::PROTOCOL);
 }
开发者ID:php-vcr,项目名称:php-vcr,代码行数:9,代码来源:StreamProcessor.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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