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