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


PHP Builder::interpolate方法代碼示例

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


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

示例1: __construct

 /**
  * Set up the plugin, configure options, etc.
  * @param Builder $phpci
  * @param Build $build
  * @param array $options
  */
 public function __construct(Builder $phpci, Build $build, array $options = array())
 {
     $path = $phpci->buildPath;
     $this->phpci = $phpci;
     $this->build = $build;
     $this->directory = isset($options['directory']) ? $this->phpci->interpolate($options['directory']) : $path;
 }
開發者ID:ntoniazzi,項目名稱:PHPCI,代碼行數:13,代碼來源:Wipe.php

示例2: execute

 /**
  * Connects to PgSQL and runs a specified set of queries.
  * @return boolean
  */
 public function execute()
 {
     try {
         $opts = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
         $pdo = new PDO('pgsql:host=' . $this->host, $this->user, $this->pass, $opts);
         foreach ($this->queries as $query) {
             $pdo->query($this->phpci->interpolate($query));
         }
     } catch (\Exception $ex) {
         $this->phpci->logFailure($ex->getMessage());
         return false;
     }
     return true;
 }
開發者ID:nelsonyang0710,項目名稱:PHPCI,代碼行數:18,代碼來源:Pgsql.php

示例3: execute

 /**
  * Runs the shell command.
  */
 public function execute()
 {
     if (!defined('ENABLE_SHELL_PLUGIN') || !ENABLE_SHELL_PLUGIN) {
         throw new \Exception('The shell plugin is not enabled.');
     }
     $success = true;
     foreach ($this->commands as $command) {
         $command = $this->phpci->interpolate($command);
         if (!$this->phpci->executeCommand($command)) {
             $success = false;
         }
     }
     return $success;
 }
開發者ID:kukupigs,項目名稱:PHPCI,代碼行數:17,代碼來源:Shell.php

示例4: executeFile

 /**
  * @param string $query
  * @return boolean
  * @throws \Exception
  */
 protected function executeFile($query)
 {
     if (!isset($query['file'])) {
         throw new \Exception(Lang::get('import_file_key'));
     }
     $import_file = $this->phpci->buildPath . $this->phpci->interpolate($query['file']);
     if (!is_readable($import_file)) {
         throw new \Exception(Lang::get('cannot_open_import', $import_file));
     }
     $database = isset($query['database']) ? $this->phpci->interpolate($query['database']) : null;
     $import_command = $this->getImportCommand($import_file, $database);
     if (!$this->phpci->executeCommand($import_command)) {
         throw new \Exception(Lang::get('unable_to_execute'));
     }
     return true;
 }
開發者ID:seshurajup,項目名稱:PHPCI,代碼行數:21,代碼來源:Pgsql.php

示例5: executeFile

 /**
  * @param string $query
  * @return boolean
  * @throws \Exception
  */
 protected function executeFile($query)
 {
     if (!isset($query['file'])) {
         throw new \Exception("Import statement must contain a 'file' key");
     }
     $import_file = $this->phpci->buildPath . $this->phpci->interpolate($query['file']);
     if (!is_readable($import_file)) {
         throw new \Exception("Cannot open SQL import file: {$import_file}");
     }
     $database = isset($query['database']) ? $this->phpci->interpolate($query['database']) : null;
     $import_command = $this->getImportCommand($import_file, $database);
     if (!$this->phpci->executeCommand($import_command)) {
         throw new \Exception("Unable to execute SQL file");
     }
     return true;
 }
開發者ID:kukupigs,項目名稱:PHPCI,代碼行數:21,代碼來源:Mysql.php


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