Пример #1
0
 */
const DSP_DEBUG = false;
/**
 * @type bool Global PHP-ERROR flag: If true, PHP-ERROR will be utilized if available. See https://github.com/JosephLenton/PHP-Error for more info.
 */
const DSP_DEBUG_PHP_ERROR = false;
$_class = 'DreamFactory\\Platform\\Yii\\Components\\Platform' . ('cli' == PHP_SAPI ? 'Console' : 'Web') . 'Application';
/**
 * Debug-level output based on constant value above
 * For production mode, you'll want to set the above constants to FALSE
 * Get this turned on before anything is loaded
 */
if (DSP_DEBUG) {
    ini_set('display_errors', true);
    ini_set('error_reporting', -1);
    defined('YII_DEBUG') or define('YII_DEBUG', true);
    defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
}
//	Load up composer...
$_autoloader = (require_once __DIR__ . '/../vendor/autoload.php');
//	Load up Yii if it's not been already
if (!class_exists('\\Yii', false)) {
    require_once __DIR__ . '/../vendor/dreamfactory/yii/framework/yiilite.php';
}
//  php-error utility
if (DSP_DEBUG_PHP_ERROR && function_exists('reportErrors')) {
    reportErrors();
}
//	Create the application and run. This doe not return until the request is complete.
Pii::run(__DIR__, $_autoloader, $_class);
Пример #2
0
//  Start path given or this file's directory
$_path = __DIR__;
while (true) {
    $_path = rtrim($_path, ' /');
    if (file_exists($_path . '/vendor/autoload.php')) {
        break;
    }
    if (file_exists($_path . '/.dreamfactory.php') && is_dir($_path . '/storage/.private')) {
        break;
    }
    //  Too low, go up a level
    $_path = dirname($_path);
    //	If we get to the root, ain't no DSP...
    if ('/' == $_path || empty($_path)) {
        $_path = false;
        break;
    }
}
if (false === $_path) {
    throw new RuntimeException('DreamFactory installation not found. Cannot load app.');
}
/** @noinspection PhpIncludeInspection */
$_autoloader = (require $_path . '/vendor/autoload.php');
/** @noinspection PhpIncludeInspection */
require $_path . '/vendor/dreamfactory/yii/framework/yiilite.php';
//  Comment both lines to disable debug mode
ini_set('display_errors', 1);
defined('YII_DEBUG') or define('YII_DEBUG', true);
//	Create the application but do not run...
Pii::run(__DIR__ . '/src', $_autoloader, 'DreamFactory\\Platform\\Yii\\Components\\PlatformWebApplication', $_path . '/config/web.php', false, false);