2009-09-02 04:14:10 +04:00
|
|
|
<?php
|
|
|
|
|
2010-01-22 19:42:48 +03:00
|
|
|
require_once 'Doctrine/Common/ClassLoader.php';
|
2009-09-02 04:14:10 +04:00
|
|
|
|
2009-12-21 14:06:27 +03:00
|
|
|
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
|
2009-11-05 01:16:22 +03:00
|
|
|
$classLoader->register();
|
2009-09-02 04:14:10 +04:00
|
|
|
|
2010-01-27 22:20:47 +03:00
|
|
|
$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
|
2009-12-21 20:38:14 +03:00
|
|
|
$configuration = new \Doctrine\Common\Cli\Configuration();
|
|
|
|
|
2010-01-27 22:20:47 +03:00
|
|
|
if (file_exists($configFile)) {
|
|
|
|
if ( ! is_readable($configFile)) {
|
|
|
|
trigger_error(
|
|
|
|
'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
require $configFile;
|
|
|
|
|
|
|
|
foreach ($GLOBALS as $configCandidate) {
|
|
|
|
if ($configCandidate instanceof \Doctrine\Common\Cli\Configuration) {
|
|
|
|
$configuration = $configCandidate;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-21 20:38:14 +03:00
|
|
|
$cli = new \Doctrine\Common\Cli\CliController($configuration);
|
2009-09-02 04:14:10 +04:00
|
|
|
$cli->run($_SERVER['argv']);
|