当前位置: 首页>>代码示例>>PHP>>正文


PHP stream_wrapper_register函数代码示例

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


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


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