当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Io_File::rmdirRecursive方法代码示例

本文整理汇总了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);
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例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();
 }
开发者ID:rorteg,项目名称:magento2,代码行数:9,代码来源:PackageTest.php

示例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);
 }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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';
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:12,代码来源:PackageMerging.php

示例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;
     }
 }
开发者ID:nemphys,项目名称:magento2,代码行数:14,代码来源:FileTest.php

示例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;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:18,代码来源:Package.php

示例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;
     }
 }
开发者ID:nayanchamp,项目名称:magento2,代码行数:19,代码来源:BootstrapTest.php

示例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;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:12,代码来源:Package.php

示例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());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:6,代码来源:ProductTest.php

示例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');
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:6,代码来源:Package.php

示例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;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:45,代码来源:Observer.php

示例12: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     Varien_Io_File::rmdirRecursive(self::$_mediaTmpDir);
     Varien_Io_File::rmdirRecursive(self::$_mediaDir);
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:5,代码来源:Media.php

示例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;
 }
开发者ID:adrian-green,项目名称:ecocode_minify,代码行数:21,代码来源:Observer.php

示例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();
    }
}
开发者ID:nickimproove,项目名称:magento2,代码行数:31,代码来源:install.php

示例15: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     Varien_Io_File::rmdirRecursive(self::$_pubJslib);
 }
开发者ID:relue,项目名称:magento2,代码行数:4,代码来源:PackageTest.php


注:本文中的Varien_Io_File::rmdirRecursive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。