本文整理汇总了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
);
}
示例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);
}
示例3: execute
public function execute()
{
$compiledPath = Doctrine_Core::compile($this->getArgument('compiled_path'), $this->getArgument('drivers', array()));
$this->notify('Compiled Doctrine successfully to: ' . $compiledPath);
}