當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。