本文整理汇总了PHP中Includes\Utils\FileManager::isReadable方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::isReadable方法的具体用法?PHP FileManager::isReadable怎么用?PHP FileManager::isReadable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\FileManager
的用法示例。
在下文中一共展示了FileManager::isReadable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
* Creates directory for locks if needed
*/
public function __construct()
{
if (!\Includes\Utils\FileManager::isExists(rtrim(static::LOCK_DIR, LC_DS))) {
\Includes\Utils\FileManager::mkdirRecursive(rtrim(static::LOCK_DIR, LC_DS));
}
if (!\Includes\Utils\FileManager::isReadable(static::LOCK_DIR) || !\Includes\Utils\FileManager::isWriteable(static::LOCK_DIR)) {
\XLite\Logger::getInstance()->log('Cannot create lock for keys', LOG_DEBUG);
}
parent::__construct();
}
示例2: verifyValueAsFile
/**
* Verify value as file
*
* @param mixed @value Value
*
* @return boolean
*/
protected function verifyValueAsFile($value)
{
// Do not verify files in verification mode and if 'ignoreFileChecking' option is true
if (!$this->isVerification() || !$this->importer->getOptions()->ignoreFileChecking) {
if (1 < count(parse_url($value))) {
$request = new \XLite\Core\HTTP\Request($value);
$response = $request->sendRequest();
$result = $response && 200 == $response->code;
} else {
$dir = \Includes\Utils\FileManager::getRealPath(LC_DIR_VAR . $this->importer->getOptions()->dir);
$result = \Includes\Utils\FileManager::isReadable($dir . LC_DS . $value);
}
} else {
$result = true;
}
return $result;
}
示例3: setRepositoryPath
/**
* Set repository path
*
* @param string $path Path to set
* @param boolean $preventCheck Flag OPTIONAL
* @param boolean $preventDeletion Flag OPTIONAL
*
* @return void
*/
public function setRepositoryPath($path, $preventCheck = false, $preventDeletion = false)
{
if (!empty($path) && !$preventCheck) {
$path = \Includes\Utils\FileManager::getRealPath($path);
if (empty($path) || !\Includes\Utils\FileManager::isReadable($path)) {
$path = null;
}
}
if (!$preventDeletion && !empty($this->repositoryPath) && $path !== $this->repositoryPath) {
if ($this->isDownloaded()) {
\Includes\Utils\FileManager::deleteFile($this->repositoryPath);
} elseif ($this->isUnpacked()) {
\Includes\Utils\FileManager::deleteFile($this->getCurrentVersionHashesFilePath());
\Includes\Utils\FileManager::unlinkRecursive($this->repositoryPath);
}
}
$this->repositoryPath = $path;
}