Example #1
0
 public function getConfig()
 {
     return Yaml::parse(__DIR__ . '/../../../config/module.config.yml');
 }
Example #2
0
<?php

use Heartsentwined\Yaml\Yaml;
use Zend\Mvc\Application;
ini_set('display_errors', true);
chdir(__DIR__);
$previousDir = '.';
while (!file_exists('config/application.config.yml')) {
    $dir = dirname(getcwd());
    if ($previousDir === $dir) {
        throw new RuntimeException('Unable to locate "config/application.config.yml": ' . 'is DoctrineModule in a subdir of your application skeleton?');
    }
    $previousDir = $dir;
    chdir($dir);
}
if (!@(include_once __DIR__ . '/../vendor/autoload.php') && !@(include_once __DIR__ . '/../../../autoload.php')) {
    throw new RuntimeException('Error: vendor/autoload.php could not be found. Did you run php composer.phar install?');
}
$application = Application::init(Yaml::parse('config/application.config.yml'));
/* @var $cli \Symfony\Component\Console\Application */
$cli = $application->getServiceManager()->get('doctrine.cli');
$cli->run();