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


PHP stream_register_wrapper函数代码示例

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


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


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