Exemplo n.º 1
0
 /**
  * Plant the seed of life into Kisma!
  *
  * @param array $options
  *
  * @return bool
  */
 public static function conceive($options = array())
 {
     //	Set any passed in options...
     if (is_callable($options)) {
         $options = call_user_func($options);
     }
     //	Set any application-level options passed in
     static::$_options = Option::merge(static::$_options, $options);
     //	Register our faux-destructor
     if (false === ($_conceived = static::get(CoreSettings::CONCEPTION))) {
         \register_shutdown_function(function ($eventName = KismaEvents::DEATH) {
             \Kisma::__sleep();
             EventManager::trigger($eventName);
         });
         //	Try and detect the framework being used...
         Detector::framework();
         //	We done baby!
         static::set(CoreSettings::CONCEPTION, true);
         if (null === static::get(CoreSettings::AUTO_LOADER) && class_exists('\\ComposerAutoloaderInit', false)) {
             static::set(CoreSettings::AUTO_LOADER, \ComposerAutoloaderInit::getLoader());
         }
         //	And let the world know we're alive
         EventManager::trigger(KismaEvents::BIRTH);
     }
     //	Load any session data...
     static::__wakeup();
     return $_conceived;
 }
Exemplo n.º 2
0
 public function testGenerateUnique()
 {
     \Kisma::set('debug.kisma.core.utility.hasher::generate_unique', true);
     $_hash1 = Hasher::generateUnique();
     $_hash2 = Hasher::generateUnique('*****@*****.**');
     $_hash3 = Hasher::generateUnique();
     $_hash4 = Hasher::generateUnique('*****@*****.**');
     $this->assertTrue($_hash1 != $_hash3 && $_hash2 != $_hash4);
 }
Exemplo n.º 3
0
 /**
  * Extensible framework sniffer.
  * Subclass and add a YourClass::sniff_[framework]() method.
  *
  * @param string $path
  */
 public static function framework($path = null)
 {
     foreach (\Kisma\Core\Enums\PhpFrameworks::getDefinedConstants() as $_constant => $_value) {
         $_thisClass = get_called_class();
         $_method = 'sniff_' . $_value;
         if (method_exists($_thisClass, $_method) && call_user_func(array($_thisClass, $_method))) {
             \Kisma::set('app.framework', $_value);
             //				Log::debug( 'PHP framework detected: ' . $_constant . ' (' . $_value . ')' );
             switch ($_constant) {
                 case \Kisma\Core\Enums\PhpFrameworks::Yii:
                     /**
                      * Pull in all the parameters from the Yii app into the bag...
                      */
                     foreach (\Yii::app()->getParams()->toArray() as $_parameterName => $_parameterValue) {
                         \Kisma::set($_parameterName, $_parameterValue);
                     }
                     break;
             }
             return $_value;
         }
     }
 }
Exemplo n.º 4
0
 protected function _checkSystemState()
 {
     $_error = false;
     $_state = SystemManager::getSystemState();
     if (!$this->_activated && $_state != PlatformStates::INIT_REQUIRED) {
         $_state = PlatformStates::ADMIN_REQUIRED;
     }
     if (!empty($this->_remoteError)) {
         $_error = 'error=' . urlencode($this->_remoteError);
     }
     if (PlatformStates::READY == $_state) {
         $_defaultApp = Pii::getParam('dsp.default_app', static::DEFAULT_STARTUP_APP);
         //	Try local launchpad
         if (is_file(\Kisma::get('app.app_path') . $_defaultApp)) {
             $_defaultApp = rtrim($_defaultApp . Curl::urlSeparator($_defaultApp) . $_error, '?');
             $this->redirect($_defaultApp);
         }
         //            Log::notice(
         //                'No default application defined/found. Running launchpad...' .
         //                PHP_EOL .
         //                '==============================' .
         //                PHP_EOL .
         //                'Config dump:' .
         //                PHP_EOL .
         //                print_r( \Kisma::get( null ), true ) .
         //                '==============================' .
         //                PHP_EOL .
         //                '==============================' .
         //                PHP_EOL .
         //                'Params dump:' .
         //                PHP_EOL .
         //                print_r( Pii::params(), true ) .
         //                '==============================' .
         //                PHP_EOL
         //            );
         //	If we have no app, run the launchpad
         $this->redirect(static::DEFAULT_STARTUP_APP);
     } else {
         if (!$this->_handleAction($_state)) {
             Log::error('Invalid state "' . $_state . '" or no handler configured.');
         }
     }
 }
Exemplo n.º 5
0
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * bootstrap.php
 * Bootstrap script for PHPUnit tests
 */
$_basePath = dirname(__DIR__);
$_vendorPath = $_basePath . '/vendor';
if (!is_dir($_vendorPath)) {
    echo 'Please run composer install/update before running tests.';
    exit(1);
}
//	Composer
$_autoloader = (require $_basePath . '/vendor/autoload.php');
//	Load up Yii
require_once $_basePath . '/vendor/dreamfactory/yii/framework/yii.php';
//	Yii debug settings
defined(YII_DEBUG) or define(YII_DEBUG, true);
defined(YII_TRACE_LEVEL) or define(YII_TRACE_LEVEL, 3);
\Kisma::set('app.log_file', $_basePath . '/build/console.test.log');
$_config = (require __DIR__ . '/config/test.config.php');
//	Testing keys
if (file_exists(__DIR__ . '/config/keys.php')) {
    /** @noinspection PhpIncludeInspection */
    require_once __DIR__ . '/config/keys.php';
}
//	Create the application but don't run (false at the end)
$_app = DreamFactory\Yii\Utility\Pii::run($_basePath, $_autoloader, 'DreamFactory\\Platform\\Yii\\Components\\PlatformConsoleApplication', $_config, false, true, false);
Exemplo n.º 6
0
<?php

/**
 * This file is part of Kisma(tm).
 *
 * Kisma(tm) <https://github.com/kisma/kisma>
 * Copyright 2009-2014 Jerry Ablan <*****@*****.**>
 *
 * Kisma(tm) is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Kisma(tm) is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Kisma(tm).  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * autoload.php
 * Bootstrap loader for Kisma
 */
//	Initialize
require_once __DIR__ . '/Kisma.php';
\Kisma::conceive();
Exemplo n.º 7
0
Arquivo: Curl.php Projeto: kisma/kisma
 /**
  * Returns the validated URL that has been called to get here
  *
  * @param bool $includeQuery If true, query string is included
  * @param bool $includePath  If true, the uri path is included
  *
  * @return string
  */
 public static function currentUrl($includeQuery = true, $includePath = true)
 {
     //	Are we SSL? Check for load balancer protocol as well...
     $_port = intval(Option::get($_SERVER, 'HTTP_X_FORWARDED_PORT', Option::get($_SERVER, 'SERVER_PORT', 80)));
     $_protocol = Option::get($_SERVER, 'HTTP_X_FORWARDED_PROTO', 'http' . (Option::getBool($_SERVER, 'HTTPS') ? 's' : null)) . '://';
     $_host = Option::get($_SERVER, 'HTTP_X_FORWARDED_HOST', Option::get($_SERVER, 'HTTP_HOST', gethostname()));
     $_parts = parse_url($_protocol . $_host . Option::get($_SERVER, 'REQUEST_URI'));
     if ((empty($_port) || !is_numeric($_port)) && null !== ($_parsePort = Option::get($_parts, 'port'))) {
         $_port = @intval($_parsePort);
     }
     if (null !== ($_query = Option::get($_parts, 'query'))) {
         $_query = static::urlSeparator($_query) . http_build_query(explode('&', $_query));
     }
     if (false !== strpos($_host, ':') || $_protocol == 'https://' && $_port == 443 || $_protocol == 'http://' && $_port == 80) {
         $_port = null;
     } else {
         $_port = ':' . $_port;
     }
     if (false !== strpos($_host, ':')) {
         $_port = null;
     }
     $_currentUrl = $_protocol . $_host . $_port . (true === $includePath ? Option::get($_parts, 'path') : null) . (true === $includeQuery ? $_query : null);
     if (\Kisma::get('debug.curl.current_url')) {
         Log::debug('Parsed current URL to be: ' . $_currentUrl, $_parts);
     }
     return $_currentUrl;
 }
Exemplo n.º 8
0
<?php

/**
 * Var dumper
 */
$_cwd = getcwd();
$_home = dirname($_cwd);
$_vendor = $_home . '/vendor';
$_app = $_home . '/app';
$_models = $_app . '/models';
$_autoload = file_exists($_vendor . '/autoload.php') && is_readable($_vendor . '/autoload.php');
$_appRight = is_dir($_models);
$_html = null;
$_vars = \Kisma::get(null);
if (!empty($_vars)) {
    foreach ($_vars as $_key => $_value) {
        switch ($_value) {
            case false === $_value:
                $_value = '<strong>FALSE</strong>';
                break;
            case true === $_value:
                $_value = '<strong>TRUE</strong>';
                break;
            case null === $_value:
                $_value = '<strong>NULL</strong>';
                break;
            default:
            case is_string($_value):
                $_value = '' . $_value . '';
                break;
            case !is_scalar($_value):
Exemplo n.º 9
0
Arquivo: Log.php Projeto: kisma/kisma
 /**
  * Makes sure we have a log file name and path
  *
  * @deprecated in v0.2.20. To be removed in v0.3.0. Replaced by Monolog
  */
 protected static function _checkLogFile()
 {
     if (null !== static::$_logger) {
         return static::$_logFileValid = true;
     }
     if (empty(static::$_logFilePath)) {
         //	Try and figure out a good place to log...
         static::$_logFilePath = (\Kisma::get('app.log_path', \Kisma::get('app.base_path')) ?: dirname(getcwd())) . '/log';
     }
     if (!is_dir(static::$_logFilePath)) {
         if (false === @mkdir(static::$_logFilePath, 0777, true)) {
             error_log('Unable to create default log directory: ' . static::$_logFilePath);
             return static::$_logFileValid = false;
         }
     }
     if (empty(static::$_logFileName)) {
         static::$_logFileName = static::DEFAULT_LOG_FILE_NAME;
     }
     static::$_defaultLog = static::$_logFilePath . '/' . trim(static::$_logFileName, '/');
     static::$_logger = new Logger(static::DEFAULT_CHANNEL_NAME);
     static::$_logger->pushHandler(new StreamHandler(static::$_defaultLog));
     //	If we're in debug mode and these haven't been disabled, enable...
     if (\Kisma::get(CoreSettings::DEBUG)) {
         static::$_enableChromePhp = static::$_enableChromePhp ?: true;
         static::$_enableFirePhp = static::$_enableFirePhp ?: true;
     }
     //	Enable conditional handlers
     if (static::$_enableFirePhp) {
         static::$_logger->pushHandler(new FirePHPHandler());
     }
     if (static::$_enableChromePhp) {
         static::$_logger->pushHandler(new ChromePHPHandler());
     }
     return static::$_logFileValid = true;
 }
Exemplo n.º 10
0
    unset($_salts);
}
/**
 * Application Paths
 */
\Kisma::set(array('app.app_name' => $_appName, 'app.project_root' => $_basePath, 'app.vendor_path' => $_vendorPath, 'app.log_path' => $_logFilePath, 'app.log_file_name' => $_logFileName, 'app.install_type' => array($_installType => $_installName), 'app.fabric_hosted' => $_fabricHosted, 'app.doc_root' => $_docRoot));
/**
 * Database Caching
 */
$_dbCache = $_dbCacheEnabled ? array('class' => 'CDbCache', 'connectionID' => 'db', 'cacheTableName' => 'df_sys_cache', 'autoCreateCacheTable' => true) : null;
$_storageKey = \Kisma::get('platform.storage_key');
/**
 * Set up and return the common settings...
 */
if ($_fabricHosted) {
    $_storagePath = $_storageBasePath = LocalStorageTypes::FABRIC_STORAGE_BASE_PATH . '/' . $_storageKey;
    $_privatePath = \Kisma::get('platform.private_path');
    $_storagePath = $_storageBasePath . (version_compare(DSP_VERSION, '2.0.0', '<') ? '/blob' : null);
    $_identity = array('dsp.storage_id' => $_storageKey, 'dsp.private_storage_id' => \Kisma::get('platform.private_storage_key'));
} else {
    $_storagePath = $_storageBasePath = $_basePath . LocalStorageTypes::LOCAL_STORAGE_BASE_PATH;
    $_privatePath = $_basePath . '/storage/.private';
    $_identity = array('dsp.storage_id' => null, 'dsp.private_storage_id' => null);
}
//	Merge the common junk with specifics
$_instanceSettings = array_merge($_identity, array(LocalStorageTypes::STORAGE_BASE_PATH => $_storageBasePath, LocalStorageTypes::STORAGE_PATH => $_storagePath, LocalStorageTypes::PRIVATE_PATH => $_privatePath, LocalStorageTypes::LOCAL_CONFIG_PATH => $_privatePath . '/config', LocalStorageTypes::SNAPSHOT_PATH => $_privatePath . '/snapshots', LocalStorageTypes::APPLICATIONS_PATH => $_storagePath . '/applications', LocalStorageTypes::LIBRARY_PATH => $_storagePath . '/plugins', LocalStorageTypes::PLUGINS_PATH => $_storagePath . '/plugins', LocalStorageTypes::SWAGGER_PATH => $_storagePath . '/swagger'));
//	Keep these out of the global space
unset($_storageBasePath, $_storagePath, $_privatePath, $_identity, $_storageKey);
/** @noinspection PhpIncludeInspection */
return array_merge($_instanceSettings, array('base_path' => $_basePath, 'dsp.version' => DSP_VERSION, 'dsp_name' => \Kisma::get('platform.dsp_name'), 'dsp.auth_endpoint' => DEFAULT_INSTANCE_AUTH_ENDPOINT, 'dsp.fabric_hosted' => $_fabricHosted, 'dsp.no_persistent_storage' => false, 'cloud.endpoint' => DEFAULT_CLOUD_API_ENDPOINT, 'oauth.salt' => 'rW64wRUk6Ocs+5c7JwQ{69U{]MBdIHqmx9Wj,=C%S#cA%+?!cJMbaQ+juMjHeEx[dlSe%h%kcI', 'keys' => $_keys, 'dsp.allow_remote_logins' => true, 'dsp.allow_admin_remote_logins' => true, 'adminEmail' => DEFAULT_SUPPORT_EMAIL, 'dsp.service_config' => require __DIR__ . SERVICES_CONFIG_PATH, 'dsp.service_location_map' => array(), 'dsp.default_services' => array(array('api_name' => 'user', 'name' => 'User Login'), array('api_name' => 'system', 'name' => 'System Configuration'), array('api_name' => 'api_docs', 'name' => 'API Documentation')), 'dsp.install_type' => $_installType, 'dsp.install_name' => $_installName, 'dsp.restricted_verbs' => InstallationTypes::getRestrictedVerbs($_installType), 'dsp.default_app' => '/launchpad/index.html', 'dsp.confirm_invite_url' => '/' . $_defaultController . '/confirmInvite', 'dsp.confirm_register_url' => '/' . $_defaultController . '/confirmRegister', 'dsp.confirm_reset_url' => '/' . $_defaultController . '/confirmPassword', 'dsp.db_max_records_returned' => 1000, 'dsp.enable_profiler' => false, 'dsp.debug_level' => LoggingLevels::WARNING, 'dsp.enable_event_observers' => true, 'dsp.enable_rest_events' => true, 'dsp.enable_platform_events' => true, 'dsp.enable_event_scripts' => true, 'dsp.enable_user_scripts' => true, 'dsp.log_events' => true, 'dsp.log_all_events' => false, 'dsp.log_script_memory_usage' => false, 'dsp.log_cache_stats' => false, 'dsp.cache_stats_event' => 'system.config.read', 'login.remember_me_copy' => 'Remember Me'), $_dspSalts);
Exemplo n.º 11
0
//	Where the log files go and the name...
$_logFilePath = $_basePath . '/log';
$_logFileName = basename(\Kisma::get('app.log_file'));
//	Our app's name
$_appName = 'Portal Sandbox Test Suite';
/**
 * Aliases
 */
file_exists(__DIR__ . ALIASES_CONFIG_PATH) && (require __DIR__ . ALIASES_CONFIG_PATH);
/**
 * Application Paths
 */
\Kisma::set('app.app_name', $_appName);
\Kisma::set('app.doc_root', $_docRoot);
\Kisma::set('app.log_path', $_logFilePath);
\Kisma::set('app.vendor_path', $_vendorPath);
\Kisma::set('app.log_file_name', $_logFileName);
\Kisma::set('app.project_root', $_basePath);
/**
 * Database Caching
 */
$_dbCache = $_dbCacheEnabled ? array('class' => 'CDbCache', 'connectionID' => 'db', 'cacheTableName' => 'df_sys_cache', 'autoCreateCacheTable' => true) : null;
/**
 * Set up and return the common settings...
 */
if (Fabric::fabricHosted()) {
    $_instanceSettings = array('storage_base_path' => '/data/storage/' . \Kisma::get('platform.storage_key'), 'storage_path' => '/data/storage/' . \Kisma::get('platform.storage_key') . '/blob', 'private_path' => \Kisma::get('platform.private_path'), 'snapshot_path' => \Kisma::get('platform.private_path') . '/snapshots', 'applications_path' => '/data/storage/' . \Kisma::get('platform.storage_key') . '/blob/applications', 'library_path' => '/data/storage/' . \Kisma::get('platform.storage_key') . '/blob/lib', 'plugins_path' => '/data/storage/' . \Kisma::get('platform.storage_key') . '/blob/plugins', 'dsp_name' => \Kisma::get('platform.dsp_name'), 'dsp.storage_id' => \Kisma::get('platform.storage_key'), 'dsp.private_storage_id' => \Kisma::get('platform.private_storage_key'));
} else {
    $_instanceSettings = array('storage_base_path' => $_basePath . '/storage', 'storage_path' => $_basePath . '/storage', 'private_path' => $_basePath . '/storage/.private', 'snapshot_path' => $_basePath . '/storage/.private/snapshots', 'applications_path' => $_basePath . '/storage/applications', 'library_path' => $_basePath . '/storage/lib', 'plugins_path' => $_basePath . '/storage/plugins', 'dsp_name' => gethostname(), 'dsp.storage_id' => null, 'dsp.private_storage_id' => null);
}
return array_merge($_instanceSettings, array('base_path' => $_basePath, 'dsp.version' => DSP_VERSION, 'dsp.name' => $_instanceSettings['dsp_name'], 'dsp.auth_endpoint' => DEFAULT_INSTANCE_AUTH_ENDPOINT, 'cloud.endpoint' => DEFAULT_CLOUD_API_ENDPOINT, 'oauth.salt' => 'rW64wRUk6Ocs+5c7JwQ{69U{]MBdIHqmx9Wj,=C%S#cA%+?!cJMbaQ+juMjHeEx[dlSe%h%kcI', 'dsp.allow_remote_logins' => true, 'dsp.allow_admin_remote_logins' => true, 'adminEmail' => DEFAULT_SUPPORT_EMAIL, 'dsp.service_config' => require __DIR__ . SERVICES_CONFIG_PATH, 'dsp.service_location_map' => array(), 'dsp.default_services' => array(array('api_name' => 'user', 'name' => 'User Login'), array('api_name' => 'system', 'name' => 'System Configuration'), array('api_name' => 'api_docs', 'name' => 'API Documentation')), 'dsp.default_app' => '/launchpad/index.html', 'dsp.confirm_invite_url' => '/confirm_invite.html', 'dsp.confirm_register_url' => '/confirm_reg.html', 'dsp.confirm_reset_url' => '/confirm_reset.html', 'dsp.db_max_records_returned' => 1000, 'admin.resource_schema' => require __DIR__ . DEFAULT_ADMIN_RESOURCE_SCHEMA, 'admin.default_theme' => 'united'));
Exemplo n.º 12
0
 /**
  * Returns an array of standard values passed to all views
  *
  * @param null  $viewFile
  * @param array $additional
  *
  * @return array
  */
 protected static function _getBaseRenderPayload($viewFile = null, $additional = array())
 {
     $additional = array_merge($additional, \Kisma::get('view.defaults', array()));
     if (null !== $viewFile) {
         $additional = array_merge($additional, \Kisma::get('view.config.' . $viewFile, array()));
     }
     $_payload = array('app_name' => \Kisma::get('app.name'), 'app_root' => \Kisma::get('app.root'), 'app_version' => \Kisma::get('app.version'), 'page_date' => date('Y-m-d H:i:s'), 'vendor_path' => \Kisma::get('app.base_path') . '/vendor', 'navbar' => \Kisma::get('app.navbar'));
     return array_merge($_payload, $additional);
 }
Exemplo n.º 13
0
 /**
  * @covers Kisma::get
  */
 public function testGet()
 {
     $this->assertTrue(\Kisma::get('testSetOption'));
 }
Exemplo n.º 14
0
    }
    unset($_salts);
}
/**
 * Application Paths
 */
\Kisma::set(array('app.app_name' => $_appName, 'app.project_root' => $_basePath, 'app.vendor_path' => $_vendorPath, 'app.log_path' => $_logFilePath, 'app.log_file_name' => $_logFileName, 'app.install_type' => array($_installType => $_installName), 'app.fabric_hosted' => $_fabricHosted, 'app.doc_root' => $_docRoot));
/**
 * Database Caching
 */
$_dbCache = $_dbCacheEnabled ? array('class' => 'CDbCache', 'connectionID' => 'db', 'cacheTableName' => 'df_sys_cache', 'autoCreateCacheTable' => true) : null;
$_storageKey = \Kisma::get('platform.storage_key');
/**
 * Set up and return the common settings...
 */
if ($_fabricHosted) {
    $_storagePath = $_storageBasePath = LocalStorageTypes::FABRIC_STORAGE_BASE_PATH . '/' . $_storageKey;
    $_privatePath = \Kisma::get('platform.private_path');
    $_storagePath = $_storageBasePath . (version_compare(DSP_VERSION, '2.0.0', '<') ? '/blob' : null);
    $_identity = array('dsp.storage_id' => $_storageKey, 'dsp.private_storage_id' => \Kisma::get('platform.private_storage_key'), 'dsp_name' => \Kisma::get('platform.dsp_name'));
} else {
    $_storagePath = $_storageBasePath = $_basePath . LocalStorageTypes::LOCAL_STORAGE_BASE_PATH;
    $_privatePath = $_basePath . '/storage/.private';
    $_identity = array('dsp.storage_id' => null, 'dsp.private_storage_id' => null, 'dsp_name' => \Kisma::get('platform.host_name'));
}
//	Merge the common junk with specifics
$_instanceSettings = array_merge($_identity, array(LocalStorageTypes::STORAGE_BASE_PATH => $_storageBasePath, LocalStorageTypes::STORAGE_PATH => $_storagePath, LocalStorageTypes::PRIVATE_PATH => $_privatePath, LocalStorageTypes::LOCAL_CONFIG_PATH => $_privatePath . '/config', LocalStorageTypes::PRIVATE_CONFIG_PATH => $_privatePath . '/config', LocalStorageTypes::SNAPSHOT_PATH => $_privatePath . '/snapshots', LocalStorageTypes::APPLICATIONS_PATH => $_storagePath . '/applications', LocalStorageTypes::LIBRARY_PATH => $_storagePath . '/plugins', LocalStorageTypes::PLUGINS_PATH => $_storagePath . '/plugins', LocalStorageTypes::SWAGGER_PATH => $_storagePath . '/swagger'));
//	Keep these out of the global space
unset($_storageBasePath, $_storagePath, $_privatePath, $_identity, $_storageKey);
/** @noinspection PhpIncludeInspection */
return array_merge($_instanceSettings, array('platform.timestamp_format' => 'Y-m-d H:i:s', 'app.base_path' => $_basePath, 'app.private_path' => $_basePath . $_instanceSettings[LocalStorageTypes::PRIVATE_PATH], 'app.plugins_path' => $_basePath . $_instanceSettings[LocalStorageTypes::PLUGINS_PATH], 'app.enable_profiler' => false, 'app.debug_level' => LoggingLevels::WARNING, 'base_path' => $_basePath, 'dsp.version' => DSP_VERSION, 'dsp.auth_endpoint' => DEFAULT_INSTANCE_AUTH_ENDPOINT, 'dsp.fabric_hosted' => $_fabricHosted, 'dsp.no_persistent_storage' => false, 'cloud.endpoint' => DEFAULT_CLOUD_API_ENDPOINT, 'dsp.metadata_endpoint' => DEFAULT_METADATA_ENDPOINT, 'oauth.salt' => 'rW64wRUk6Ocs+5c7JwQ{69U{]MBdIHqmx9Wj,=C%S#cA%+?!cJMbaQ+juMjHeEx[dlSe%h%kcI', 'keys' => $_keys, 'dsp.allow_remote_logins' => false, 'dsp.allow_admin_remote_logins' => false, 'dsp.hpp_hosts' => array(), 'adminEmail' => DEFAULT_SUPPORT_EMAIL, 'dsp.service_config' => require __DIR__ . SERVICES_CONFIG_PATH, 'dsp.service_location_map' => array(), 'dsp.default_services' => array(array('api_name' => 'user', 'name' => 'User Login'), array('api_name' => 'system', 'name' => 'System Configuration'), array('api_name' => 'api_docs', 'name' => 'API Documentation')), 'dsp.install_type' => $_installType, 'dsp.install_name' => $_installName, 'dsp.restricted_verbs' => InstallationTypes::getRestrictedVerbs($_installType), 'dsp.default_app' => DEFAULT_ADMIN_APP_PATH . '/index.html', 'dsp.confirm_invite_url' => DEFAULT_ADMIN_APP_PATH . '/#/user-invite', 'dsp.confirm_register_url' => DEFAULT_ADMIN_APP_PATH . '/#/register-confirm', 'dsp.confirm_reset_url' => DEFAULT_ADMIN_APP_PATH . '/#/reset-password', 'dsp.db_max_records_returned' => 1000, 'dsp.db_time_format' => null, 'dsp.db_date_format' => null, 'dsp.db_datetime_format' => null, 'dsp.db_timestamp_format' => null, 'dsp.log_cors_info' => false, 'dsp.enable_event_observers' => true, 'dsp.enable_rest_events' => true, 'dsp.enable_platform_events' => true, 'dsp.enable_event_scripts' => true, 'dsp.enable_user_scripts' => true, 'dsp.log_events' => true, 'dsp.log_all_events' => false, 'dsp.log_script_memory_usage' => false, 'dsp.scripting.user_libraries' => array(), 'dsp.log_cache_stats' => false, 'dsp.cache_stats_event' => 'system.config.read', 'login.remember_me_copy' => 'Remember Me', 'dsp.chat_launchpad' => false, 'dsp.chat_admin' => true), $_dspSalts);
Exemplo n.º 15
0
 /**
  * Cleans up a trace array
  *
  * @param array $trace
  * @param int   $skipLines
  * @param null  $basePath
  *
  * @return null|string
  */
 protected static function _cleanTrace(array &$trace, $skipLines = null, $basePath = null)
 {
     $_trace = array();
     $_basePath = $basePath ?: \Kisma::get('app.base_path');
     //	Skip some lines
     if (!empty($skipLines) && count($trace) > $skipLines) {
         $trace = array_slice($trace, $skipLines);
     }
     foreach ($trace as $_index => $_code) {
         $_traceItem = array();
         Scalar::sins($trace[$_index], 'file', 'Unspecified');
         Scalar::sins($trace[$_index], 'line', 0);
         Scalar::sins($trace[$_index], 'function', 'Unspecified');
         $_traceItem['file_name'] = trim(str_replace(array($_basePath, "\t", "\r", "\n", PHP_EOL, 'phar://'), array(null, '    ', null, null, null, null), $trace[$_index]['file']));
         $_args = null;
         if (isset($_code['args']) && !empty($_code['args'])) {
             foreach ($_code['args'] as $_arg) {
                 if (is_object($_arg)) {
                     $_args .= get_class($_arg) . ', ';
                 } else {
                     if (is_array($_arg)) {
                         $_args .= '[array], ';
                     } else {
                         if (is_bool($_arg)) {
                             if ($_arg) {
                                 $_args .= 'true, ';
                             } else {
                                 $_args .= 'false, ';
                             }
                         } else {
                             if (is_numeric($_arg)) {
                                 $_args .= $_arg . ', ';
                             } else {
                                 if (is_scalar($_arg)) {
                                     $_args .= '"' . $_arg . '", ';
                                 } else {
                                     $_args .= '"' . gettype($_arg) . '", ';
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $_traceItem['line'] = $trace[$_index]['line'];
         if (isset($_code['type'])) {
             $_traceItem['function'] = (isset($_code['class']) ? $_code['class'] : null) . $_code['type'] . $_code['function'];
         } else {
             $_traceItem['function'] = $_code['function'];
         }
         $_traceItem['function'] .= '(' . ($_args ? ' ' . trim($_args, ', ') . ' ' : null) . ')';
         $_traceItem['index'] = $_index;
         $_trace[] = $_traceItem;
     }
     return $_trace;
 }