本文整理匯總了PHP中Magento\Framework\Filesystem\Directory\WriteInterface::touch方法的典型用法代碼示例。如果您正苦於以下問題:PHP WriteInterface::touch方法的具體用法?PHP WriteInterface::touch怎麽用?PHP WriteInterface::touch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\Filesystem\Directory\WriteInterface
的用法示例。
在下文中一共展示了WriteInterface::touch方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: set
/**
* Sets maintenance mode "on" or "off"
*
* @param bool $isOn
* @return bool
*/
public function set($isOn)
{
if ($isOn) {
return $this->flagDir->touch(self::FLAG_FILENAME);
}
if ($this->flagDir->isExist(self::FLAG_FILENAME)) {
return $this->flagDir->delete(self::FLAG_FILENAME);
}
return true;
}
示例2: setFlagValue
/**
* Create flag in case when value is set to 'true', remove it if value is set to 'false'.
*
* @param string $pathToFlagFile
* @param bool $value
* @return $this
*/
protected function setFlagValue($pathToFlagFile, $value)
{
if ($value) {
try {
$this->varReaderWriter->touch($pathToFlagFile);
} catch (FileSystemException $e) {
throw new \RuntimeException(sprintf('"%s" cannot be created.', $pathToFlagFile));
}
} else {
if ($this->varReaderWriter->isExist($pathToFlagFile)) {
$this->varReaderWriter->delete($pathToFlagFile);
}
}
return $this;
}
示例3: requestRegeneration
/**
* Create flag for cleaning up var/generation, var/di and var/cache directories for subsequent
* regeneration of this content
*
* @return void
*/
public function requestRegeneration()
{
$this->write->touch(self::REGENERATE_FLAG);
}