本文整理匯總了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);
}
}
示例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()));
}
示例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;
}