1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/bin/doctrine.php

29 lines
805 B
PHP
Raw Normal View History

<?php
require_once 'Doctrine/Common/ClassLoader.php';
2009-12-21 14:06:27 +03:00
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register();
$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
$configuration = new \Doctrine\Common\Cli\Configuration();
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;
}
}
}
$cli = new \Doctrine\Common\Cli\CliController($configuration);
$cli->run($_SERVER['argv']);