当前位置: 首页>>代码示例>>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;未经允许,请勿转载。