bundle.php 552 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php
/**
 * Small command line script to bundle Doctrine classes.
 */
if (count($argv) < 2) {
    echo "Usage: bundle.php <Doctrine basedir> <Target dir>";
    exit(1);
}

$doctrineBaseDir = $argv[1];
$targetDir = $argv[2];

set_include_path(get_include_path() . PATH_SEPARATOR . $doctrineBaseDir);

require_once 'Doctrine.php';
require_once 'Doctrine/Compiler.php';

romanb's avatar
romanb committed
18 19
spl_autoload_register(array('Doctrine', 'autoload'));

20 21 22 23 24 25 26 27
echo "Bundling classes ..." . PHP_EOL;

Doctrine_Compiler::compile($targetDir);

echo "Bundle complete." . PHP_EOL;

exit(0);
?>