當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WriteInterface::isDirectory方法代碼示例

本文整理匯總了PHP中Magento\Framework\Filesystem\Directory\WriteInterface::isDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP WriteInterface::isDirectory方法的具體用法?PHP WriteInterface::isDirectory怎麽用?PHP WriteInterface::isDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\Filesystem\Directory\WriteInterface的用法示例。


在下文中一共展示了WriteInterface::isDirectory方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: cleanGeneratedFiles

 /**
  * Clean var/generation, var/di and var/cache
  *
  * @return void
  */
 public function cleanGeneratedFiles()
 {
     if ($this->write->isExist(self::REGENERATE_FLAG)) {
         $enabledCacheTypes = [];
         //TODO: to be removed in scope of MAGETWO-53476
         $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG);
         $configPool = new ConfigFilePool();
         $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV);
         if ($this->write->isExist($this->write->getRelativePath($envPath))) {
             $enabledCacheTypes = $this->getEnabledCacheTypes();
             $this->disableAllCacheTypes();
         }
         //TODO: Till here
         $cachePath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::CACHE));
         $generationPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::GENERATION));
         $diPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::DI));
         // Clean var/generation dir
         if ($this->write->isDirectory($generationPath)) {
             $this->write->delete($generationPath);
         }
         // Clean var/di
         if ($this->write->isDirectory($diPath)) {
             $this->write->delete($diPath);
         }
         // Clean var/cache
         if ($this->write->isDirectory($cachePath)) {
             $this->write->delete($cachePath);
         }
         $this->write->delete(self::REGENERATE_FLAG);
         $this->enableCacheTypes($enabledCacheTypes);
     }
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:37,代碼來源:GeneratedFiles.php

示例2: _createCertFile

 /**
  * Create physical certificate file based on DB data
  *
  * @param string $file
  * @return void
  */
 protected function _createCertFile($file)
 {
     if ($this->varDirectory->isDirectory(self::BASEPATH_PAYPAL_CERT)) {
         $this->_removeOutdatedCertFile();
     }
     $this->varDirectory->writeFile($file, $this->encryptor->decrypt($this->getContent()));
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:13,代碼來源:Cert.php

示例3: isReadableDirectory

 /**
  * Checks if directory exists and is readable
  *
  * @param \Magento\Framework\Filesystem\Directory\WriteInterface $directory
  * @return bool
  */
 protected function isReadableDirectory($directory)
 {
     if (!$directory->isExist() || !$directory->isDirectory() || !$directory->isReadable()) {
         return false;
     }
     return true;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:13,代碼來源:FilePermissions.php


注:本文中的Magento\Framework\Filesystem\Directory\WriteInterface::isDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。