本文整理汇总了PHP中Varien_Io_File::rmdirRecursive方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Io_File::rmdirRecursive方法的具体用法?PHP Varien_Io_File::rmdirRecursive怎么用?PHP Varien_Io_File::rmdirRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Io_File
的用法示例。
在下文中一共展示了Varien_Io_File::rmdirRecursive方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanupReports
/**
* Ensure reports directory exists, empty, and has write permissions
*
* @throws Magento_Exception
*/
public function cleanupReports()
{
$reportDir = $this->_config->getReportDir();
if (file_exists($reportDir) && !Varien_Io_File::rmdirRecursive($reportDir)) {
throw new Magento_Exception("Cannot cleanup reports directory '{$reportDir}'.");
}
mkdir($reportDir, 0777, true);
}
示例2: setUpBeforeClass
public static function setUpBeforeClass()
{
$fixtureDir = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files';
Mage::app()->getConfig()->getOptions()->setDesignDir($fixtureDir . DIRECTORY_SEPARATOR . 'design');
Varien_Io_File::rmdirRecursive(Mage::app()->getConfig()->getOptions()->getMediaDir() . '/skin');
$ioAdapter = new Varien_Io_File();
$ioAdapter->cp(Mage::app()->getConfig()->getOptions()->getJsDir() . '/prototype/prototype.js', Mage::app()->getConfig()->getOptions()->getJsDir() . '/prototype/prototype.min.js');
self::$_developerMode = Mage::getIsDeveloperMode();
}
示例3: tearDown
protected function tearDown()
{
/** @var $config Mage_Core_Model_Config */
$config = Mage::getObjectManager()->get('Mage_Core_Model_Config');
$generationDirectory = $config->getVarDir() . '/generation';
Varien_Io_File::rmdirRecursive($generationDirectory);
set_include_path($this->_includePath);
unset($this->_generator);
}
示例4: setUp
protected function setUp()
{
Mage::app()->getConfig()->getOptions()->setDesignDir(dirname(__DIR__) . '/_files/design');
Varien_Io_File::rmdirRecursive(Mage::app()->getConfig()->getOptions()->getMediaDir() . '/skin');
$this->_model = new Mage_Core_Model_Design_Package();
//$this->_model->setArea('frontend')->setDesignTheme('package/default/theme');
$pub = Mage::getBaseDir('media');
$this->_pubMerged = "{$pub}/skin/_merged";
$this->_pubLib = Mage::getBaseDir('js');
// emulate source skin
$this->_skinFixture = dirname(__DIR__) . '/_files/skin';
}
示例5: testRmdirRecursive
public function testRmdirRecursive()
{
try {
$this->_prepare();
$this->assertFileExists($this->_file);
Varien_Io_File::rmdirRecursive($this->_dir);
$this->assertFileNotExists($this->_dir);
} catch (Exception $e) {
}
$this->_cleanup();
if (isset($e)) {
throw $e;
}
}
示例6: _initMergerCssDir
protected function _initMergerCssDir($dirRelativeName, $cleanup = false)
{
$skinDir = Mage::getBaseDir('skin');
try {
$dir = Mage::getBaseDir('skin') . DS . $dirRelativeName;
if ($cleanup) {
Varien_Io_File::rmdirRecursive($dir);
Mage::helper('core/file_storage_database')->deleteFolder($dir);
}
if (!is_dir($dir)) {
mkdir($dir);
}
return is_writeable($dir) ? $dir : false;
} catch (Exception $e) {
Mage::logException($e);
}
return false;
}
示例7: testCleanupReports
public function testCleanupReports()
{
$fixtureDir = $this->_getBaseFixtureDir() . '/config_dist';
$reportDir = $fixtureDir . '/report';
mkdir($reportDir, 0777);
try {
$reportFile = $reportDir . '/a.jtl';
touch($reportFile);
$this->assertFileExists($reportFile);
$bootstrap = new Magento_Performance_Bootstrap($fixtureDir, $fixtureDir);
$bootstrap->cleanupReports();
$this->assertFileNotExists($reportFile);
$this->assertFileExists($reportDir);
Varien_Io_File::rmdirRecursive($reportDir);
} catch (Exception $e) {
Varien_Io_File::rmdirRecursive($reportDir);
throw $e;
}
}
示例8: cleanMergedJsCss
/**
* Remove all merged js/css files
*
* @return bool
*/
public function cleanMergedJsCss()
{
$dir = $this->_buildPublicSkinFilename(self::PUBLIC_MERGE_DIR);
$result = Varien_Io_File::rmdirRecursive($dir);
$result = $result && Mage::helper('Mage_Core_Helper_File_Storage_Database')->deleteFolder($dir);
return $result;
}
示例9: tearDownAfterClass
public static function tearDownAfterClass()
{
$config = Mage::getSingleton('Mage_Catalog_Model_Product_Media_Config');
Varien_Io_File::rmdirRecursive($config->getBaseMediaPath());
Varien_Io_File::rmdirRecursive($config->getBaseTmpMediaPath());
}
示例10: setUpBeforeClass
public static function setUpBeforeClass()
{
$fixtureDir = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files';
Mage::app()->getConfig()->getOptions()->setDesignDir($fixtureDir . DIRECTORY_SEPARATOR . 'design');
Varien_Io_File::rmdirRecursive(Mage::app()->getConfig()->getOptions()->getMediaDir() . '/skin');
}
示例11: scheduledLogClean
/**
* Clear old log files and folders
*
* @param Mage_Cron_Model_Schedule $schedule
* @param bool $forceRun
* @return bool
*/
public function scheduledLogClean($schedule, $forceRun = false)
{
$result = false;
if (!Mage::getStoreConfig(self::CRON_STRING_PATH) && (!$forceRun || !Mage::getStoreConfig(self::LOG_CLEANING_ENABLE_PATH))) {
return;
}
try {
$logPath = Mage::getConfig()->getOptions()->getVarDir() . DS . Enterprise_ImportExport_Model_Scheduled_Operation::LOG_DIRECTORY;
if (!file_exists($logPath) || !is_dir($logPath)) {
if (!mkdir($logPath, 0777, true)) {
Mage::throwException(Mage::helper('enterprise_importexport')->__('Unable to create directory "%s".', $logPath));
}
}
if (!is_dir($logPath) || !is_writable($logPath)) {
Mage::throwException(Mage::helper('enterprise_importexport')->__('Directory "%s" is not writable.', $logPath));
}
$saveTime = (int) Mage::getStoreConfig(self::SAVE_LOG_TIME_PATH) + 1;
$dateCompass = new DateTime('-' . $saveTime . ' days');
foreach ($this->_getDirectoryList($logPath) as $directory) {
$separator = str_replace('\\', '\\\\', DS);
if (!preg_match("~(\\d{4}){$separator}(\\d{2}){$separator}(\\d{2})\$~", $directory, $matches)) {
continue;
}
$direcotryDate = new DateTime($matches[1] . '-' . $matches[2] . '-' . $matches[3]);
if ($forceRun || $direcotryDate < $dateCompass) {
$fs = new Varien_Io_File();
if (!$fs->rmdirRecursive($directory, true)) {
$directory = str_replace(Mage::getBaseDir() . DS, '', $directory);
Mage::throwException(Mage::helper('enterprise_importexport')->__('Unable to delete "%s". Directory is not writable.', $directory));
}
}
}
$result = true;
} catch (Exception $e) {
$this->_sendEmailNotification(array('warnings' => $e->getMessage()));
}
return $result;
}
示例12: tearDownAfterClass
public static function tearDownAfterClass()
{
Varien_Io_File::rmdirRecursive(self::$_mediaTmpDir);
Varien_Io_File::rmdirRecursive(self::$_mediaDir);
}
示例13: createTmpDir
/**
* createTmpDir
*
* @return Ambigous <boolean, string>|boolean
* @author "Justus Krapp <jk@ecocode.de>"
*/
private function createTmpDir()
{
try {
$dir = $this->getTmpDir();
Varien_Io_File::rmdirRecursive($dir);
Mage::helper('core/file_storage_database')->deleteFolder($dir);
if (!is_dir($dir)) {
mkdir($dir);
}
return is_writeable($dir) ? $dir : false;
} catch (Exception $e) {
Mage::getSingleton('ecocode_minify/log')->logError($e->getMessage(), $e->getTraceAsString());
}
return false;
}
示例14: realpath
$baseDir = realpath(__DIR__ . '/../../../');
$configFile = $args['build_properties_file'];
$configFile = file_exists($configFile) ? $configFile : "{$configFile}.dist";
$config = (require $configFile);
$installOptions = isset($config['install_options']) ? $config['install_options'] : array();
$reportDir = __DIR__ . '/' . $config['report_dir'];
/* Install application */
if ($installOptions) {
$installCmd = sprintf('php -f %s --', escapeshellarg("{$baseDir}/dev/shell/install.php"));
foreach ($installOptions as $optionName => $optionValue) {
$installCmd .= sprintf(' --%s %s', $optionName, escapeshellarg($optionValue));
}
passthru($installCmd, $exitCode);
if ($exitCode) {
exit($exitCode);
}
}
/* Initialize Magento application */
require_once __DIR__ . '/../../../app/bootstrap.php';
Mage::app();
/* Clean reports */
Varien_Io_File::rmdirRecursive($reportDir);
/* Run all indexer processes */
/** @var $indexer Mage_Index_Model_Indexer */
$indexer = Mage::getModel('Mage_Index_Model_Indexer');
/** @var $process Mage_Index_Model_Process */
foreach ($indexer->getProcessesCollection() as $process) {
if ($process->getIndexer()->isVisible()) {
$process->reindexEverything();
}
}
示例15: tearDownAfterClass
public static function tearDownAfterClass()
{
Varien_Io_File::rmdirRecursive(self::$_pubJslib);
}