示例#1
0
 *              Once your application is created, next time you want to set it up:
 * 
 *              cd /$PATH/App
 *              php -f ./voodooist.php
 */
use Voodoo\Voodooist;
require_once dirname(__DIR__) . "/autoload.php";
date_default_timezone_set("America/New_York");
/**
 * By default we'll install the /App directory at the your application's root
 */
// Set to false if Voodoo wasn't installed via composer or is placed somewhere else
if (!defined("LOAD_VOODOO_WITH_COMPOSER")) {
    define("LOAD_VOODOO_WITH_COMPOSER", true);
}
// Assuming the Voodooo is in /vendor/voodoophp/voodoo when installed with Composer, we'll get back in the root
if (LOAD_VOODOO_WITH_COMPOSER) {
    $levelUp = 7;
    $appRootDir = __DIR__;
    while (max(0, --$levelUp)) {
        $appRootDir = dirname($appRootDir);
    }
} else {
    // the root dir
    $appRootDir = dirname(dirname(__DIR__));
}
try {
    Voodooist\Voodooist::create($appRootDir);
} catch (\Exception $e) {
    echo "EXCEPTION: " . $e->getMessage();
}
示例#2
0
<?php

/**
 * -----------------------------------------------------------------------------
 * VoodooPHP
 * -----------------------------------------------------------------------------
 * @author      Mardix (http://twitter.com/mardix)
 * @github      https://github.com/mardix/Voodoo
 * @package     VoodooPHP
 *
 * @copyright   (c) 2013 Mardix (http://github.com/mardix)
 * @license     MIT
 * -----------------------------------------------------------------------------
 *
 * @name        App/voodooist.php
 * @desc        This file run Voodooist to setup file based on your app.json file
 *              
 * @run         To execute this file, run the code below in your command line 
 *              cd /App
 *              php -f ./voodooist.php
 *
 */
require_once __DIR__ . "/bootstrap.php";
use Voodoo\Voodooist\Voodooist;
try {
    Voodooist::create(APP_ROOT_DIR, APP_CONFIG_DIRNAME);
} catch (\Exception $e) {
    echo "EXCEPTION: " . $e->getMessage();
}