/** * set database parameters and connect to it */ protected function __construct($aDbConf = false) { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); if (false === $aDbConf) { $this->_sHost = BX_DATABASE_HOST; $this->_sPort = BX_DATABASE_PORT; $this->_sSocket = BX_DATABASE_SOCK; $this->_sDbname = BX_DATABASE_NAME; $this->_sUser = BX_DATABASE_USER; $this->_sPassword = BX_DATABASE_PASS; } else { $this->_sHost = $aDbConf['host']; $this->_sPort = $aDbConf['port']; $this->_sSocket = $aDbConf['sock']; $this->_sDbname = $aDbConf['name']; $this->_sUser = $aDbConf['user']; $this->_sPassword = $aDbConf['pwd']; $this->_bErrorChecking = isset($aDbConf['error_checking']) ? $aDbConf['error_checking'] : true; } $this->_iCurrentResType = MYSQL_ASSOC; // connect to db automatically if (empty($GLOBALS['bx_db__rLink'])) { $this->connect(); $GLOBALS['gl_db_cache'] = array(); } else { $this->_rLink = $GLOBALS['bx_db__rLink']; } }
/** * Constructor */ public function __construct() { if (isset($GLOBALS['bxDolClasses']['BxDolInformer'])) { trigger_error('Multiple instances are not allowed for the BxDolInformer class.', E_USER_ERROR); } parent::__construct(); }
function __construct() { parent::__construct(); $this->aType2ClassCSS = array(BX_DOL_AUDIT_FAIL => 'fail', BX_DOL_AUDIT_WARN => 'warn', BX_DOL_AUDIT_UNDEF => 'undef', BX_DOL_AUDIT_OK => 'ok'); $this->aType2Title = array(BX_DOL_AUDIT_FAIL => _t('_sys_audit_title_fail'), BX_DOL_AUDIT_WARN => _t('_sys_audit_title_warn'), BX_DOL_AUDIT_UNDEF => _t('_sys_audit_title_undef'), BX_DOL_AUDIT_OK => _t('_sys_audit_title_ok')); $this->sMinPhpVer = '5.3.0'; $this->aPhpSettings = array('allow_url_fopen' => array('op' => '=', 'val' => true, 'type' => 'bool'), 'allow_url_include' => array('op' => '=', 'val' => false, 'type' => 'bool'), 'magic_quotes_gpc' => array('op' => '=', 'val' => false, 'type' => 'bool', 'warn' => 1), 'memory_limit' => array('op' => '>=', 'val' => 128 * 1024 * 1024, 'type' => 'bytes', 'unlimited' => -1), 'post_max_size' => array('op' => '>=', 'val' => 2 * 1024 * 1024, 'type' => 'bytes', 'warn' => 1), 'upload_max_filesize' => array('op' => '>=', 'val' => 2 * 1024 * 1024, 'type' => 'bytes', 'warn' => 1), 'register_globals' => array('op' => '=', 'val' => false, 'type' => 'bool'), 'safe_mode' => array('op' => '=', 'val' => false, 'type' => 'bool'), 'short_open_tag' => array('op' => '=', 'val' => true, 'type' => 'bool'), 'disable_functions' => array('op' => 'without', 'val' => 'shell_exec,eval,assert,phpinfo,getenv,ini_set,mail,fsockopen,chmod,parse_ini_file'), 'php module: mysql' => array('op' => 'module', 'val' => 'mysql'), 'php module: curl' => array('op' => 'module', 'val' => 'curl'), 'php module: gd' => array('op' => 'module', 'val' => 'gd'), 'php module: mbstring' => array('op' => 'module', 'val' => 'mbstring'), 'php module: json' => array('op' => 'module', 'val' => 'json'), 'php module: fileinfo' => array('op' => 'module', 'val' => 'fileinfo'), 'php module: zip' => array('op' => 'module', 'val' => 'zip'), 'php module: openssl' => array('op' => 'module', 'val' => 'openssl'), 'php module: exif' => array('op' => 'module', 'val' => 'exif')); $this->sMinMysqlVer = '4.1.2'; $this->aMysqlOptimizationSettings = array('key_buffer_size' => array('op' => '>=', 'val' => 128 * 1024, 'type' => 'bytes'), 'query_cache_limit' => array('op' => '>=', 'val' => 1000000), 'query_cache_size' => array('op' => '>=', 'val' => 16 * 1024 * 1024, 'type' => 'bytes'), 'query_cache_type' => array('op' => 'strcasecmp', 'val' => 'on'), 'max_heap_table_size' => array('op' => '>=', 'val' => 16 * 1024 * 1024, 'type' => 'bytes'), 'tmp_table_size' => array('op' => '>=', 'val' => 16 * 1024 * 1024, 'type' => 'bytes'), 'thread_cache_size ' => array('op' => '>', 'val' => 0)); $this->aOptimizationSettings = array('DB cache' => array('enabled' => 'sys_db_cache_enable', 'cache_engine' => 'sys_db_cache_engine', 'check_accel' => true), 'Page blocks cache' => array('enabled' => 'sys_pb_cache_enable', 'cache_engine' => 'sys_pb_cache_engine', 'check_accel' => true), 'Member menu cache' => array('enabled' => 'always_on', 'cache_engine' => 'sys_mm_cache_engine', 'check_accel' => true), 'Templates Cache' => array('enabled' => 'sys_template_cache_enable', 'cache_engine' => 'sys_template_cache_engine', 'check_accel' => true), 'CSS files cache' => array('enabled' => 'sys_template_cache_css_enable', 'cache_engine' => '', 'check_accel' => false), 'JS files cache' => array('enabled' => 'sys_template_cache_js_enable', 'cache_engine' => '', 'check_accel' => false), 'Compression for CSS/JS cache' => array('enabled' => 'sys_template_cache_compress_enable', 'cache_engine' => '', 'check_accel' => false)); $this->aRequiredApacheModules = array('rewrite_module' => 'mod_rewrite'); if (isset($_GET['action'])) { $sOutput = null; switch ($_GET['action']) { case 'audit_send_test_email': $sOutput = $this->sendTestEmail(); break; case 'phpinfo': ob_start(); phpinfo(); $sOutput = ob_get_clean(); break; case 'phpinfo_popup': $sUrlSelf = bx_js_string($_SERVER['PHP_SELF'], BX_ESCAPE_STR_APOS); $sUrlSelf = bx_append_url_params($sUrlSelf, array('action' => 'phpinfo')); $sOutput = '<iframe width="640" height="480" src="' . $sUrlSelf . '"></iframe>'; break; } if ($sOutput) { header('Content-type: text/html; charset=utf-8'); echo $sOutput; exit; } } }
/** * Constructor */ public function __construct() { parent::__construct(); $this->aZonesUrls = array(2 => BX_DIRECTORY_PATH_MODULES . "boonex/antispam/data/two-level-tlds", 3 => BX_DIRECTORY_PATH_MODULES . "boonex/antispam/data/three-level-tlds"); $this->oDb = BxDolDb::getInstance(); $this->initZones(); }
/** * constructor */ protected function __construct($aObject, $oStorage) { parent::__construct(); $this->_aObject = $aObject; $this->_oStorage = $oStorage; $this->_oDb = null; }
function __construct() { parent::__construct(); if (class_exists('BxDolDb') && BxDolDb::getInstance()) { $this->_aConfig['aLessConfig']['bx-page-width'] = getParam('main_div_width'); } }
public function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); }
public function __construct() { parent::__construct(); $this->oSession = BxDolSession::getInstance(); $this->sErrorCode = 'oauth_err_code'; $this->sErrorMessage = 'oauth_err_message'; }
function __construct($iTimeStart) { parent::__construct(); $this->oConfig = new BxProfilerConfig($GLOBALS['bx_profiler_module']); $this->oTemplate = new BxProfilerTemplate($this->oConfig); $this->oTemplateAdmin = BxDolStudioTemplate::getInstance(); $aCss = array('profiler.css', BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'jush/|jush.css'); $aJs = array('jquery.tablesorter.min.js', 'profiler.js', 'jush/jush.js'); foreach ($aCss as $sCssUrl) { $this->oTemplate->addCss($sCssUrl); $this->oTemplateAdmin->addCss($sCssUrl); } foreach ($aJs as $sJsUrl) { $this->oTemplate->addJs($sJsUrl); $this->oTemplateAdmin->addJs($sJsUrl); } if (getParam('bx_profiler_long_sql_queries_log')) { $this->aConf['long_query'] = getParam('bx_profiler_long_sql_queries_time'); } if (getParam('bx_profiler_long_module_query_log')) { $this->aConf['long_module'] = getParam('bx_profiler_long_module_query_time'); } if (getParam('bx_profiler_long_page_log')) { $this->aConf['long_page'] = getParam('bx_profiler_long_page_time'); } $this->_iTimeStart = $iTimeStart; }
/** * Constructor */ function __construct($aObject) { parent::__construct(); $this->_aObject = $aObject; $this->_sObject = $aObject['object']; $this->_oDb = new BxDolRssQuery($this->_aObject); }
protected function __construct($oTemplate) { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->_oTemplate = $oTemplate ? $oTemplate : BxDolTemplate::getInstance(); }
function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->oDb = BxDolLanguagesQuery::getInstance(); }
function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->_isUseGD = getParam('enable_gd') == 'on' && extension_loaded('gd') ? true : false; }
function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->_isUseGD = getParam('enable_gd') == 'on' && extension_loaded('gd') ? true : false; $this->_oManager = new Intervention\Image\ImageManager(array('driver' => $this->_isUseGD ? 'gd' : 'imagick')); }
function __construct() { parent::__construct(); $this->oDb = new BxDolStudioModulesQuery(); $this->sJsObject = 'oBxDolStudioModules'; $this->sLangPrefix = 'mod'; $this->sTemplPrefix = 'mod'; $this->sParamPrefix = 'mod'; }
function __construct() { parent::__construct(); $this->aVisible = array(BX_DOL_STUDIO_MT_LEFT => false, BX_DOL_STUDIO_MT_CENTER => false, BX_DOL_STUDIO_MT_RIGHT => false); $this->aItems[BX_DOL_STUDIO_MT_LEFT] = array('edit' => array('name' => 'edit', 'icon' => 'move', 'onclick' => $this->getJsObject() . '.clickEdit(this);', 'title' => '_adm_tmi_cpt_edit'), 'favorite' => array('name' => 'favorite', 'icon' => 'star', 'onclick' => $this->getJsObject() . '.clickFavorite(this);', 'title' => '_adm_tmi_cpt_favorite'), 'extensions' => array('name' => 'extensions', 'icon' => 'plus', 'link' => BX_DOL_URL_STUDIO . 'store.php?page=goodies', 'title' => '_adm_tmi_cpt_extensions')); $aMatch = array(); $iResult = preg_match("/^(https?:\\/\\/)?(.*)\\/\$/", BX_DOL_URL_ROOT, $aMatch); $this->aItems[BX_DOL_STUDIO_MT_CENTER] = $iResult ? $aMatch[2] : ''; $this->aItems[BX_DOL_STUDIO_MT_RIGHT] = array('tour' => array('name' => 'tour', 'icon' => 'question', 'link' => 'javascript:void(0);', 'onclick' => 'glTour.start()', 'title' => '_adm_tmi_cpt_tour'), 'site' => array('name' => 'site', 'icon' => 'home', 'link' => BX_DOL_URL_ROOT, 'title' => '_adm_tmi_cpt_site'), 'logout' => array('name' => 'logout', 'icon' => 'power-off', 'link' => BX_DOL_URL_ROOT . 'logout.php', 'onclick' => $this->getJsObject() . ".clickLogout(this);", 'title' => '_adm_tmi_cpt_logout')); }
private function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->oDb = new BxDolSessionQuery(); $this->sId = ''; $this->iUserId = 0; $this->aData = array(); }
public function __construct() { parent::__construct(); $this->_oQuery = new BxDolLiveUpdatesQuery(); $this->_iInterval = (int) $this->_oQuery->getParam('sys_live_updates_interval'); $this->_iCacheTTL = 86400; $this->_sCacheKey = 'sys_live_updates_' . bx_get_logged_profile_id(); $this->_sJsClass = 'BxDolLiveUpdates'; $this->_sJsObject = 'oLiveUpdates'; $this->_aSystemsActive = array(); $this->_aSystems = $this->_getCachedSystems(); }
/** * Constructor */ protected function __construct($iProfileId) { $iProfileId = (int) $iProfileId; $sClass = get_class($this) . '_' . $iProfileId; if (isset($GLOBALS['bxDolClasses'][$sClass])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->_iProfileID = $iProfileId; // since constructor is protected $iProfileId is always valid $this->_oQuery = BxDolProfileQuery::getInstance(); }
/** * constructor */ protected function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->aUrlStatic = array(); $this->aUrlDynamic = array(); $this->aPathStatic = array(); $this->aPathDynamic = array(); $this->aDb = array(); }
public function __construct($iAccoutId = 0) { parent::__construct(); $sKey = getParam('bx_antispam_akismet_api_key'); if ($sKey && ($oAccount = BxDolAccount::getInstance((int) $iAccoutId))) { require_once BX_DIRECTORY_PATH_PLUGINS . 'akismet/Akismet.class.php'; $this->oAkismet = new Akismet(BX_DOL_URL_ROOT, $sKey); $oProfile = BxDolProfile::getInstanceByAccount((int) $iAccoutId); $this->oAkismet->setCommentAuthorEmail($oAccount->getEmail()); $this->oAkismet->setCommentAuthor($oProfile->getDisplayName()); $this->oAkismet->setCommentAuthorURL($oProfile->getUrl()); } }
/** * Class constructor. */ protected function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $oLang = BxDolLanguages::getInstance(); $this->iDefaultLangId = $oLang->getCurrentLangId(); $this->iFallbackLangId = $oLang->getLangId('en'); $sAboutUsLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=about'); $this->aDefaultKeys = array('site_url' => BX_DOL_URL_ROOT, 'site_name' => getParam('site_title'), 'about_us' => '<a href="' . $sAboutUsLink . '">' . _t('_sys_et_txt_about_us') . '</a>'); $this->_oEmailTemplatesQuery = BxDolEmailTemplatesQuery::getInstance(); }
public function __construct() { if (isset($GLOBALS['bxDolClasses'][get_class($this)])) { trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); } parent::__construct(); $this->sKey = getParam('sys_oauth_key'); $this->sSecret = getParam('sys_oauth_secret'); $this->sErrorCode = 'oauth_err_code'; $this->sErrorMessage = 'oauth_err_message'; bx_import('BxDolSession'); $this->oSession = BxDolSession::getInstance(); }
/** * constructor */ function __construct($aModule) { parent::__construct(); $this->_iId = empty($aModule['id']) ? 0 : (int) $aModule['id']; $this->_sName = isset($aModule['name']) ? $aModule['name'] : ''; $this->_sVendor = $aModule['vendor']; $this->_sClassPrefix = $aModule['class_prefix']; $this->_sDbPrefix = $aModule['db_prefix']; $this->_sDirectory = $aModule['path']; $this->_sHomePath = BX_DIRECTORY_PATH_MODULES . $this->_sDirectory; $this->_sClassPath = $this->_sHomePath . 'classes/'; $this->_sUri = $aModule['uri']; $this->_sHomeUrl = BX_DOL_URL_MODULES . $this->_sDirectory; }
/** * Constructor * @param $aObject array of metags object options */ public function __construct($aObject, $mixedContentId) { parent::__construct(); $this->_sObject = $aObject['object']; $this->_aObject = $aObject; $this->_mixedContentId = $mixedContentId; $a = array('keywords', 'locations', 'mentions', 'pictures'); foreach ($a as $sMeta) { if (empty($this->_aObject['table_' . $sMeta])) { continue; } $this->_aMetas[] = $sMeta; } }
public function __construct($aParams = array(), $aField = array()) { parent::__construct(); $this->oDb = new BxDolStudioFormsQuery(); $this->aTypes = array('block_header', 'text', 'datepicker', 'datetime', 'number', 'checkbox', 'password', 'slider', 'doublerange', 'hidden', 'switcher', 'reset', 'submit', 'textarea', 'select', 'select_multiple', 'checkbox_set', 'radio_set', 'value', 'captcha', 'file', 'files', 'custom'); $this->aTypesRelated = array('select_multiple' => array('types' => array('select_multiple', 'checkbox_set'), 'reload_on_change' => 0), 'checkbox_set' => array('types' => array('select_multiple', 'checkbox_set'), 'reload_on_change' => 0), 'select' => array('types' => array('select', 'radio_set'), 'reload_on_change' => 0), 'radio_set' => array('types' => array('select', 'radio_set'), 'reload_on_change' => 0), 'datepicker' => array('types' => array('datepicker', 'datetime'), 'reload_on_change' => 1), 'datetime' => array('types' => array('datepicker', 'datetime'), 'reload_on_change' => 1), 'checkbox' => array('types' => array('checkbox', 'switcher'), 'reload_on_change' => 0), 'switcher' => array('types' => array('checkbox', 'switcher'), 'reload_on_change' => 0), 'number' => array('types' => array('number', 'slider'), 'reload_on_change' => 1), 'slider' => array('types' => array('number', 'slider'), 'reload_on_change' => 1)); $this->aParams = $aParams; $this->aField = $aField; if (isset($this->aParams['object']) && isset($this->aParams['display'])) { $aForm = array(); $this->oDb->getForms(array('type' => 'by_object_display', 'object' => $this->aParams['object'], 'display' => $this->aParams['display']), $aForm, false); $this->aParams['table'] = $aForm['table']; } }
/** * Constructor * @param $aObject array of metags object options */ public function __construct($aObject) { parent::__construct(); $this->_sObject = $aObject['object']; $this->_aObject = $aObject; $a = array('keywords', 'locations', 'mentions', 'pictures'); foreach ($a as $sMeta) { if (empty($this->_aObject['table_' . $sMeta])) { continue; } $this->_aMetas[] = $sMeta; } $this->_oQuery = new BxDolMetatagsQuery($this->_aObject); }
public function __construct($iProfileID = 0) { parent::__construct(); $sKey = getParam('bx_antispam_akismet_api_key'); if ($sKey) { require_once BX_DIRECTORY_PATH_PLUGINS . 'akismet/Akismet.class.php'; $this->oAkismet = new Akismet(BX_DOL_URL_ROOT, $sKey); $aProfile = getProfileInfo($iProfileID); if ($aProfile) { $this->oAkismet->setCommentAuthor($aProfile['NickName']); $this->oAkismet->setCommentAuthorEmail($aProfile['Email']); $this->oAkismet->setCommentAuthorURL(getProfileLink($aProfile['ID'])); } } }
public function __construct($sSystem, $iId, $iInit = 1) { parent::__construct(); $aSystems = $this->getSystems(); if (!isset($aSystems[$sSystem])) { return; } $this->_sSystem = $sSystem; $this->_aSystem = $aSystems[$sSystem]; if (!$this->isEnabled()) { return; } if ($iInit) { $this->init($iId); } }
function __construct($iTimeStart) { parent::__construct(); $this->oConfig = new BxProfilerConfig($GLOBALS['bx_profiler_module']); $this->oTemplate = new BxProfilerTemplate($this->oConfig); $this->oTemplateAdmin = BxDolStudioTemplate::getInstance(); if (getParam('bx_profiler_long_sql_queries_log')) { $this->aConf['long_query'] = getParam('bx_profiler_long_sql_queries_time'); } if (getParam('bx_profiler_long_module_query_log')) { $this->aConf['long_module'] = getParam('bx_profiler_long_module_query_time'); } if (getParam('bx_profiler_long_page_log')) { $this->aConf['long_page'] = getParam('bx_profiler_long_page_time'); } $this->_iTimeStart = $iTimeStart; }