本文整理汇总了PHP中stream_wrapper_unregister函数的典型用法代码示例。如果您正苦于以下问题:PHP stream_wrapper_unregister函数的具体用法?PHP stream_wrapper_unregister怎么用?PHP stream_wrapper_unregister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stream_wrapper_unregister函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: 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
示例5: 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
示例6: intercept
/**
* Registers current class as the PHP file stream wrapper.
*
* @return void
*/
public function intercept()
{
if (!$this->isIntercepting) {
stream_wrapper_unregister(self::PROTOCOL);
$this->isIntercepting = stream_wrapper_register(self::PROTOCOL, __CLASS__);
}
}
开发者ID:php-vcr,项目名称:php-vcr,代码行数:12,代码来源:StreamProcessor.php
示例7: unregister
/**
* unregisters vfsStreamWrapper
*/
public static function unregister()
{
if (in_array(vfsStream::SCHEME, stream_get_wrappers()) === true) {
stream_wrapper_unregister(vfsStream::SCHEME);
}
self::$registered = false;
}
开发者ID:oalkhanishvili,项目名称:track2,代码行数:10,代码来源:vfsStreamWrapperAlreadyRegisteredTestCase.php
示例8: setUp
protected function setUp()
{
if (in_array('sfImageSource', stream_get_wrappers())) {
stream_wrapper_unregister('sfImageSource');
}
stream_wrapper_register('sfImageSource', 'sfImageSourceMock') or die('Failed to register protocol..');
}
开发者ID:robo47,项目名称:sfImageTransformExtraPlugin,代码行数:7,代码来源:sfImageSourceMockTest.php
示例9: activateHook
public static function activateHook()
{
foreach (static::$protocols as $protocol) {
stream_wrapper_unregister($protocol);
stream_wrapper_register($protocol, static::class);
}
}
开发者ID:goaop,项目名称:ast-manipulator,代码行数:7,代码来源:StreamWrapperHook.php
示例10: 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
示例11: setUp
public function setUp()
{
parent::setUp();
if (in_array($this->protocol, stream_get_wrappers())) {
stream_wrapper_unregister($this->protocol);
}
}
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:7,代码来源:SFTPStreamTest.php
示例12: testRegisterWithArgument
public function testRegisterWithArgument()
{
$protocol = 'sftptest';
$this->assertTrue(Stream::register($protocol));
$this->assertContains($protocol, stream_get_wrappers());
$this->assertTrue(stream_wrapper_unregister($protocol));
}
开发者ID:msulistijo,项目名称:PhpseclibBundle,代码行数:7,代码来源:SFTPStreamTest.php
示例13: unregisterWrapper
public static function unregisterWrapper()
{
$existed = in_array('stack', stream_get_wrappers());
if ($existed) {
stream_wrapper_unregister('stack');
}
}
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:7,代码来源:Stack.php
示例14: 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
示例15: registerStreamWrapper
/**
* Register a stream wrapper according to its scheme and class.
* Must called prior the opening of first stream under this scheme
*/
public static function registerStreamWrapper()
{
if (in_array(static::SCHEME, stream_get_wrappers())) {
stream_wrapper_unregister(static::SCHEME);
}
stream_register_wrapper(static::SCHEME, get_called_class());
}
开发者ID:mheydt,项目名称:scalr,代码行数:11,代码来源:StreamAdapter.php
示例16: 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
示例17: disable_wrappers
function disable_wrappers()
{
$wrappers = array("php", "http", "https", "ftp", "ftps", "compress.zlib", "compress.bzip2", "zip", "glob", "data");
foreach ($wrappers as $v) {
stream_wrapper_unregister($v);
}
}
开发者ID:fearg0t,项目名称:32c3_ITD,代码行数:7,代码来源:index.php
示例18: tear_down
/**
* Tear down the hooks, url filtering etc for S3 Uploads
*/
public function tear_down()
{
stream_wrapper_unregister('s3');
remove_filter('upload_dir', array($this, 'filter_upload_dir'));
remove_filter('wp_image_editors', array($this, 'filter_editors'), 9);
remove_filter('wp_handle_sideload_prefilter', array($this, 'filter_sideload_move_temp_file_to_s3'));
}
开发者ID:bdurette,项目名称:S3-Uploads,代码行数:10,代码来源:class-s3-uploads.php
示例19: enable
public static function enable()
{
if (!isset(self::$intercept) || !isset(self::$replacement)) {
throw new NoIncludeInterceptSetException('Set a file to intercept and its replacement before enabling wrapper');
}
stream_wrapper_unregister('file');
stream_wrapper_register('file', __CLASS__);
}
开发者ID:shadowhand,项目名称:humbug,代码行数:8,代码来源:IncludeInterceptor.php
示例20: wrapWithOptions
/**
* @param array $options the options for the context to wrap the stream with
* @param string $class
* @return resource
*/
protected static function wrapWithOptions($options, $class)
{
$context = stream_context_create($options);
stream_wrapper_register('dirwrapper', $class);
$wrapped = opendir('dirwrapper://', $context);
stream_wrapper_unregister('dirwrapper');
return $wrapped;
}
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:13,代码来源:DirectoryWrapper.php
注:本文中的stream_wrapper_unregister函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论