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


PHP GeneratorConfig::getBuildConnections方法代码示例

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


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

示例1: main

 /**
  * Load the sql file and then execute it
  *
  * @throws BuildException
  */
 public function main()
 {
     $conf = new GeneratorConfig();
     $conf->setBuildProperties($this->getProject()->getProperties());
     $this->setBuildConnections($conf->getBuildConnections());
     if ($this->sqldbmap === null || $this->getSqlDbMap()->exists() === false) {
         throw new BuildException("You haven't provided an sqldbmap, or " . "the one you specified doesn't exist: " . $this->sqldbmap->getPath());
     }
     if ($this->url === null) {
         throw new BuildException("DSN url attribute must be set!");
     }
     // get an ordered list of SQL files to execute
     $databases = $this->getFilesToExecute();
     $this->log(sprintf('Reading SQL files...'));
     foreach ($databases as $database => $files) {
         $statements[$database] = array();
         foreach ($files as $fileName) {
             $fullFileName = $this->srcDir ? $this->srcDir . DIRECTORY_SEPARATOR . $fileName : $fileName;
             if (file_exists($fullFileName)) {
                 $this->log(sprintf('  Loading statements from "%s"', $fullFileName));
                 $fileStatements = PropelSQLParser::parseFile($fullFileName);
                 $this->log(sprintf('    %d statements to execute', count($fileStatements)), Project::MSG_VERBOSE);
                 $statements[$database] = array_merge($statements[$database], $fileStatements);
             } else {
                 $this->log(sprintf('File "%s" in sqldbmap does not exist, skipping it.', $fullFileName));
             }
         }
     }
     $successfullStatements = 0;
     $this->log(sprintf('Executing SQL statements...'));
     foreach ($statements as $database => $statementList) {
         $successfullStatements += $this->insertDatabaseSqlFiles($database, $statementList);
     }
     $this->log(sprintf('SQL execution complete. %d statements successfully executed.', $successfullStatements));
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:40,代码来源:PropelSQLExec.php


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