本文整理汇总了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;
}