本文整理汇总了PHP中OSC\OM\OSCOM::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM::getConfig方法的具体用法?PHP OSCOM::getConfig怎么用?PHP OSCOM::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSC\OM\OSCOM
的用法示例。
在下文中一共展示了OSCOM::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: basename
function __construct()
{
$this->lang = Registry::get('Language');
$this->code = get_class($this);
$this->group = basename(dirname(__FILE__));
$this->title = OSCOM::getDef('module_content_account_sage_pay_cards_title');
$this->description = OSCOM::getDef('module_content_account_sage_pay_cards_description');
if (defined('MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_STATUS')) {
$this->sort_order = MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_SORT_ORDER;
$this->enabled = MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_STATUS == 'True';
}
$this->public_title = OSCOM::getDef('module_content_account_sage_pay_cards_link_title');
$sage_pay_enabled = false;
if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('sage_pay_direct.php', explode(';', MODULE_PAYMENT_INSTALLED))) {
if (!class_exists('sage_pay_direct')) {
$this->lang->loadDefinitions('modules/payment/sage_pay_direct');
include OSCOM::getConfig('dir_root', 'Shop') . 'includes/modules/payment/sage_pay_direct.php';
}
$sage_pay_direct = new sage_pay_direct();
if ($sage_pay_direct->enabled) {
$sage_pay_enabled = true;
if (MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_SERVER == 'Test') {
$this->title .= ' [Test]';
$this->public_title .= ' (' . $sage_pay_direct->code . '; Test)';
}
}
}
if ($sage_pay_enabled !== true) {
$this->enabled = false;
$this->description = '<div class="secWarning">' . OSCOM::getDef('module_content_account_sage_pay_cards_error_main_module') . '</div>' . $this->description;
}
}
示例2: substr
function __construct($module, $user_id = null, $user_name = null)
{
global $PHP_SELF;
$this->lang = Registry::get('Language');
$module = HTML::sanitize(str_replace(' ', '', $module));
if (defined('MODULE_ACTION_RECORDER_INSTALLED') && tep_not_null(MODULE_ACTION_RECORDER_INSTALLED)) {
if (tep_not_null($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
if (!class_exists($module)) {
if (is_file(OSCOM::getConfig('dir_root', 'Shop') . 'includes/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1))) {
$this->lang->loadDefinitions('Shop/modules/action_recorder/' . $module);
include OSCOM::getConfig('dir_root', 'Shop') . 'includes/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1);
} else {
return false;
}
}
} else {
return false;
}
} else {
return false;
}
$this->_module = $module;
if (!empty($user_id) && is_numeric($user_id)) {
$this->_user_id = $user_id;
}
if (!empty($user_name)) {
$this->_user_name = $user_name;
}
$GLOBALS[$this->_module] = new $module();
$GLOBALS[$this->_module]->setIdentifier();
}
示例3: verify
public static function verify($plain, $hash)
{
$result = false;
if (strlen($plain) > 0 && strlen($hash) > 0) {
switch (static::getType($hash)) {
case 'phpass':
if (!class_exists('PasswordHash', false)) {
include OSCOM::getConfig('dir_root', 'Shop') . 'includes/third_party/PasswordHash.php';
}
$hasher = new \PasswordHash(10, true);
$result = $hasher->CheckPassword($plain, $hash);
break;
case 'salt':
// split apart the hash / salt
$stack = explode(':', $hash, 2);
if (count($stack) === 2) {
$result = md5($stack[1] . $plain) == $stack[0];
} else {
$result = false;
}
break;
default:
$result = password_verify($plain, $hash);
break;
}
}
return $result;
}
示例4: getMessage
function getMessage()
{
if (OSCOM::getConfig('store_sessions') == '') {
if (!is_dir(session_save_path())) {
return OSCOM::getDef('warning_session_directory_non_existent', ['session_path' => session_save_path()]);
} elseif (!FileSystem::isWritable(session_save_path())) {
return OSCOM::getDef('warning_session_directory_not_writeable', ['session_path' => session_save_path()]);
}
}
}
示例5: ht_table_click_jquery_edit_pages
function ht_table_click_jquery_edit_pages($values, $key)
{
global $PHP_SELF;
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$files_array = array();
if ($dir = @dir(OSCOM::getConfig('dir_root', 'Shop'))) {
while ($file = $dir->read()) {
if (!is_dir(OSCOM::getConfig('dir_root', 'Shop') . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$files_array[] = $file;
}
}
}
sort($files_array);
$dir->close();
}
$values_array = explode(';', $values);
$output = '';
foreach ($files_array as $file) {
$output .= HTML::checkboxField('ht_table_click_jquery_file[]', $file, in_array($file, $values_array)) . ' ' . HTML::output($file) . '<br />';
}
if (!empty($output)) {
$output = '<br />' . substr($output, 0, -6);
}
$output .= HTML::hiddenField('configuration[' . $key . ']', '', 'id="htrn_files"');
$output .= '<script>
function htrn_update_cfg_value() {
var htrn_selected_files = \'\';
if ($(\'input[name="ht_table_click_jquery_file[]"]\').length > 0) {
$(\'input[name="ht_table_click_jquery_file[]"]:checked\').each(function() {
htrn_selected_files += $(this).attr(\'value\') + \';\';
});
if (htrn_selected_files.length > 0) {
htrn_selected_files = htrn_selected_files.substring(0, htrn_selected_files.length - 1);
}
}
$(\'#htrn_files\').val(htrn_selected_files);
}
$(function() {
htrn_update_cfg_value();
if ($(\'input[name="ht_table_click_jquery_file[]"]\').length > 0) {
$(\'input[name="ht_table_click_jquery_file[]"]\').change(function() {
htrn_update_cfg_value();
});
}
});
</script>';
return $output;
}
示例6: load
public static function load($name = null)
{
$class_name = 'OSC\\OM\\Session\\' . OSCOM::getConfig('store_sessions');
if (!class_exists($class_name)) {
trigger_error('Session Handler \'' . $class_name . '\' does not exist, using default \'OSC\\OM\\Session\\File\'', E_USER_NOTICE);
$class_name = 'OSC\\OM\\Session\\File';
} elseif (!is_subclass_of($class_name, 'OSC\\OM\\SessionAbstract')) {
trigger_error('Session Handler \'' . $class_name . '\' does not extend OSC\\OM\\SessionAbstract, using default \'OSC\\OM\\Session\\File\'', E_USER_NOTICE);
$class_name = 'OSC\\OM\\Session\\File';
}
$obj = new $class_name();
if (!isset($name)) {
$name = 'oscomid';
}
$obj->setName($name);
return $obj;
}
示例7: execute
public function execute($parameters)
{
if (SESSION_BLOCK_SPIDERS == 'True') {
$user_agent = '';
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
}
if (!empty($user_agent)) {
foreach (file(OSCOM::getConfig('dir_root') . 'includes/spiders.txt') as $spider) {
if (!empty($spider)) {
if (strpos($user_agent, $spider) !== false) {
$parameters['can_start'] = false;
break;
}
}
}
}
}
}
示例8: start
/**
* Verify an existing session ID and create or resume the session if the existing session ID is valid
*
* @return boolean
*/
public function start()
{
$OSCOM_Cookies = Registry::get('Cookies');
// this class handles session.use_strict_mode already
if ((int) ini_get('session.use_strict_mode') === 1) {
ini_set('session.use_strict_mode', 0);
}
if (parse_url(OSCOM::getConfig('http_server'), PHP_URL_SCHEME) == 'https') {
if ((int) ini_get('session.cookie_secure') === 0) {
ini_set('session.cookie_secure', 1);
}
}
if ((int) ini_get('session.cookie_httponly') === 0) {
ini_set('session.cookie_httponly', 1);
}
if ((int) ini_get('session.use_only_cookies') !== 1) {
ini_set('session.use_only_cookies', 1);
}
$session_can_start = true;
Registry::get('Hooks')->call('Session', 'StartBefore', ['can_start' => &$session_can_start]);
session_set_cookie_params(0, $OSCOM_Cookies->getPath(), $OSCOM_Cookies->getDomain(), (bool) ini_get('session.cookie_secure'), (bool) ini_get('session.cookie_httponly'));
if (isset($_GET[$this->name]) && ($this->force_cookies || !(bool) preg_match('/^[a-zA-Z0-9,-]+$/', $_GET[$this->name]) || !$this->exists($_GET[$this->name]))) {
unset($_GET[$this->name]);
}
if (isset($_POST[$this->name]) && ($this->force_cookies || !(bool) preg_match('/^[a-zA-Z0-9,-]+$/', $_POST[$this->name]) || !$this->exists($_POST[$this->name]))) {
unset($_POST[$this->name]);
}
if (isset($_COOKIE[$this->name]) && (!(bool) preg_match('/^[a-zA-Z0-9,-]+$/', $_COOKIE[$this->name]) || !$this->exists($_COOKIE[$this->name]))) {
$OSCOM_Cookies->del($this->name, $OSCOM_Cookies->getPath(), $OSCOM_Cookies->getDomain(), (bool) ini_get('session.cookie_secure'), (bool) ini_get('session.cookie_httponly'));
}
if ($this->force_cookies === false) {
if (isset($_GET[$this->name]) && (!isset($_COOKIE[$this->name]) || $_COOKIE[$this->name] != $_GET[$this->name])) {
session_id($_GET[$this->name]);
} elseif (isset($_POST[$this->name]) && (!isset($_COOKIE[$this->name]) || $_COOKIE[$this->name] != $_POST[$this->name])) {
session_id($_POST[$this->name]);
}
}
if ($session_can_start === true && session_start()) {
Registry::get('Hooks')->call('Session', 'StartAfter');
return true;
}
return false;
}
示例9: substr
function cfg_modules()
{
global $PHP_SELF;
$this->lang = Registry::get('Language');
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$directory = OSCOM::getConfig('dir_root') . 'includes/modules/cfg_modules';
if ($dir = @dir($directory)) {
while ($file = $dir->read()) {
if (!is_dir($directory . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$class = substr($file, 0, strrpos($file, '.'));
$this->lang->loadDefinitions('modules/cfg_modules/' . pathinfo($file, PATHINFO_FILENAME));
include OSCOM::getConfig('dir_root') . 'includes/modules/cfg_modules/' . $class . '.php';
$m = new $class();
$this->_modules[] = array('code' => $m->code, 'directory' => $m->directory, 'language_directory' => $m->language_directory, 'key' => $m->key, 'title' => $m->title, 'template_integration' => $m->template_integration, 'site' => $m->site);
}
}
}
}
}
示例10: getOutput
function getOutput()
{
global $PHP_SELF;
$OSCOM_MessageStack = Registry::get('MessageStack');
$secCheck_types = array('info', 'warning', 'error');
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$secmodules_array = array();
if ($secdir = @dir(OSCOM::getConfig('dir_root') . 'includes/modules/security_check/')) {
while ($file = $secdir->read()) {
if (!is_dir(OSCOM::getConfig('dir_root') . 'includes/modules/security_check/' . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$secmodules_array[] = $file;
}
}
}
sort($secmodules_array);
$secdir->close();
}
foreach ($secmodules_array as $secmodule) {
include OSCOM::getConfig('dir_root') . 'includes/modules/security_check/' . $secmodule;
$secclass = 'securityCheck_' . substr($secmodule, 0, strrpos($secmodule, '.'));
if (class_exists($secclass)) {
$secCheck = new $secclass();
if (!$secCheck->pass()) {
if (!in_array($secCheck->type, $secCheck_types)) {
$secCheck->type = 'info';
}
$OSCOM_MessageStack->add($secCheck->getMessage(), $secCheck->type, 'securityCheckModule');
}
}
}
if (!$OSCOM_MessageStack->exists('securityCheckModule')) {
$OSCOM_MessageStack->add(OSCOM::getDef('module_admin_dashboard_security_checks_success'), 'success', 'securityCheckModule');
}
$output = $OSCOM_MessageStack->get('securityCheckModule');
return $output;
}
示例11: register
protected function register($group, $hook, $action)
{
$group = basename($group);
$this->hooks[$this->site][$group][$hook][$action] = [];
$directory = OSCOM::getConfig('dir_root', 'Shop') . 'includes/Module/Hooks/' . $this->site . '/' . $group;
if (is_dir($directory)) {
if ($dir = new \DirectoryIterator($directory)) {
foreach ($dir as $file) {
if (!$file->isDot() && !$file->isDir() && $file->getExtension() == 'php' && $file->getBasename('.php') == $hook) {
$class = 'OSC\\OM\\Module\\Hooks\\' . $this->site . '\\' . $group . '\\' . $hook;
if (method_exists($class, $action)) {
$this->hooks[$this->site][$group][$hook][$action][] = $class;
}
}
}
}
}
$filter = ['site' => $this->site, 'group' => $group, 'hook' => $hook];
foreach (Apps::getModules('Hooks', null, $filter) as $k => $class) {
if (method_exists($class, $action)) {
$this->hooks[$this->site][$group][$hook][$action][] = $k;
}
}
}
示例12: loadDefinitions
public function loadDefinitions($group, $language_code = null, $scope = null)
{
$language_code = isset($language_code) && $this->exists($language_code) ? $language_code : $this->get('code');
if (!isset($scope)) {
$scope = 'global';
}
$site = OSCOM::getSite();
if (strpos($group, '/') !== false && preg_match('/^([A-Z][A-Za-z0-9-_]*)\\/(.*)$/', $group, $matches) === 1 && OSCOM::siteExists($matches[1])) {
$site = $matches[1];
$group = $matches[2];
}
$pathname = OSCOM::getConfig('dir_root', $site) . 'includes/languages/' . $this->get('directory', $language_code) . '/' . $group;
// legacy
if (is_file($pathname . '.php')) {
include $pathname . '.php';
return true;
}
$pathname .= '.txt';
if ($language_code != 'en') {
call_user_func([$this, __FUNCTION__], $group, 'en', $scope);
}
$defs = $this->getDefinitions($group, $language_code, $pathname);
$this->injectDefinitions($defs, $scope);
}
示例13: getResponse
/**
* @param array $parameters url, headers, parameters, method, verify_ssl, cafile, certificate, proxy
*/
public static function getResponse(array $parameters)
{
$parameters['server'] = parse_url($parameters['url']);
if (!isset($parameters['server']['port'])) {
$parameters['server']['port'] = $parameters['server']['scheme'] == 'https' ? 443 : 80;
}
if (!isset($parameters['server']['path'])) {
$parameters['server']['path'] = '/';
}
if (isset($parameters['server']['user']) && isset($parameters['server']['pass'])) {
$parameters['headers'][] = 'Authorization: Basic ' . base64_encode($parameters['server']['user'] . ':' . $parameters['server']['pass']);
}
unset($parameters['url']);
if (!isset($parameters['headers']) || !is_array($parameters['headers'])) {
$parameters['headers'] = [];
}
if (!isset($parameters['method'])) {
if (isset($parameters['parameters'])) {
$parameters['method'] = 'post';
} else {
$parameters['method'] = 'get';
}
}
$curl = curl_init($parameters['server']['scheme'] . '://' . $parameters['server']['host'] . $parameters['server']['path'] . (isset($parameters['server']['query']) ? '?' . $parameters['server']['query'] : ''));
$curl_options = [CURLOPT_PORT => $parameters['server']['port'], CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_FORBID_REUSE => true, CURLOPT_FRESH_CONNECT => true, CURLOPT_ENCODING => '', CURLOPT_FOLLOWLOCATION => false];
if (!empty($parameters['headers'])) {
$curl_options[CURLOPT_HTTPHEADER] = $parameters['headers'];
}
if ($parameters['server']['scheme'] == 'https') {
$verify_ssl = defined('OSCOM_HTTP_VERIFY_SSL') && OSCOM_HTTP_VERIFY_SSL === 'True' ? true : false;
if (isset($parameters['verify_ssl']) && is_bool($parameters['verify_ssl'])) {
$verify_ssl = $parameters['verify_ssl'];
}
if ($verify_ssl === true) {
$curl_options[CURLOPT_SSL_VERIFYPEER] = true;
$curl_options[CURLOPT_SSL_VERIFYHOST] = 2;
} else {
$curl_options[CURLOPT_SSL_VERIFYPEER] = false;
$curl_options[CURLOPT_SSL_VERIFYHOST] = false;
}
if (!isset($parameters['cafile'])) {
$parameters['cafile'] = OSCOM::getConfig('dir_root', 'Shop') . 'includes/cacert.pem';
}
if (is_file($parameters['cafile'])) {
$curl_options[CURLOPT_CAINFO] = $parameters['cafile'];
}
if (isset($parameters['certificate'])) {
$curl_options[CURLOPT_SSLCERT] = $parameters['certificate'];
}
}
if ($parameters['method'] == 'post') {
if (!isset($parameters['parameters'])) {
$parameters['parameters'] = '';
}
$curl_options[CURLOPT_POST] = true;
$curl_options[CURLOPT_POSTFIELDS] = $parameters['parameters'];
}
$proxy = defined('OSCOM_HTTP_PROXY') ? OSCOM_HTTP_PROXY : '';
if (isset($parameters['proxy'])) {
$proxy = $parameters['proxy'];
}
if (!empty($proxy)) {
$curl_options[CURLOPT_HTTPPROXYTUNNEL] = true;
$curl_options[CURLOPT_PROXY] = $proxy;
}
curl_setopt_array($curl, $curl_options);
$result = curl_exec($curl);
if ($result === false) {
trigger_error(curl_error($curl));
curl_close($curl);
return false;
}
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$headers = trim(substr($result, 0, $header_size));
$body = substr($result, $header_size);
curl_close($curl);
if ($http_code == 301 || $http_code == 302) {
if (!isset($parameters['redir_counter']) || $parameters['redir_counter'] < 6) {
if (!isset($parameters['redir_counter'])) {
$parameters['redir_counter'] = 0;
}
$matches = [];
preg_match('/(Location:|URI:)(.*?)\\n/i', $headers, $matches);
$redir_url = trim(array_pop($matches));
$parameters['redir_counter']++;
$redir_params = ['url' => $redir_url, 'method' => $parameters['method'], 'redir_counter', $parameters['redir_counter']];
$body = static::getResponse($redir_params);
}
}
return $body;
}
示例14:
<?php
/**
* osCommerce Online Merchant
*
* @copyright (c) 2016 osCommerce; https://www.oscommerce.com
* @license MIT; https://www.oscommerce.com/license/mit.txt
*/
use OSC\OM\HTML;
use OSC\OM\OSCOM;
require 'includes/application_top.php';
if (OSCOM::hasSitePage()) {
if (OSCOM::isRPC() === false) {
$page_file = OSCOM::getSitePageFile();
if (empty($page_file) || !is_file($page_file)) {
$page_file = OSCOM::getConfig('dir_root') . 'includes/error_documents/404.php';
}
if (OSCOM::useSiteTemplateWithPageFile()) {
include $oscTemplate->getFile('template_top.php');
}
include $page_file;
if (OSCOM::useSiteTemplateWithPageFile()) {
include $oscTemplate->getFile('template_bottom.php');
}
}
goto main_sub3;
}
// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$Qcheck = $OSCOM_Db->prepare('select products_id from :table_products_to_categories where categories_id = :categories_id limit 1');
示例15: isset
?>
</div>
<?php
echo HTML::inputField('banners_image_local', isset($bInfo->banners_image) ? $bInfo->banners_image : '');
?>
</div>
</div>
<div class="form-group">
<label for="banners_image_target"><?php
echo OSCOM::getDef('text_banners_image_target');
?>
</label>
<div class="input-group">
<div class="input-group-addon"><?php
echo OSCOM::getConfig('dir_root', 'Shop') . 'images/';
?>
</div>
<?php
echo HTML::inputField('banners_image_target');
?>
</div>
</div>
<div class="form-group">
<label for="banners_html_text"><?php
echo OSCOM::getDef('text_banners_html_text');
?>
</label>
<?php
echo HTML::textareaField('banners_html_text', '60', '5', $bInfo->banners_html_text);