本文整理匯總了PHP中Includes\Utils\FileManager::isFileWriteable方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileManager::isFileWriteable方法的具體用法?PHP FileManager::isFileWriteable怎麽用?PHP FileManager::isFileWriteable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Includes\Utils\FileManager
的用法示例。
在下文中一共展示了FileManager::isFileWriteable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: saveCode
/**
* Save
*
* @param string $code Code
*
* @return void
*/
protected function saveCode($code)
{
if ("\r\n" != PHP_EOL) {
$code = str_replace("\r\n", PHP_EOL, $code);
}
$code = str_replace(chr(194) . chr(160), ' ', $code);
$file = $this->getFileName();
\Includes\Utils\FileManager::write($file, $code);
if (\Includes\Utils\FileManager::isFileWriteable($file)) {
\XLite\Core\TopMessage::addInfo('Your custom file is successfully saved');
\Includes\Utils\FileManager::deleteFile(str_replace('custom', 'custom.min', $file));
\XLite\Core\Database::getRepo('XLite\\Model\\Config')->createOption(array('name' => $this->getBackupName(), 'value' => $code, 'category' => 'XC\\ThemeTweaker'));
\XLite\Core\Config::updateInstance();
$config = \XLite\Core\Config::getInstance()->Performance;
if ($config->aggregate_css || $config->aggregate_js) {
\Includes\Utils\FileManager::unlinkRecursive(LC_DIR_CACHE_RESOURCES);
\XLite\Core\TopMessage::addInfo('Aggregation cache has been cleaned');
}
} else {
\XLite\Core\TopMessage::addError('The file {{file}} does not exist or is not writable.', array('file' => $file));
}
}
示例2: isFileWritable
/**
* isFileWritable
*
* @return boolean
*/
public function isFileWritable()
{
return $this->isDirExists() && (!$this->isFileExists() || \Includes\Utils\FileManager::isFileWriteable($this->sqldumpFile));
}