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


PHP OS::run方法代码示例

本文整理汇总了PHP中OS::run方法的典型用法代码示例。如果您正苦于以下问题:PHP OS::run方法的具体用法?PHP OS::run怎么用?PHP OS::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OS的用法示例。


在下文中一共展示了OS::run方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 public function update()
 {
     if (isset($this->config['build'])) {
         OS::run('cd ' . OS::bashize($this->directory) . ';git pull');
         $this->readConfig();
     }
 }
开发者ID:RemiFabre,项目名称:deps,代码行数:7,代码来源:Package.php

示例2: run

 public function run(array $arguments)
 {
     foreach ($arguments as $dep) {
         echo "* Removing {$dep}...\n";
         $dir = $this->deps->getPackageDirectory($dep);
         OS::run("rm -rf {$dir}");
     }
     return true;
 }
开发者ID:Rhoban,项目名称:deps,代码行数:9,代码来源:RemoveCommand.php

示例3: run

 public function run(array $arguments)
 {
     $json = $this->deps->nearestJson();
     $linkDir = dirname($json);
     $package = new Package(dirname($json));
     $name = $package->getName();
     if (!$name) {
         echo "Error: no name for package\n";
     } else {
         echo "* Linking package {$name} to {$linkDir}...\n";
         $dir = $this->deps->getPackageDirectory($package->getName());
         if (is_dir($dir)) {
             OS::run("rm -rf {$dir}");
         }
         OS::run("ln -s {$linkDir} {$dir}");
     }
 }
开发者ID:RemiFabre,项目名称:deps,代码行数:17,代码来源:LinkCommand.php

示例4: run

 public function run(array $arguments)
 {
     $json = $this->deps->nearestJson();
     $linkDir = dirname($json);
     $package = new Package(dirname($json));
     $name = $package->getName();
     if (!$name) {
         echo "Error: no name for package\n";
     } else {
         echo "Do you want to create symlink from {$name} to {$linkDir}? (yes/no)\n";
         $l = readline();
         if (trim($l) == 'yes') {
             echo "* Linking package {$name} to {$linkDir}...\n";
             $dir = $this->deps->getPackageDirectory($package->getName());
             if (is_dir($dir)) {
                 OS::run("rm -rf {$dir}");
             }
             OS::run("ln -s {$linkDir} {$dir}");
         } else {
             echo "Aborting.\n";
         }
     }
 }
开发者ID:Rhoban,项目名称:deps,代码行数:23,代码来源:LinkCommand.php

示例5: install

 public function install($dep, $rebuildDeps = true)
 {
     if (isset($this->installed[$dep])) {
         return;
     }
     $this->installed[$dep] = true;
     if (!$this->hasPackage($dep)) {
         Terminal::info("* Installing {$dep}...\n");
         $target = $this->getPackageDirectory($dep);
         if (is_dir($target)) {
             OS::run("rm -rf {$target}");
         }
         $btarget = OS::bashize($target);
         $remotes = $this->remotes->getRemotes();
         $addr = $remotes[$this->remotes->getCurrent()];
         $addr = sprintf($addr, $dep);
         $return = OS::run("git clone --depth=1 {$addr} {$btarget}");
         if ($return != 0) {
             OS::run("rm -rf {$target}");
             throw new \Exception("Unable to install package {$dep}");
         }
         $package = new Package($target);
         if (!$package->hasConfig()) {
             OS::run("rm -rf {$btarget}");
             throw new \Exception("{$dep} doesn't look like a deps package (no deps.json)");
         }
         $package->updateRemotes($this->remotes, true);
         $this->packages[$package->getName()] = $package;
     } else {
         $this->update($dep);
         $package = $this->getPackage($dep);
     }
     $package->readConfig();
     foreach ($package->getDependencies() as $sdep) {
         if ($rebuildDeps) {
             $this->install($sdep);
         } else {
             if (!$this->hasPackage($sdep)) {
                 $this->install($sdep);
             }
         }
     }
     $this->build($dep);
 }
开发者ID:Rhoban,项目名称:deps,代码行数:44,代码来源:Deps.php

示例6: run

 public function run(array $arguments)
 {
     Terminal::info("* Updating deps from git...\n");
     $dir = $this->deps->getDirectory();
     OS::run("cd {$dir}; git pull");
 }
开发者ID:Rhoban,项目名称:deps,代码行数:6,代码来源:SelfUpdateCommand.php

示例7: update

 public function update(Remotes $remotes)
 {
     $branch = $this->getBranch();
     $this->updateRemotes($remotes);
     $current = $remotes->getCurrent();
     if (OS::run('cd ' . OS::bashize($this->directory) . ";git pull {$current} {$branch}") != 0) {
         throw new \Exception('Update of ' . $this->getName() . ' failed');
     } else {
         Terminal::success('Updated ' . $this->getName() . "\n");
     }
     OS::run('cd ' . OS::bashize($this->directory) . ";git branch -u {$current}/{$branch}");
     $this->readConfig();
 }
开发者ID:Rhoban,项目名称:deps,代码行数:13,代码来源:Package.php

示例8: install

 public function install($dep)
 {
     if (!$this->hasPackage($dep)) {
         echo "* Installing {$dep}...\n";
         $target = $this->getPackageDirectory($dep);
         if (is_dir($target)) {
             OS::run("rm -rf {$target}");
         }
         $btarget = OS::bashize($target);
         $return = OS::run("git clone --depth=1 https://github.com/{$dep} {$btarget}");
         if ($return != 0) {
             OS::run("rm -rf {$target}");
             throw new \Exception("Unable to install package {$dep}");
         }
         $package = new Package($target);
         $this->packages[$package->getName()] = $package;
     } else {
         $this->update($dep);
         $package = $this->getPackage($dep);
     }
     $package->readConfig();
     foreach ($package->getDependencies() as $sdep) {
         $this->install($sdep);
     }
     $this->build($dep);
 }
开发者ID:RemiFabre,项目名称:deps,代码行数:26,代码来源:Deps.php


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