本文整理汇总了PHP中TYPO3\Flow\Utility\Files::emptyDirectoryRecursively方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::emptyDirectoryRecursively方法的具体用法?PHP Files::emptyDirectoryRecursively怎么用?PHP Files::emptyDirectoryRecursively使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Utility\Files
的用法示例。
在下文中一共展示了Files::emptyDirectoryRecursively方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flush
/**
* Removes all cache entries of this cache.
*
* @return void
* @api
*/
public function flush()
{
\TYPO3\Flow\Utility\Files::emptyDirectoryRecursively($this->cacheDirectory);
}
示例2: compileProxies
/**
* Compiles the Doctrine proxy class code using the Doctrine ProxyFactory.
*
* @return void
*/
public function compileProxies()
{
Files::emptyDirectoryRecursively(Files::concatenatePaths(array($this->environment->getPathToTemporaryDirectory(), 'Doctrine/Proxies')));
$proxyFactory = $this->entityManager->getProxyFactory();
$proxyFactory->generateProxyClasses($this->entityManager->getMetadataFactory()->getAllMetadata());
}
示例3: emptyDirectoryRecursivelyThrowsExceptionIfSpecifiedPathDoesNotExist
/**
* @test
* @expectedException \TYPO3\Flow\Utility\Exception
*/
public function emptyDirectoryRecursivelyThrowsExceptionIfSpecifiedPathDoesNotExist()
{
Files::emptyDirectoryRecursively('NonExistingPath');
}
示例4: flush
/**
* Removes all cache entries of this cache and sets the frozen flag to FALSE.
*
* @return void
* @api
*/
public function flush()
{
Files::emptyDirectoryRecursively($this->cacheDirectory);
if ($this->frozen === TRUE) {
@unlink($this->cacheDirectory . 'FrozenCache.data');
$this->frozen = FALSE;
}
}
示例5: forceFlushCachesIfNecessary
/**
* Does some emergency, forced, low level flush caches if the user told to do
* so through the command line.
*
* @param Bootstrap $bootstrap
* @return void
*/
public static function forceFlushCachesIfNecessary(Bootstrap $bootstrap)
{
if (!isset($_SERVER['argv']) || !isset($_SERVER['argv'][1]) || !isset($_SERVER['argv'][2]) || !in_array($_SERVER['argv'][1], array('typo3.flow:cache:flush', 'flow:cache:flush')) || !in_array($_SERVER['argv'][2], array('--force', '-f'))) {
return;
}
$bootstrap->getEarlyInstance('TYPO3\\Flow\\Cache\\CacheManager')->flushCaches();
$environment = $bootstrap->getEarlyInstance('TYPO3\\Flow\\Utility\\Environment');
\TYPO3\Flow\Utility\Files::emptyDirectoryRecursively($environment->getPathToTemporaryDirectory());
echo 'Force-flushed caches for "' . $bootstrap->getContext() . '" context.' . PHP_EOL;
exit(0);
}
示例6: forceFlushCachesIfNecessary
/**
* Does some emergency, forced, low level flush caches if the user told to do
* so through the command line.
*
* @param Bootstrap $bootstrap
* @return void
*/
public static function forceFlushCachesIfNecessary(Bootstrap $bootstrap)
{
if (!isset($_SERVER['argv']) || !isset($_SERVER['argv'][1]) || !isset($_SERVER['argv'][2]) || !in_array($_SERVER['argv'][1], array('typo3.flow:cache:flush', 'flow:cache:flush')) || !in_array($_SERVER['argv'][2], array('--force', '-f'))) {
return;
}
$bootstrap->getEarlyInstance(\TYPO3\Flow\Cache\CacheManager::class)->flushCaches();
$environment = $bootstrap->getEarlyInstance(\TYPO3\Flow\Utility\Environment::class);
\TYPO3\Flow\Utility\Files::emptyDirectoryRecursively($environment->getPathToTemporaryDirectory());
echo 'Force-flushed caches for "' . $bootstrap->getContext() . '" context.' . PHP_EOL;
// In production the site will be locked as this is a compiletime request so we need to take care to remove that lock again.
if ($bootstrap->getContext()->isProduction()) {
$bootstrap->getEarlyInstance(\TYPO3\Flow\Core\LockManager::class)->unlockSite();
}
exit(0);
}
示例7: flush
/**
* Removes all cache entries of this cache.
*
* @return void
* @api
*/
public function flush()
{
Files::emptyDirectoryRecursively($this->cacheDirectory);
}