當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfFilesystem::sh方法代碼示例

本文整理匯總了PHP中sfFilesystem::sh方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfFilesystem::sh方法的具體用法?PHP sfFilesystem::sh怎麽用?PHP sfFilesystem::sh使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sfFilesystem的用法示例。


在下文中一共展示了sfFilesystem::sh方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sprintf

 */
require_once dirname(__FILE__) . '/../../lib/exception/sfException.class.php';
require_once dirname(__FILE__) . '/../../lib/task/sfFilesystem.class.php';
require_once dirname(__FILE__) . '/../../lib/util/sfFinder.class.php';
require_once dirname(__FILE__) . '/../../lib/vendor/lime/lime.php';
if (!isset($argv[1])) {
    throw new Exception('You must provide version prefix.');
}
if (!isset($argv[2])) {
    throw new Exception('You must provide stability status (alpha/beta/stable).');
}
$stability = $argv[2];
$filesystem = new sfFilesystem();
if (($stability == 'beta' || $stability == 'alpha') && count(explode('.', $argv[1])) < 2) {
    $version_prefix = $argv[1];
    $result = $filesystem->sh('svn status -u ' . getcwd());
    if (preg_match('/Status against revision\\:\\s+(\\d+)\\s*$/im', $result, $match)) {
        $version = $match[1];
    }
    if (!isset($version)) {
        throw new Exception('Unable to find last SVN revision.');
    }
    // make a PEAR compatible version
    $version = $version_prefix . '.' . $version;
} else {
    $version = $argv[1];
}
print sprintf("Releasing symfony version \"%s\".\n", $version);
// tests
$result = $filesystem->sh('php data/bin/symfony symfony:test');
if (0 != $result) {
開發者ID:bigcalm,項目名稱:urlcatcher,代碼行數:31,代碼來源:release.php

示例2: _cleanupAdminGenModules

 protected function _cleanupAdminGenModules()
 {
     $fs = new sfFilesystem($this->getContext()->getEventDispatcher(), new sfFormatter());
     foreach ($this->_modules as $module) {
         $this->info('Removing admin gen module "' . $module . '"');
         $fs->sh('rm -rf ' . sfConfig::get('sf_app_module_dir') . '/' . $module);
     }
     $fs->sh('rm -rf ' . sfConfig::get('sf_test_dir') . '/functional/backend');
     $fs->sh('rm -rf ' . sfConfig::get('sf_data_dir') . '/*.sqlite');
 }
開發者ID:bigcalm,項目名稱:urlcatcher,代碼行數:10,代碼來源:AdminGenBrowser.class.php

示例3: callLesscCompiler

 /**
  * Calls lessc compiler for LESS file
  *
  * @param   string  $lessFile a LESS file
  * @param   string  $cssFile  a CSS file
  * 
  * @return  string            output
  */
 public function callLesscCompiler($lessFile, $cssFile)
 {
     // Setting current file. We will output this var if compiler throws error
     $this->currentFile = $lessFile;
     // Compile with lessc
     $fs = new sfFilesystem();
     $command = sprintf('lessc "%s" "%s"', $lessFile, $cssFile);
     if ('1.3.0' <= SYMFONY_VERSION) {
         try {
             $fs->execute($command, null, array($this, 'throwCompilerError'));
         } catch (RuntimeException $e) {
             return false;
         }
     } else {
         $fs->sh($command);
     }
     // Setting current file to null
     $this->currentFile = null;
     return file_get_contents($cssFile);
 }
開發者ID:holdensmagicalunicorn,項目名稱:sfLESSPlugin,代碼行數:28,代碼來源:sfLESS.class.php

示例4: callLesscCompiler

 /**
  * Calls lessc compiler for LESS file
  *
  * @param string $lessFile a LESS file
  * @param string $cssFile a CSS file
  * @return string output
  */
 public function callLesscCompiler($lessFile, $cssFile)
 {
     // Compile with lessc
     $fs = new sfFilesystem();
     $command = sprintf('lessc%s "%s" "%s"', $this->isUseGrowl() ? ' -g' : '', $lessFile, $cssFile);
     if ('1.3.0' <= SYMFONY_VERSION) {
         try {
             $fs->execute($command, null, array($this, 'throwCompilerError'));
         } catch (RuntimeException $e) {
             return false;
         }
     } else {
         $fs->sh($command);
     }
     return file_get_contents($cssFile);
 }
開發者ID:everzet,項目名稱:sfLessPhpPlugin,代碼行數:23,代碼來源:sfLessPhp.class.php

示例5: callLesscCompiler

 /**
  * Calls lessc compiler for LESS file
  *
  * @param   string  $lessFile a LESS file
  * @param   string  $cssFile  a CSS file
  *
  * @return  string            output
  */
 public function callLesscCompiler($lessFile, $cssFile)
 {
     // Setting current file. We will output this var if compiler throws error
     $this->currentFile = $lessFile;
     if (self::getConfig()->isUseLessphp()) {
         require_once sfConfig::get('sf_lib_dir') . '/vendor/lessphp/lessc.inc.php';
         $less = new lessc($lessFile);
         file_put_contents($cssFile, $less->parse());
     } else {
         // Compile with lessc
         $fs = new sfFilesystem();
         $command = sprintf('lessc "%s" "%s"', $lessFile, $cssFile);
         if ('1.3.0' <= SYMFONY_VERSION) {
             try {
                 $fs->execute($command, null, array($this, 'throwCompilerError'));
             } catch (RuntimeException $e) {
                 return false;
             }
         } else {
             $fs->sh($command);
         }
     }
     // Setting current file to null
     $this->currentFile = null;
     return file_get_contents($cssFile);
 }
開發者ID:xfifix,項目名稱:Jenkins-Khan,代碼行數:34,代碼來源:sfLESS.class.php


注:本文中的sfFilesystem::sh方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。