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


PHP Doctrine_Core::compile方法代码示例

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


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

示例1: execute

    public function execute($arguments = array(), $options = array())
    {
        $databaseManager = new sfDatabaseManager($this->configuration);
        $message = 'Compiling the Doctrine core';
        if ($options['driver']) {
            $message .= ' with driver(s) "' . implode('", "', $options['driver']) . '"';
        }
        $this->logSection('doctrine', $message);
        $target = Doctrine_Core::compile($arguments['target'], $options['driver']);
        $target = realpath($target);
        $targetPhp = var_export($target, true);
        foreach (array('sf_symfony_lib_dir', 'sf_lib_dir', 'sf_root_dir') as $name) {
            $path = sfConfig::get($name);
            if (0 === strpos($target, $path)) {
                $targetPhp = "sfConfig::get('{$name}')." . var_export(substr($target, strlen($path)), true);
                break;
            }
        }
        $this->log(<<<EOF

Doctrine compilation complete. Add the following code to ProjectConfiguration:

  public function setup()
  {
    // ...

    if (\$this instanceof sfApplicationConfiguration && !\$this->isDebug())
    {
      require_once {$targetPhp};
    }
  }

EOF
);
    }
开发者ID:cbsistem,项目名称:appflower_studio_playground,代码行数:35,代码来源:sfDoctrineCompileTask.class.php

示例2: execute

 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $databaseManager = new sfDatabaseManager($this->configuration);
     $compiledFile = sfConfig::get('sf_cache_dir') . '/doctrine.compiled.php';
     if (file_exists($compiledFile)) {
         $this->logSection('error', $compiledFile . ' already exists', null, 'ERROR');
         $this->logBlock('Run symfony:cache-clear first', 'INFO');
         return;
     }
     $drivers = array();
     foreach ($databaseManager->getNames() as $name) {
         $drivers[] = strtolower($databaseManager->getDatabase($name)->getDoctrineConnection()->getDriverName());
     }
     $drivers = array_unique($drivers);
     $this->logSection('compile', 'Included drivers: ' . implode(', ', $drivers));
     Doctrine_Core::compile($compiledFile, $drivers);
     $this->logSection('file+', $compiledFile);
 }
开发者ID:Phennim,项目名称:symfony1,代码行数:21,代码来源:sfDoctrineCompileTask.class.php

示例3: execute

 public function execute()
 {
     $compiledPath = Doctrine_Core::compile($this->getArgument('compiled_path'), $this->getArgument('drivers', array()));
     $this->notify('Compiled Doctrine successfully to: ' . $compiledPath);
 }
开发者ID:arenatournament,项目名称:geek-land,代码行数:5,代码来源:Compile.php


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