本文整理汇总了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");
}
示例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"));
}
}
示例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");
}
}
示例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');
}
示例5: wrap
public static function wrap()
{
foreach (static::$protocols as $protocol) {
stream_wrapper_unregister($protocol);
stream_wrapper_register($protocol, get_called_class());
}
}
示例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");
}
示例7: testRegisterAnAlreadyRegisteredSchemeThrowsException
/**
* @expectedException \MockFs\Exception\StreamException
*/
public function testRegisterAnAlreadyRegisteredSchemeThrowsException()
{
$protocol = 'mock';
stream_wrapper_register($protocol, __CLASS__);
$stream = Stream::getInstance();
$stream->register($protocol);
}
示例8: set_up
public function set_up()
{
stream_wrapper_unregister('https');
stream_wrapper_register('https', 'MockHttpStreamWrapper', STREAM_IS_URL);
MockHttpStreamWrapper::clear();
parent::set_up();
}
示例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');
}
示例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');
}
}
示例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');
}
示例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;
}
示例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 . "'");
}
}
示例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');
}
}
示例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;
}