コード例 #1
0
ファイル: Loader.php プロジェクト: stonyyi/anahita
        break;
    }
}
define('WWW_ROOT', COMPOSER_ROOT . '/www');
if (!file_exists(WWW_ROOT)) {
    mkdir(WWW_ROOT, 0755);
}
chmod(WWW_ROOT, 0755);
if (!is_writable(WWW_ROOT)) {
    print 'PHP does not have write access to ' . WWW_ROOT . '. Makre sure the permissions are set correctly';
    exit(1);
}
$composerLoader->add('', COMPOSER_ROOT . '/tasks');
$composerLoader->add('Console\\', ANAHITA_ROOT);
//check the tasks folder for any class
$console = new Console\Application();
function include_tasks($directory)
{
    static $_includes_tasks;
    if (!$_includes_tasks) {
        $_includes_tasks = array();
    }
    if (!isset($_includes_tasks[$directory])) {
        if (is_dir($directory)) {
            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory));
            $tasks = array();
            $bootstraps = array();
            foreach ($files as $file) {
                if (strpos($file, '.task.php')) {
                    $tasks[] = $file->getPathName();
                } elseif (basename($file) == 'server.bootstrap.php') {
コード例 #2
0
<?php

// change directory to the application root
chdir(dirname(__DIR__));
$application = Console\Application::init(require 'config/application.config.php');
$serviceManager = $application->getServiceManager();
$entityManager = $serviceManager->get('EntityManager');
return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($entityManager);