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


PHP Storage::getId方法代码示例

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


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

示例1: __construct

 public function __construct(\OC\Files\Storage\Storage $storage)
 {
     $this->storage = $storage;
     $this->storageId = $this->storage->getId();
     $this->cache = $storage->getCache();
     $this->cacheActive = !Config::getSystemValue('filesystem_cache_readonly', false);
 }
开发者ID:kebenxiaoming,项目名称:owncloudRedis,代码行数:7,代码来源:scanner.php

示例2: __construct

 public function __construct(\OC\Files\Storage\Storage $storage)
 {
     $this->storage = $storage;
     $this->storageId = $this->storage->getId();
     $this->cache = $storage->getCache();
     $this->permissionsCache = $storage->getPermissionsCache();
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:7,代码来源:scanner.php

示例3: __construct

 /**
  * @param \OC\Files\Storage\Storage|string $storage
  * @throws \RuntimeException
  */
 public function __construct($storage)
 {
     if ($storage instanceof \OC\Files\Storage\Storage) {
         $this->storageId = $storage->getId();
     } else {
         $this->storageId = $storage;
     }
     $this->storageId = self::adjustStorageId($this->storageId);
     $sql = 'SELECT `numeric_id` FROM `*PREFIX*storages` WHERE `id` = ?';
     $result = \OC_DB::executeAudited($sql, array($this->storageId));
     if ($row = $result->fetchRow()) {
         $this->numericId = $row['numeric_id'];
     } else {
         $connection = \OC_DB::getConnection();
         if ($connection->insertIfNotExist('*PREFIX*storages', ['id' => $this->storageId])) {
             $this->numericId = \OC_DB::insertid('*PREFIX*storages');
         } else {
             $result = \OC_DB::executeAudited($sql, array($this->storageId));
             if ($row = $result->fetchRow()) {
                 $this->numericId = $row['numeric_id'];
             } else {
                 throw new \RuntimeException('Storage could neither be inserted nor be selected from the database');
             }
         }
     }
 }
开发者ID:samj1912,项目名称:repo,代码行数:30,代码来源:storage.php

示例4: __construct

 /**
  * @param \OC\Files\Storage\Storage|string $storage
  */
 public function __construct($storage)
 {
     if ($storage instanceof \OC\Files\Storage\Storage) {
         $this->storageId = $storage->getId();
     } else {
         $this->storageId = $storage;
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:11,代码来源:permissions.php

示例5: __construct

 /**
  * @param \OC\Files\Storage\Storage|string $storage
  */
 public function __construct($storage)
 {
     if ($storage instanceof \OC\Files\Storage\Storage) {
         $this->storageId = $storage->getId();
     } else {
         $this->storageId = $storage;
     }
     if (strlen($this->storageId) > 64) {
         $this->storageId = md5($this->storageId);
     }
     $this->storageCache = new Storage($storage);
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:15,代码来源:cache.php

示例6: __construct

 /**
  * @param \OC\Files\Storage\Storage|string $storage
  */
 public function __construct($storage)
 {
     if ($storage instanceof \OC\Files\Storage\Storage) {
         $this->storageId = $storage->getId();
     } else {
         $this->storageId = $storage;
     }
     if (strlen($this->storageId) > 64) {
         $this->storageId = md5($this->storageId);
     }
     $this->storageCache = new Storage($storage);
     $this->mimetypeLoader = \OC::$server->getMimeTypeLoader();
 }
开发者ID:rajeshpillai,项目名称:core,代码行数:16,代码来源:cache.php

示例7: getStorageId

	/**
	 * @return string
	 */
	public function getStorageId() {
		if (!$this->storageId) {
			if (is_null($this->storage)) {
				$storage = $this->createStorage(); //FIXME: start using exceptions
				if (is_null($storage)) {
					return null;
				}

				$this->storage = $storage;
			}
			$this->storageId = $this->storage->getId();
			if (strlen($this->storageId) > 64) {
				$this->storageId = md5($this->storageId);
			}
		}
		return $this->storageId;
	}
开发者ID:ninjasilicon,项目名称:core,代码行数:20,代码来源:mountpoint.php

示例8: __construct

 /**
  * @param \OC\Files\Storage\Storage|string $storage
  */
 public function __construct($storage)
 {
     if ($storage instanceof \OC\Files\Storage\Storage) {
         $this->storageId = $storage->getId();
     } else {
         $this->storageId = $storage;
     }
     $this->storageId = self::adjustStorageId($this->storageId);
     $sql = 'SELECT `numeric_id` FROM `*PREFIX*storages` WHERE `id` = ?';
     $result = \OC_DB::executeAudited($sql, array($this->storageId));
     if ($row = $result->fetchRow()) {
         $this->numericId = $row['numeric_id'];
     } else {
         $sql = 'INSERT INTO `*PREFIX*storages` (`id`) VALUES(?)';
         \OC_DB::executeAudited($sql, array($this->storageId));
         $this->numericId = \OC_DB::insertid('*PREFIX*storages');
     }
 }
开发者ID:Combustible,项目名称:core,代码行数:21,代码来源:storage.php

示例9: __construct

 /**
  * @param \OC\Files\Storage\Storage|string $storage
  */
 public function __construct($storage)
 {
     if ($storage instanceof \OC\Files\Storage\Storage) {
         $this->storageId = $storage->getId();
     } else {
         $this->storageId = $storage;
     }
     if (strlen($this->storageId) > 64) {
         $this->storageId = md5($this->storageId);
     }
     $query = \OC_DB::prepare('SELECT `numeric_id` FROM `*PREFIX*storages` WHERE `id` = ?');
     $result = $query->execute(array($this->storageId));
     if ($row = $result->fetchRow()) {
         $this->numericId = $row['numeric_id'];
     } else {
         $query = \OC_DB::prepare('INSERT INTO `*PREFIX*storages`(`id`) VALUES(?)');
         $query->execute(array($this->storageId));
         $this->numericId = \OC_DB::insertid('*PREFIX*storages');
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:23,代码来源:cache.php

示例10: __construct

 /**
  * @param \OC\Files\Storage\Storage|string $storage
  * @param bool $isAvailable
  * @throws \RuntimeException
  */
 public function __construct($storage, $isAvailable = true)
 {
     if ($storage instanceof \OC\Files\Storage\Storage) {
         $this->storageId = $storage->getId();
     } else {
         $this->storageId = $storage;
     }
     $this->storageId = self::adjustStorageId($this->storageId);
     if ($row = self::getStorageById($this->storageId)) {
         $this->numericId = $row['numeric_id'];
     } else {
         $connection = \OC_DB::getConnection();
         if ($connection->insertIfNotExist('*PREFIX*storages', ['id' => $this->storageId, 'available' => $isAvailable])) {
             $this->numericId = \OC_DB::insertid('*PREFIX*storages');
         } else {
             if ($row = self::getStorageById($this->storageId)) {
                 $this->numericId = $row['numeric_id'];
             } else {
                 throw new \RuntimeException('Storage could neither be inserted nor be selected from the database');
             }
         }
     }
 }
开发者ID:rosarion,项目名称:core,代码行数:28,代码来源:storage.php

示例11: getId

 /**
  * Get the identifier for the storage,
  * the returned id should be the same for every storage object that is created with the same parameters
  * and two storage objects with the same id should refer to two storages that display the same files.
  *
  * @return string
  */
 public function getId()
 {
     return $this->storage->getId();
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:11,代码来源:Wrapper.php

示例12: getNumericId

 /**
  * get the numeric storage id
  *
  * @param \OC\Files\Storage\Storage $storage
  * @return int
  */
 function getNumericId($storage)
 {
     $storageId = $storage->getId();
     if (!isset($this->numericIds[$storageId])) {
         $cache = $storage->getCache();
         $this->numericIds[$storageId] = $cache->getNumericStorageId();
     }
     return $this->numericIds[$storageId];
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:15,代码来源:upgrade.php


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