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


PHP Storage::fopen方法代码示例

本文整理汇总了PHP中OC\Files\Storage\Storage::fopen方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::fopen方法的具体用法?PHP Storage::fopen怎么用?PHP Storage::fopen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC\Files\Storage\Storage的用法示例。


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

示例1: fopen

 /**
  * see http://php.net/manual/en/function.fopen.php
  *
  * @param string $path
  * @param string $mode
  * @return resource
  */
 public function fopen($path, $mode)
 {
     return $this->storage->fopen($path, $mode);
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:11,代码来源:Wrapper.php

示例2: file_assemble

 /**
  * Assembles the chunks into the file specified by the path.
  * Also triggers the relevant hooks and proxies.
  *
  * @param \OC\Files\Storage\Storage $storage storage
  * @param string $path target path relative to the storage
  * @return bool true on success or false if file could not be created
  *
  * @throws \OC\ServerNotAvailableException
  */
 public function file_assemble($storage, $path)
 {
     // use file_put_contents as method because that best matches what this function does
     if (\OC\Files\Filesystem::isValidPath($path)) {
         $target = $storage->fopen($path, 'w');
         if ($target) {
             $count = $this->assemble($target);
             fclose($target);
             return $count > 0;
         } else {
             return false;
         }
     }
     return false;
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:25,代码来源:filechunking.php

示例3: file_assemble

 /**
  * Assembles the chunks into the file specified by the path.
  * Also triggers the relevant hooks and proxies.
  *
  * @param \OC\Files\Storage\Storage $storage
  * @param string $path target path relative to the storage
  * @param string $absolutePath
  * @return bool assembled file size or false if file could not be created
  *
  * @throws \OC\ServerNotAvailableException
  */
 public function file_assemble($storage, $path, $absolutePath)
 {
     $data = '';
     // use file_put_contents as method because that best matches what this function does
     if (\OC\Files\Filesystem::isValidPath($path)) {
         $exists = $storage->file_exists($path);
         $run = true;
         $hookPath = \OC\Files\Filesystem::getView()->getRelativePath($absolutePath);
         if (!$exists) {
             OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, array(\OC\Files\Filesystem::signal_param_path => $hookPath, \OC\Files\Filesystem::signal_param_run => &$run));
         }
         OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, array(\OC\Files\Filesystem::signal_param_path => $hookPath, \OC\Files\Filesystem::signal_param_run => &$run));
         if (!$run) {
             return false;
         }
         $target = $storage->fopen($path, 'w');
         if ($target) {
             $count = $this->assemble($target);
             fclose($target);
             if (!$exists) {
                 OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, array(\OC\Files\Filesystem::signal_param_path => $hookPath));
             }
             OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, array(\OC\Files\Filesystem::signal_param_path => $hookPath));
             return $count > 0;
         } else {
             return false;
         }
     }
     return false;
 }
开发者ID:gvde,项目名称:core,代码行数:41,代码来源:filechunking.php


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