本文整理汇总了PHP中osCommerce\OM\Core\OSCOM::configExists方法的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM::configExists方法的具体用法?PHP OSCOM::configExists怎么用?PHP OSCOM::configExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osCommerce\OM\Core\OSCOM
的用法示例。
在下文中一共展示了OSCOM::configExists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hasAccess
public static function hasAccess($application)
{
if (OSCOM::configExists('offline') && OSCOM::getConfig('offline') == 'true' && $application != 'Offline') {
return false;
}
return true;
}
示例2: initialize
public static function initialize()
{
Registry::set('MessageStack', new MessageStack());
Registry::set('Cache', new Cache());
Registry::set('PDO', PDO::initialize());
foreach (OSCOM::callDB('Shop\\GetConfiguration', null, 'Site') as $param) {
define($param['cfgKey'], $param['cfgValue']);
}
Registry::set('Session', Session::load('adminSid'));
Registry::get('Session')->start();
Registry::get('MessageStack')->loadFromSession();
Registry::set('Language', new Language());
if (!self::hasAccess(OSCOM::getSiteApplication())) {
Registry::get('MessageStack')->add('header', 'No access.', 'error');
OSCOM::redirect(OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()));
}
$application = 'osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
Registry::set('Application', new $application());
Registry::set('Template', new Template());
Registry::get('Template')->setApplication(Registry::get('Application'));
// HPDL move following checks elsewhere
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_no_default_currency'), 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
Registry::get('MessageStack')->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_uploads_disabled'), 'warning');
}
// check if Work directories are writable
$work_dirs = array();
foreach (array('Cache', 'CoreUpdate', 'Database', 'Logs', 'Session', 'Temp') as $w) {
if (!is_writable(OSCOM::BASE_DIRECTORY . 'Work/' . $w)) {
$work_dirs[] = $w;
}
}
if (!empty($work_dirs)) {
Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_work_directories_not_writable'), OSCOM::BASE_DIRECTORY . 'Work/', implode(', ', $work_dirs)), 'error');
}
if (!OSCOM::configExists('time_zone', 'OSCOM')) {
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_time_zone_not_defined'), 'warning');
}
if (!OSCOM::configExists('dir_fs_public', 'OSCOM') || !file_exists(OSCOM::getConfig('dir_fs_public', 'OSCOM'))) {
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_dir_fs_public_not_defined'), 'warning');
}
// check if the upload directory exists
if (is_dir(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload')) {
if (!is_writeable(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload')) {
Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_not_writable'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
}
} else {
Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_non_existant'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
}
}
示例3: _autoPrefixTables
protected function _autoPrefixTables($statement) {
if ( OSCOM::configExists('db_table_prefix') ) {
$statement = str_replace(':table_', OSCOM::getConfig('db_table_prefix'), $statement);
}
return $statement;
}