예제 #1
0
파일: bootstrap.php 프로젝트: gudwin/extasy
    // SITEMAP constants
    define('SITEMAP_TABLE', 'sitemap');
    define('SITEMAP_SCRIPT_CHILD_TABLE', 'sitemap_scripts_child');
    define('SITEMAP_HISTORY_TABLE', 'sitemap_history');
    // Custom Config
    define('CCONFIG', 'cconfig');
    define('CCONFIG_SCHEMA_TABLE', 'custom_config_schema');
    define('CCONFIG_TABSHEETS_TABLE', 'custom_config_groups');
    define('CCONFIG_CONTROL_TABLE', 'custom_config_items');
    define('CCONFIG_CONTROLS_PATH', LIB_PATH . 'custom_config/controls/');
    //
    define('USERS', 'users');
    define('USERS_TABLE', 'users');
    // Core packages
    require_once LIB_PATH . 'kernel/extasy.php';
    //
    Trace::start();
    //
    Configure::write('Schedule.AutoloadScriptPath', APPLICATION_PATH . 'scheduleRestart.php');
    Configure::write('Exception.Handler', array('\\Extasy\\errors\\Handlers', 'onException'));
    Configure::write('Error.Handler', array('\\Extasy\\errors\\Handlers', 'onError'));
    Configure::write('FatalError.Handler', array('\\Extasy\\errors\\Handlers', 'onFatalError'));
    require_once LIB_PATH . 'ClassLocator.php';
    require_once LIB_PATH . 'Autoloader.php';
    \Extasy\Autoloader::startup();
    Debug::enable();
    \EventController::addRuntimeEventListener(\Extasy\Api\ApiOperation::EventName, function () {
        \Extasy\Audit\Api\ApiOperation::startUp();
        \Extasy\Users\UsersModule::initAPI();
    });
}
예제 #2
0
파일: Debug.php 프로젝트: gudwin/faid
/**
 *
 * Выводит кусок исходных кодов из файла вызвавшего функцию
 * @param int $fromErrorHandler устанавливайте значение данной переменной, только если она вызывается из промежуточной функции (например перехватчика ошибок)
 */
function displayCallerCode($fromErrorHandler = 0, $output = true)
{
    // Отображаем блок текста
    $trace = debug_backtrace();
    $caller = $trace[0 + $fromErrorHandler];
    $result = '';
    if (!isset($caller['file'])) {
        if (isset($trace[0 + $fromErrorHandler + 1])) {
            $caller = $trace[0 + $fromErrorHandler + 1];
        }
    }
    if (isset($caller['file'])) {
        $result = Debug::getFileSource($caller['file'], $caller['line']);
    } else {
        $result = '<hr/> <h2>Empty error source</h2> <hr/>';
    }
    if ($output) {
        print $result;
    }
    return $result;
}
예제 #3
0
<?php

use Faid\Configure\Configure;
use Extasy\CMS;
\Extasy\tests\ErrorHandlers::setUp();
\Faid\Debug\Debug::enable();
Configure::write(CMS::SaltConfigureKey, 'extasySalt');
Configure::write(\Extasy\Schedule\Runner::TimeoutConfigureKey, 30);
Configure::write(CMS::DashboardConfigureKey, array('url' => '/', 'Domain' => 'extasy'));
Configure::write(CMS::MainDomainConfigureKey, 'extasy');
// Собственно, имя проекта
define('SITE_NAME', 'Extasy Framework');
// Путь до закачиваемых пользователем файлов
define('FILE_PATH', EXTASY_PATH . 'tests/data/');
Configure::write(\Extasy\CMS::FileConfigureKey, EXTASY_PATH . 'tests/data/');
Configure::write(\Extasy\CMS::FilesHttpRoot, '/tests/data/');
Configure::write('UParser.tmp_dir', FILE_PATH);
Configure::write('Sitemap', ['Menu' => ['title' => 'Меню сайта', 'depth' => 2]]);
Configure::write(\UserAccount::ModelConfigureKey, ['table' => UserAccount::getTableName(), 'api' => ['profileUpdateFields' => 'name,surname'], 'fields' => ['id' => '\\Extasy\\Columns\\Index', 'login' => '\\Extasy\\Users\\Columns\\Login', 'password' => '\\Extasy\\Columns\\Password', 'rights' => '\\GrantColumn', 'time_access' => '\\Extasy\\Users\\Columns\\TimeAccess', 'registered' => '\\Extasy\\Columns\\Datetime', 'last_activity_date' => '\\Extasy\\Columns\\Datetime', 'confirmation_code' => '\\Extasy\\Users\\Columns\\ConfirmationCode', 'email_confirmation_code' => '\\Extasy\\Columns\\Input', 'email' => '\\Extasy\\Users\\Columns\\Email', 'new_email' => '\\Extasy\\Columns\\Input', 'name' => '\\Extasy\\Columns\\Input', 'surname' => '\\Extasy\\Columns\\Input', 'social_networks' => ['class' => '\\Extasy\\Users\\Columns\\SocialNetworks', 'parse_field' => 1], 'avatar' => ['class' => '\\Extasy\\Columns\\Image', 'base_dir' => 'users/', 'images' => '']]]);
// Режим отладки
define('DEBUG', 1);
$db = array('host' => 'localhost', 'user' => 'extasy', 'password' => '', 'database' => 'extasy');
$cacheConfig = array('Engine' => '\\Faid\\Cache\\Engine\\FileCache', 'FileCache' => array('BaseDir' => EXTASY_PATH . 'tests/data/'));
Configure::write('DB', $db);
Configure::write('SimpleCache', $cacheConfig);