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

PHP stream_wrapper_register函数代码示例

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

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



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

示例1: setUp

 public function setUp()
 {
     $this->checkSkipTest();
     $this->bundle = new Bundle\RackspaceCloudfiles();
     $this->bundle->setDocRoot(__DIR__ . '/_files');
     stream_wrapper_register('rscf', 'RackspaceCloudFilesStreamWrapper') or die("Failed to register rscf:// protocol");
 }
开发者ID:omissis,项目名称:bundlefu,代码行数:7,代码来源:RackspaceCloudfilesTest.php


示例2: __construct

 /**
  *
  * Constructor for HiEngine
  *
  * Sets up the stream protocol handler
  */
 public function __construct()
 {
     $streams = stream_get_wrappers();
     if (!in_array('hi', $streams)) {
         stream_wrapper_register("hi", "HiEngineParser") or die(_t("Failed to register HiEngine stream protocol"));
     }
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:13,代码来源:hiengine.php


示例3: setUpFS

 function setUpFS()
 {
     ArrayFileStream::set_filesystem(array('dynamic' => array('course' => array($this->avatar_id . '_normal.png' => '', $this->avatar_id . '_medium.png' => '', $this->avatar_id . '_small.png' => ''))));
     if (!stream_wrapper_register("var", "ArrayFileStream")) {
         new Exception("Failed to register protocol");
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:AvatarClassTest.php


示例4: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // Set up an intercepting proxy for getimagesize() calls
     stream_wrapper_unregister('http');
     stream_wrapper_register('http', __CLASS__ . '_proxy');
 }
开发者ID:phpbb,项目名称:phpbb,代码行数:7,代码来源:message_parser_test.php


示例5: wrap

 public static function wrap()
 {
     foreach (static::$protocols as $protocol) {
         stream_wrapper_unregister($protocol);
         stream_wrapper_register($protocol, get_called_class());
     }
 }
开发者ID:antecedent,项目名称:patchwork,代码行数:7,代码来源:Stream.php


示例6: __construct

 function __construct($orientation = 'P', $unit = 'mm', $size = 'A4')
 {
     parent::__construct($orientation, $unit, $size);
     $this->lineHeightPadding = 30 / $this->k;
     $this->SetAutoPageBreak(false);
     stream_wrapper_register("var", 'PhpSigep\\Pdf\\VariableStream') or die("Failed to register protocol");
 }
开发者ID:alemonteiro,项目名称:php-sigep,代码行数:7,代码来源:ImprovedFPDF.php


示例7: testRegisterAnAlreadyRegisteredSchemeThrowsException

 /**
  * @expectedException \MockFs\Exception\StreamException
  */
 public function testRegisterAnAlreadyRegisteredSchemeThrowsException()
 {
     $protocol = 'mock';
     stream_wrapper_register($protocol, __CLASS__);
     $stream = Stream::getInstance();
     $stream->register($protocol);
 }
开发者ID:dantudor,项目名称:mockfs,代码行数:10,代码来源:StreamTest.php


示例8: set_up

 public function set_up()
 {
     stream_wrapper_unregister('https');
     stream_wrapper_register('https', 'MockHttpStreamWrapper', STREAM_IS_URL);
     MockHttpStreamWrapper::clear();
     parent::set_up();
 }
开发者ID:mattywebb,项目名称:cyclery-northside,代码行数:7,代码来源:TinyCompressFopenTest.php


示例9: testEvent

 public function testEvent()
 {
     $provider = $this->getProvider();
     $provider->addFormat('big', array('width' => 200, 'height' => null, 'constraint' => true));
     $media = new Media();
     $media->setBinaryContent('x9wjql');
     $media->setId(1023456);
     stream_wrapper_unregister('http');
     stream_wrapper_register('http', 'Sonata\\MediaBundle\\Tests\\Provider\\FakeHttpWrapper');
     // pre persist the media
     $provider->prePersist($media);
     $this->assertEquals('Thomas Rabaix - les tests fonctionnels - Symfony Live 2009', $media->getName(), '::getName() return the file name');
     $this->assertEquals('x9wjql', $media->getProviderReference(), '::getProviderReference() is set');
     // post persit the media
     $provider->postPersist($media);
     $provider->postRemove($media);
     $media->setProviderStatus('fake');
     $provider->preUpdate($media);
     $this->assertEquals(MediaInterface::STATUS_OK, $media->getProviderStatus());
     $provider->postUpdate($media);
     $media->setProviderStatus('fake');
     $media->setBinaryContent(null);
     $provider->prePersist($media);
     $this->assertEquals('fake', $media->getProviderStatus());
     $provider->preUpdate($media);
     $this->assertEquals('fake', $media->getProviderStatus());
     $provider->postPersist($media);
     $this->assertEquals('fake', $media->getProviderStatus());
     $provider->preRemove($media);
     stream_wrapper_restore('http');
 }
开发者ID:helmer,项目名称:SonataMediaBundle,代码行数:31,代码来源:DailyMotionProviderTest.php


示例10: __construct

 /**
  * TODO don't hardcode pool, use params
  * TODO check rados extensions are available
  * @param $params
  */
 public function __construct($params)
 {
     $this->pool = 'owncloud';
     if (!in_array("rados", stream_get_wrappers())) {
         stream_wrapper_register("rados", '\\OCA\\Rados\\RadosStream');
     }
 }
开发者ID:MrRagga-,项目名称:rados,代码行数:12,代码来源:radosstore.php


示例11: MEM_IMAGE

	function MEM_IMAGE($orientation='P',$unit='mm',$format='A4')
	{
		$this->FPDF($orientation, $unit, $format);
		//Register var stream protocol (requires PHP>=4.3.2)
		if(function_exists('stream_wrapper_register'))
			stream_wrapper_register('var','VariableStream');
	}
开发者ID:rusli-nasir,项目名称:hospitalPhp,代码行数:7,代码来源:mem_image.php


示例12: register

 public static function register($scheme, $container)
 {
     if (!stream_wrapper_register($scheme, static::class)) {
         throw new \RuntimeException('Cannot register stream wrapper');
     }
     self::$containers[$scheme] = $container;
 }
开发者ID:nullptr-cc,项目名称:yen2,代码行数:7,代码来源:MicroVFS.php


示例13: __construct

 /**
  * Constructs CustomURIResolver from scheme prefix string (e.g. "arg" or "http").
  * @param string $scheme Scheme prefix string
  */
 function __construct($scheme)
 {
     $this->scheme = $scheme;
     if (!in_array($scheme, stream_get_wrappers())) {
         stream_wrapper_register($scheme, "StringStream") or die("Failed to register '" . $scheme . "'");
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:11,代码来源:URIResolver.class.php


示例14: setUp

 /**
  * Sets up this test case
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Service_Amazon_S3::setKeys(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEYID'));
     if (!stream_wrapper_register('s3', 'Zend_Service_Amazon_S3')) {
         $this->fail('Unable to register s3:// streams wrapper');
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:12,代码来源:OnlineTest.php


示例15: create

 /**
  * @return string
  */
 protected function create()
 {
     $id = uniqid('stream');
     eval(sprintf('namespace %s { class %s extends \\%s {}; }', __NAMESPACE__, self::PROXY_CLASSNAME . '_' . $id, __NAMESPACE__ . '\\' . self::PROXY_CLASSNAME));
     stream_wrapper_register($id, $this->getProxyClassName($id));
     return $id;
 }
开发者ID:bcncommerce,项目名称:stream-wrapper,代码行数:10,代码来源:Factory.php


示例16: register

 /**
  * Register the GridFS stream wrapper.
  */
 public static function register()
 {
     if (in_array('gridfs', stream_get_wrappers())) {
         stream_wrapper_unregister('gridfs');
     }
     stream_wrapper_register('gridfs', get_called_class(), \STREAM_IS_URL);
 }
开发者ID:researchgate,项目名称:mongo-php-library,代码行数:10,代码来源:StreamWrapper.php


示例17: register

 /**
  * Registers the stream wrapper to handle the specified scheme
  *
  * @param  string $schema Default is gaufrette
  */
 public static function register($scheme = 'gaufrette')
 {
     @stream_wrapper_unregister($scheme);
     if (!stream_wrapper_register($scheme, __CLASS__)) {
         throw new \RuntimeException(sprintf('Could not register stream wrapper class %s for scheme %s.', __CLASS__, $scheme));
     }
 }
开发者ID:novatex,项目名称:Gaufrette,代码行数:12,代码来源:StreamWrapper.php


示例18: register

 public static function register()
 {
     if (in_array('phpspec', stream_get_wrappers())) {
         stream_wrapper_unregister('phpspec');
     }
     stream_wrapper_register('phpspec', 'PhpSpec\\Loader\\StreamWrapper');
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:7,代码来源:StreamWrapper.php


示例19: init

 protected function init(Container $container, ResourceLocator $locator)
 {
     $schemes = $container['config']->get('streams.schemes');
     if (!$schemes) {
         return;
     }
     // Set locator to both streams.
     Stream::setLocator($locator);
     ReadOnlyStream::setLocator($locator);
     $registered = stream_get_wrappers();
     foreach ($schemes as $scheme => $config) {
         if (isset($config['paths'])) {
             $locator->addPath($scheme, '', $config['paths']);
         }
         if (isset($config['prefixes'])) {
             foreach ($config['prefixes'] as $prefix => $paths) {
                 $locator->addPath($scheme, $prefix, $paths);
             }
         }
         if (in_array($scheme, $registered)) {
             stream_wrapper_unregister($scheme);
         }
         $type = !empty($config['type']) ? $config['type'] : 'ReadOnlyStream';
         if ($type[0] != '\\') {
             $type = '\\Grav\\Component\\Filesystem\\StreamWrapper\\' . $type;
         }
         if (!stream_wrapper_register($scheme, $type)) {
             throw new \InvalidArgumentException("Stream '{$type}' could not be initialized.");
         }
     }
 }
开发者ID:miguelramos,项目名称:grav,代码行数:31,代码来源:StreamsServiceProvider.php


示例20: install

 /**
  * Install this stream wrapper.
  */
 public static function install()
 {
     $wrappers = stream_get_wrappers();
     if (!in_array('madmodel', $wrappers)) {
         stream_wrapper_register('madmodel', 'Mad_Model_Stream');
     }
 }
开发者ID:robsymonds,项目名称:framework,代码行数:10,代码来源:Stream.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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