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

PHP stream_register_wrapper函数代码示例

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

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



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

示例1: registerWrapper

 public static function registerWrapper()
 {
     if (!self::$registered) {
         stream_register_wrapper('compress.lzw', __CLASS__);
     }
     self::$registered = true;
 }
开发者ID:Epo123,项目名称:UnifiedArchive,代码行数:7,代码来源:LzwStreamWrapper.php


示例2: 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


示例3: setUp

 public function setUp()
 {
     $existed = in_array('imc', stream_get_wrappers());
     if (!$existed) {
         stream_register_wrapper('imc', 'ImcStream\\ImcStream');
     }
 }
开发者ID:coldume,项目名称:imc-stream,代码行数:7,代码来源:ImcStreamTest.php


示例4: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     \stream_wrapper_unregister('http');
     \stream_wrapper_unregister('https');
     // Register HTTP
     \stream_register_wrapper('http', '\\Kshabazz\\Interception\\StreamWrappers\\Http', \STREAM_IS_URL);
     // Register HTTPS
     \stream_register_wrapper('https', '\\Kshabazz\\Interception\\StreamWrappers\\Http', \STREAM_IS_URL);
     Http::setSaveDir(FIXTURES_PATH);
 }
开发者ID:QuickenLoans,项目名称:interception,代码行数:10,代码来源:HttpTest.php


示例5: register

 public static function register()
 {
     stream_register_wrapper('mmap', __CLASS__);
 }
开发者ID:calcinai,项目名称:php-mmap,代码行数:4,代码来源:StreamWrapper.php


示例6: stream_seek

    public function stream_seek($offset, $whence)
    {
    }
    // end stream_seek();
    /**
     * PHP stream function - reports some data about the current file.
     * @return Array
     */
    public function stream_stat()
    {
        if (!isset(self::$files[$this->file])) {
            return array();
        }
        return array('size' => strlen($this->file));
    }
    // end stream_stat();
    /**
     * PHP stream function - reports some data about the current file.
     * @return Array
     */
    public function url_stat($path, $flags)
    {
        if (!isset(self::$files[$path])) {
            return false;
        }
        return array('size' => strlen($path));
    }
}
// end Extra_TestFS;
stream_register_wrapper('test', 'Extra_TestFS');
开发者ID:OPL,项目名称:Open-Power-Template,代码行数:30,代码来源:TestFS.php


示例7: error_reporting

<?php

// << ...custom stream wrapper goes somewhere here...>>
echo '<pre>';
error_reporting(E_ALL);
ini_set('display_errors', true);
clearstatcache();
stream_register_wrapper('test', 'MemoryStream');
mkdir('test://aaa');
mkdir('test://aaa/cc');
mkdir('test://aaa/dd');
echo 'PHP ' . PHP_VERSION;
echo '<br />node exists: ' . file_exists('test://aaa/cc');
echo '<br />node is writable: ' . is_writable('test://aaa/cc');
echo '<br />node is dir: ' . is_dir('test://aaa/cc');
echo '<br />tempnam in dir: ' . tempnam('test://aaa/cc', 'tmp');
echo "<br /></pre>";
开发者ID:slametsetiawan,项目名称:project-gregory,代码行数:17,代码来源:test_buat_file.php


示例8: registerStreamWrapper

 /**
  * Register this object as stream wrapper
  *
  * @param  string $name Protocol name
  */
 public function registerStreamWrapper($name = 'azure')
 {
     /**
      * @see Microsoft_WindowsAzure_Storage_Blob_Stream
      */
     require_once 'Microsoft/WindowsAzure/Storage/Blob/Stream.php';
     stream_register_wrapper($name, 'Microsoft_WindowsAzure_Storage_Blob_Stream');
     $this->registerAsClient($name);
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:14,代码来源:Blob.php


示例9: registerStreamWrapper

 /**
  * Register this object as stream wrapper
  *
  * @param  string $name
  * @return Zend_Service_Amazon_S3
  */
 public function registerStreamWrapper($name = 's3')
 {
     /**
      * @see Zend_Service_Amazon_S3_Stream
      */
     #require_once 'Zend/Service/Amazon/S3/Stream.php';
     stream_register_wrapper($name, 'Zend_Service_Amazon_S3_Stream');
     $this->registerAsClient($name);
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:15,代码来源:S3.php


示例10: registerStreamWrapper

 /**
  * Register this object as stream wrapper
  *
  * @param  string $name
  * @return Zend_Service_Amazon_S3
  */
 public function registerStreamWrapper($name = 's3')
 {
     stream_register_wrapper($name, 'Zend_Service_Amazon_S3_Stream');
     $this->registerAsClient($name);
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:11,代码来源:S3.php


示例11: stream_open

<?php

class test
{
    function stream_open()
    {
        echo "open\n";
        return true;
    }
    function stream_write($d)
    {
        echo "write {$d}\n";
        return strlen($d);
    }
    function stream_flush()
    {
        echo "flush\n";
        return true;
    }
    function stream_close()
    {
        echo "close\n";
    }
}
stream_register_wrapper("test", "test", STREAM_IS_URL);
var_dump(file_put_contents("test://hello", "w"));
开发者ID:badlamer,项目名称:hhvm,代码行数:26,代码来源:user_stream_leak.php


示例12: startTestSuite

 /**
  * @param \PHPUnit_Framework_TestSuite $suite
  */
 public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
 {
     foreach ($this->wrappers as $wrapper) {
         \stream_wrapper_unregister($wrapper);
         \stream_register_wrapper($wrapper, self::STREAM_WRAPPER_NAME_SPACE . $this->wrapperClass, \STREAM_IS_URL);
     }
     Http::setSaveDir($this->saveDir);
 }
开发者ID:QuickenLoans,项目名称:interception,代码行数:11,代码来源:InterceptionListener.php


示例13: strlen

                } else {
                    return false;
                }
                break;
            case SEEK_CUR:
                if ($offset >= 0) {
                    $this->pos += $offset;
                    return true;
                } else {
                    return false;
                }
                break;
            case SEEK_END:
                if (strlen($this->data) + $offset >= 0) {
                    $this->pos = strlen($this->data) + $offset;
                    return true;
                } else {
                    return false;
                }
                break;
            default:
                return false;
        }
    }
}
stream_register_wrapper("test1", "test", STREAM_IS_URL);
stream_register_wrapper("test2", "test");
echo @file_get_contents("test1://hello"), "\n";
@(include "test1://hello");
echo @file_get_contents("test2://hello"), "\n";
include "test2://hello";
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:include_userstream_002.php


示例14: strlen

                    $this->position += $offset;
                    return true;
                } else {
                    return false;
                }
                break;
            case SEEK_END:
                if (strlen($GLOBALS[$this->varname]) + $offset >= 0) {
                    $this->position = strlen($GLOBALS[$this->varname]) + $offset;
                    return true;
                } else {
                    return false;
                }
                break;
            default:
                trigger_error("Unknown whence for fseek of global variable \${$this->varname}", E_USER_NOTICE);
                return false;
        }
    }
    /**
     * Callback for fstat().
     *
     * @return array
     */
    public function stream_stat()
    {
        return array();
    }
}
stream_register_wrapper('global', 'Q\\VariableStream');
开发者ID:jasny,项目名称:Q,代码行数:30,代码来源:VariableStream.php


示例15: register

 /**
  * Register the stream
  */
 public function register()
 {
     if (isset($GLOBALS['sugar_config']['upload_wrapper_class'])) {
         SugarAutoLoader::requireWithCustom("include/{$GLOBALS['sugar_config']['upload_wrapper_class']}.php");
         if (class_exists($GLOBALS['sugar_config']['upload_wrapper_class'])) {
             self::$wrapper_class = $GLOBALS['sugar_config']['upload_wrapper_class'];
         } else {
             self::$wrapper_class = __CLASS__;
         }
     } else {
         self::$wrapper_class = __CLASS__;
     }
     stream_register_wrapper(self::STREAM_NAME, self::$wrapper_class);
     self::$instance = new self::$wrapper_class();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:18,代码来源:upload_file.php


示例16: registerStreamWrapper

 /**
  * Register this object as stream wrapper
  *
  * @param  string $name Protocol name
  */
 public function registerStreamWrapper($name = 'azure')
 {
     stream_register_wrapper($name, __NAMESPACE__ . '\\Stream');
     $this->registerAsClient($name);
 }
开发者ID:achretien,项目名称:azure-blob-storage,代码行数:10,代码来源:BlobClient.php


示例17: pg_lo_tell

    {
        return pg_lo_tell($this->loh);
    }
    function stream_eof()
    {
        return pg_lo_tell($this->loh) >= $this->size;
    }
    function stream_flush()
    {
        return true;
    }
    function stream_stat()
    {
        return array('size' => $this->size, 'ino' => $this->lon);
    }
    function stream_write($data)
    {
        return pg_lo_write($this->loh, $data);
    }
    function stream_close()
    {
        if (pg_lo_close($this->loh)) {
            return pg_query($this->dbh, 'COMMIT');
        } else {
            pg_query($this->dbh, 'ROLLBACK');
            return false;
        }
    }
}
stream_register_wrapper('pglob', 'PgLobStream');
开发者ID:garybulin,项目名称:php7,代码行数:30,代码来源:PgLobStream.php


示例18: registerStream

 /**
  * Register a stream.
  *
  * @return int
  */
 public static function registerStream(Stream $stream)
 {
     if (empty(static::$streams)) {
         stream_register_wrapper('filicious-streams', 'Filicious\\Stream\\StreamWrapper', STREAM_IS_URL);
     }
     static::$streams[++static::$streamIndex] = $stream;
     return static::$streamIndex;
 }
开发者ID:filicious,项目名称:core,代码行数:13,代码来源:StreamManager.php


示例19: registerStreamWrapper

 /**
  * Register this object as stream wrapper
  *
  * @param  string $name Protocol name
  */
 public function registerStreamWrapper($name = 'azure')
 {
     stream_register_wrapper($name, 'Blob_Stream');
     $this->registerAsClient($name);
 }
开发者ID:navassouza,项目名称:zf2,代码行数:10,代码来源:Blob.php


示例20: stream_register_wrapper

<?php

require_once 'Stream/SHM.php';
stream_register_wrapper('shm', 'Stream_SHM') or die("can't register shm");
$shm = fopen('shm://0xabcd', 'c');
fwrite($shm, "Current time is: " . time());
fclose($shm);
开发者ID:zmwebdev,项目名称:PHPcookbook-code-3ed,代码行数:7,代码来源:custom1.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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