1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/bin/doctrine.php
2010-03-24 02:37:45 +00:00

31 lines
849 B
PHP

<?php
require_once 'Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register();
$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
$configuration = null;
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;
}
}
}
$configuration = ($configuration) ?: new \Doctrine\Common\CLI\Configuration();
$cli = new \Doctrine\Common\CLI\CLIController($configuration);
$cli->run($_SERVER['argv']);