当前位置: 首页>>代码示例>>PHP>>正文


PHP registry::get_const方法代码示例

本文整理汇总了PHP中registry::get_const方法的典型用法代码示例。如果您正苦于以下问题:PHP registry::get_const方法的具体用法?PHP registry::get_const怎么用?PHP registry::get_const使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在registry的用法示例。


在下文中一共展示了registry::get_const方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __get

 public function __get($name)
 {
     $deps = registry::get_const('short_' . get_class($this));
     if (isset($deps[$name])) {
         if (is_array($deps[$name])) {
             return registry::register($deps[$name][0], $deps[$name][1]);
         } else {
             return registry::register($deps[$name]);
         }
     }
     if (is_array($deps) && is_int(array_search($name, $deps))) {
         if (isset(registry::$aliases[$name])) {
             if (is_array(registry::$aliases[$name])) {
                 return registry::register(registry::$aliases[$name][0], registry::$aliases[$name][1]);
             } else {
                 return registry::register(registry::$aliases[$name]);
             }
         } elseif (registry::class_exists($name)) {
             return registry::register($name);
         }
     }
     if ($const = registry::get_const($name)) {
         return $const;
     }
     return null;
 }
开发者ID:ubick,项目名称:lorekeepers.org,代码行数:26,代码来源:gen_class.class.5.2.php

示例2: __get

 public function __get($name)
 {
     $shorts = static::__shortcuts();
     if (isset($shorts[$name])) {
         if (is_array($shorts[$name])) {
             return registry::register($shorts[$name][0], $shorts[$name][1]);
         } else {
             return registry::register($shorts[$name]);
         }
     }
     if (is_int(array_search($name, $shorts))) {
         if (isset(registry::$aliases[$name])) {
             if (is_array(registry::$aliases[$name])) {
                 return registry::register(registry::$aliases[$name][0], registry::$aliases[$name][1]);
             } else {
                 return registry::register(registry::$aliases[$name]);
             }
         } elseif (registry::class_exists($name)) {
             return registry::register($name);
         }
     }
     if ($const = registry::get_const($name)) {
         return $const;
     }
     return null;
 }
开发者ID:ubick,项目名称:lorekeepers.org,代码行数:26,代码来源:gen_class.class.php

示例3: ajax_check_database

 public function ajax_check_database()
 {
     header('content-type: text/html; charset=UTF-8');
     if ($this->in->get('host') != '' && $this->in->get('user') != '' && $this->in->get('pw') != '' && $this->in->get('name') != '') {
         $error = array();
         try {
             $db = dbal::factory(array('dbtype' => registry::get_const('dbtype')));
             $db->connect($this->in->get('host'), $this->in->get('name'), $this->in->get('user'), $this->in->get('pw'));
             //Schreibe die Daten in die Config
             $this->config->set('cmsbridge_host', $this->crypt->encrypt($this->in->get('host')));
             $this->config->set('cmsbridge_user', $this->crypt->encrypt($this->in->get('user')));
             $this->config->set('cmsbridge_password', $this->crypt->encrypt($this->in->get('pw', '', 'raw')));
             $this->config->set('cmsbridge_database', $this->crypt->encrypt($this->in->get('name')));
             $this->config->set('cmsbridge_notsamedb', 1);
             echo "true";
             exit;
         } catch (DBALException $e) {
             $this->config->del('cmsbridge_host');
             $this->config->del('cmsbridge_user');
             $this->config->del('cmsbridge_password');
             $this->config->del('cmsbridge_database');
             $this->config->del('cmsbridge_notsamedb');
         }
     }
     sleep(1);
     echo "false";
     exit;
 }
开发者ID:rswiders,项目名称:core,代码行数:28,代码来源:manage_bridge.php

示例4: get_filled_output

 public function get_filled_output()
 {
     $this->dbtype = registry::get_const('dbtype');
     $this->dbhost = registry::get_const('dbhost');
     $this->dbname = registry::get_const('dbname');
     $this->dbuser = registry::get_const('dbuser');
     return $this->get_output();
 }
开发者ID:ZerGabriel,项目名称:tool-supporttoolkit,代码行数:8,代码来源:db_access.class.php

示例5: get_filled_output

 public function get_filled_output()
 {
     $this->ftphost = registry::get_const('ftphost');
     $this->ftpport = registry::get_const('ftpport');
     $this->ftpuser = registry::get_const('ftpuser');
     $this->ftproot = registry::get_const('ftproot');
     $this->use_ftp = registry::get_const('use_ftp');
     return $this->get_output();
 }
开发者ID:rswiders,项目名称:core,代码行数:9,代码来源:ftp_access.class.php

示例6: __construct

 public function __construct($strEncryptionKey = '')
 {
     include_once $this->root_path . 'libraries/aes/AES.class.php';
     if ($strEncryptionKey == '' && registry::get_const('encryptionKey') == '') {
         $this->core->message('Encryption Key is missing. Please take a look at our Wiki.', $this->user->lang('error'), 'red');
         $this->strEncryptionKey = '';
     } else {
         $this->strEncryptionKey = $strEncryptionKey != '' ? $strEncryptionKey : registry::get_const('encryptionKey');
         $this->strEncryptionKey = md5($this->strEncryptionKey);
     }
 }
开发者ID:rswiders,项目名称:core,代码行数:11,代码来源:encrypt.class.php

示例7: _inpval

 public function _inpval()
 {
     switch ($this->returnFormat) {
         case 'relative':
             return str_replace($this->environment->link, registry::get_const('root_path'), urldecode($this->in->get($this->name, '')));
         case 'in_data':
             return str_replace($this->pfh->FileLink('', 'files', 'absolute'), '', urldecode($this->in->get($this->name, '')));
         case 'filename':
             return pathinfo(urldecode($this->in->get($this->name, '')), PATHINFO_BASENAME);
         case 'absolute':
         default:
             return urldecode($this->in->get($this->name, ''));
     }
 }
开发者ID:rswiders,项目名称:core,代码行数:14,代码来源:himageuploader.class.php

示例8: getAvailableParsers

function getAvailableParsers()
{
    $parser = array();
    $parse_path = registry::get_const('root_path') . 'plugins/raidlogimport/includes/parser/';
    include_once $parse_path . 'parser.aclass.php';
    $parse_ext = '.parser.class.php';
    $parser_classes = sdir($parse_path, '*' . $parse_ext, $parse_ext);
    $parser = array();
    foreach ($parser_classes as $parser_class) {
        include_once $parse_path . $parser_class . $parse_ext;
        $parser[$parser_class] = $parser_class::$name;
    }
    $parser['empty'] = register('user')->lang('parser_empty');
    return $parser;
}
开发者ID:rswiders,项目名称:plugin-raidlogimport,代码行数:15,代码来源:functions.php

示例9: pre_install

 /**
  * pre_install
  * Define Installation
  */
 public function pre_install()
 {
     // include SQL and default configuration data for installation
     include $this->root_path . 'plugins/eqdkp_sso/includes/sql.php';
     // define installation
     for ($i = 1; $i <= count($eqdkpSSOSQL['install']); $i++) {
         $this->db->query($eqdkpSSOSQL['install'][$i]);
     }
     //Create uniqueID and masterKey
     $masterKey = sha1(generateRandomBytes(48));
     $uniqueID = sha1(generateRandomBytes(48));
     $data = "<?php \nif ( !defined('EQDKP_INC') ){\n\theader('HTTP/1.0 404 Not Found');exit;\n}\n\n\$eqdkp_sso_uniqueID = '" . $uniqueID . "';\n\$eqdkp_sso_masterKey = '" . $masterKey . "';\n\n?>";
     $this->pfh->secure_folder('config', 'eqdkp_sso');
     $this->pfh->putContent($this->pfh->FolderPath('config', 'eqdkp_sso') . 'config.php', $data);
     //Insert this master as slave;
     $crypt = register('encrypt', array($masterKey));
     $arrQuery = array('name' => $this->config->get('main_title') != "" ? $this->config->get('main_title') : "This Master", 'domain' => $this->env->server_name, 'uniqueid' => $uniqueID, 'db_type' => 0, 'db_host' => '', 'db_user' => '', 'db_password' => '', 'db_database' => '', 'db_prefix' => $crypt->encrypt(registry::get_const("table_prefix")), 'cookie_name' => $this->config->get('cookie_name'));
     $this->db->prepare("INSERT INTO __plugin_sso :p")->set($arrQuery)->execute();
 }
开发者ID:ZerGabriel,项目名称:plugin-eqdkp_sso,代码行数:23,代码来源:eqdkp_sso_plugin_class.php

示例10: connect

 /**
  * Initialize the Bridge Database Connection
  */
 private function connect()
 {
     if ((int) $this->config->get('cmsbridge_notsamedb') == 1) {
         try {
             $this->bridgedb = dbal::factory(array('dbtype' => registry::get_const('dbtype'), 'debug_prefix' => 'bridge_', 'table_prefix' => $this->prefix));
             $this->bridgedb->connect($this->crypt->decrypt($this->config->get('cmsbridge_host')), $this->crypt->decrypt($this->config->get('cmsbridge_database')), $this->crypt->decrypt($this->config->get('cmsbridge_user')), $this->crypt->decrypt($this->config->get('cmsbridge_password')));
             $this->status = true;
         } catch (DBALException $e) {
             $this->bridgedb = $this->status = false;
             $this->pdl->log('bridge', 'Connection error: ' . $e->getMessage());
         }
     } else {
         try {
             $this->bridgedb = dbal::factory(array('dbtype' => registry::get_const('dbtype'), 'open' => true, 'debug_prefix' => 'bridge_', 'table_prefix' => $this->prefix));
             $this->status = true;
         } catch (DBALException $e) {
             $this->bridgedb = $this->status = false;
             $this->pdl->log('bridge', 'Connection error: ' . $e->getMessage());
         }
     }
 }
开发者ID:rswiders,项目名称:core,代码行数:24,代码来源:bridge.class.php

示例11: __construct

 public function __construct($pre_check = false, $handler = false, $pdh_call = array(), $params = null, $cb_name = '', $url_id = '')
 {
     parent::__construct($pre_check, $handler, $pdh_call, $params, $cb_name, $url_id);
     if (registry::isset_const('url_id')) {
         $this->set_url_id($url_id != "" ? $url_id : registry::get_const('url_id'), registry::get_const('url_id'));
     }
     //Build Path
     $strPath = $this->server_path;
     if (!intval($this->config->get('seo_remove_index'))) {
         $strPath .= 'index.php/';
     }
     $strPagePath = strlen($this->page_path) ? $this->page_path : $this->env->path;
     if (strpos($strPagePath, "/") === 0) {
         $strPagePath = substr($strPagePath, 1);
     }
     $strPath .= $strPagePath;
     $this->strPage = $this->page;
     $this->strPath = $strPath;
     $this->strPathPlain = str_replace($this->server_path, "", $strPath);
     $this->action = $strPath . $this->SID . $this->simple_head_url . $this->url_id_ext;
     $this->tpl->assign_vars(array('ACTION' => $this->action, 'PATH' => $strPath));
 }
开发者ID:rswiders,项目名称:core,代码行数:22,代码来源:pageobject.class.php

示例12: load

 public static function load($classname)
 {
     if (isset(self::$loaded[$classname])) {
         return true;
     }
     self::$loaded[$classname] = true;
     if (!isset(self::$locs[$classname]) && !class_exists($classname) && !(self::get_const('lite_mode') && in_array($classname, self::$lite_igno))) {
         $data = debug_backtrace();
         foreach ($data as $call) {
             echo 'file: ' . $call['file'] . ", line: " . $call['line'] . "<br />";
         }
         die('call to not listed class: ' . $classname);
         //use pdl here later
     }
     if (!class_exists($classname)) {
         $lite = registry::get_const('lite_mode') ? 'lite/' : '';
         $path = self::$const['root_path'] . self::$locs[$classname];
         if (!file_exists($path . $lite . $classname . '.class.php')) {
             $lite = '';
         }
         include_once $path . $lite . $classname . '.class.php';
     }
 }
开发者ID:ubick,项目名称:lorekeepers.org,代码行数:23,代码来源:registry.class.php

示例13: __get

 public function __get($name)
 {
     if (isset($this->_class_index[$name])) {
         $obj = registry::grab($this->_class_index[$name][0], $this->_class_index[$name][1]);
         if ($obj) {
             return $obj;
         }
     }
     if (!$this->_shorts_loaded) {
         $this->_shorts = static::__shortcuts();
         $this->_shorts_loaded = true;
     }
     $obj = false;
     if (isset($this->_shorts[$name])) {
         if (is_array($this->_shorts[$name])) {
             $obj = registry::register($this->_shorts[$name][0], $this->_shorts[$name][1]);
         } else {
             $obj = registry::register($this->_shorts[$name]);
         }
     } elseif (isset(registry::$aliases[$name])) {
         if (is_array(registry::$aliases[$name])) {
             $obj = registry::register(registry::$aliases[$name][0], registry::$aliases[$name][1]);
         } else {
             $obj = registry::register(registry::$aliases[$name]);
         }
     } elseif (registry::class_exists($name)) {
         $obj = registry::register($name);
     }
     if ($obj) {
         $this->_class_index[$name] = array(get_class($obj), $obj->class_hash);
         return $obj;
     }
     if ($const = registry::get_const($name)) {
         return $const;
     }
     return null;
 }
开发者ID:rswiders,项目名称:core,代码行数:37,代码来源:gen_class.class.php

示例14: get_latestposts

 public function get_latestposts($params, $body)
 {
     $intNumber = intval($params['get']['number']) > 0 ? intval($params['get']['number']) : 10;
     $myOut = $this->pdc->get('portal.module.latestposts.exchange.' . $intNumber . '.u' . $this->user->id, false, true);
     if (!$myOut) {
         //Try a database connection
         if ($this->config->get('cmsbridge_active') == 1 && $this->config->get('dbmode', 'pmod_' . $this->module_id) == 'bridge') {
             //Bridge Connection
             $mydb = $this->bridge->bridgedb;
             //change prefix
             if (strlen(trim($this->config->get('dbprefix', 'pmod_' . $this->module_id)))) {
                 $mydb->setPrefix(trim($this->config->get('dbprefix', 'pmod_' . $this->module_id)));
             }
         } elseif ($this->config->get('dbmode', 'pmod_' . $this->module_id) == 'new') {
             //Another Database
             try {
                 $mydb = dbal::factory(array('dbtype' => registry::get_const('dbtype'), 'debug_prefix' => 'latestposts_', 'table_prefix' => trim($this->config->get('dbprefix', 'pmod_' . $this->module_id))));
                 $mydb->connect($this->crypt->decrypt($this->config->get('dbhost', 'pmod_' . $this->module_id)), $this->crypt->decrypt($this->config->get('dbname', 'pmod_' . $this->module_id)), $this->crypt->decrypt($this->config->get('dbuser', 'pmod_' . $this->module_id)), $this->crypt->decrypt($this->config->get('dbpassword', 'pmod_' . $this->module_id)));
             } catch (DBALException $e) {
                 $mydb = false;
             }
         } else {
             //Same Database
             try {
                 $mydb = dbal::factory(array('dbtype' => registry::get_const('dbtype'), 'open' => true, 'debug_prefix' => 'latestposts_', 'table_prefix' => trim($this->config->get('dbprefix', 'pmod_' . $this->module_id))));
             } catch (DBALException $e) {
                 $mydb = false;
             }
         }
         if ($mydb) {
             $black_or_white = $this->config->get('blackwhitelist', 'pmod_' . $this->module_id) == 'white' ? 'IN' : 'NOT IN';
             // include the BB Module File...
             $bbModule = $this->root_path . 'portal/latestposts/bb_modules/' . $this->config->get('bbmodule', 'pmod_' . $this->module_id) . '.php';
             if (is_file($bbModule)) {
                 include_once $bbModule;
                 $classname = 'latestpostsmodule_' . $this->config->get('bbmodule', 'pmod_' . $this->module_id);
                 $module = new $classname();
                 if (!$module || !method_exists($module, 'getBBQuery')) {
                     return $this->pex->error('boardmodule not available');
                 }
             } else {
                 return $this->pex->error('no boardmodule selected');
             }
             // Create Array of allowed/disallowed forums
             $arrUserMemberships = $this->pdh->get('user_groups_users', 'memberships', array($this->user->id));
             array_push($arrUserMemberships, 0);
             $arrForums = array();
             $visibilityGrps = $this->config->get('visibility', 'pmod_' . $this->module_id);
             foreach ($arrUserMemberships as $groupid) {
                 //only load forums for which actual settings are set
                 if (!in_array($groupid, $visibilityGrps)) {
                     continue;
                 }
                 $strForums = $this->config->get('privateforums_' . $groupid, 'pmod_' . $this->module_id);
                 if (method_exists($module, 'getBBForumQuery')) {
                     $arrForums = array_merge($arrForums, $strForums);
                 } else {
                     //comma seperated IDs
                     $arrTmpForums = $this->config->get('privateforums', 'pmod_' . $this->module_id) ? explode(",", $this->config->get('privateforums', 'pmod_' . $this->module_id)) : '';
                     if (is_array($arrTmpForums)) {
                         foreach ($arrTmpForums as $forumid) {
                             if (trim($forumid) != '') {
                                 $arrForums[] = trim($forumid);
                             }
                         }
                     }
                 }
             }
             $arrForums = array_unique($arrForums);
             $strQuery = $module->getBBQuery($arrForums, $black_or_white, $intNumber);
             $myOut['forum_url'] = htmlentities($this->config->get('url', 'pmod_' . $this->module_id));
             $strBoardURL = $this->config->get('url', 'pmod_' . $this->module_id);
             if (substr($strBoardURL, -1) != "/") {
                 $strBoardURL .= '/';
             }
             $myOut['posts'] = array();
             $sucess = false;
             $objQuery = $mydb->query($strQuery);
             if ($objQuery && $objQuery->numRows) {
                 $sucess = true;
                 while ($row = $objQuery->fetchAssoc()) {
                     $myOut['posts'][] = array('member_link' => htmlentities($strBoardURL . $module->getBBLink('member', $row)), 'topic_link' => htmlentities($strBoardURL . $module->getBBLink('topic', $row)), 'topic_title' => $row['bb_topic_title'], 'topic_replies' => intval($row['bb_replies']), 'topic_lastpost_date' => $this->time->date('Y-m-d H:i', $row['bb_posttime']), 'topic_lastpost_timestamp' => $row['bb_posttime'], 'topic_lastpost_username' => $row['bb_username']);
                 }
             } else {
                 $myOut['posts'] = array();
             }
             if ($sucess) {
                 $this->pdc->put('portal.module.latestposts.exchange.' . $intNumber . '.u' . $this->user->id, $myOut, 300, false, true);
             }
         } else {
             return $this->pex->error('connection error');
         }
     }
     return $myOut;
 }
开发者ID:ZerGabriel,项目名称:portal-latestposts,代码行数:95,代码来源:latestposts.php

示例15: header

 *	by the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	This program 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 Affero General Public License for more details.
 *
 *	You should have received a copy of the GNU Affero General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (!defined('EQDKP_INC')) {
    header('HTTP/1.0 404 Not Found');
    exit;
}
include_once registry::get_const('root_path') . 'maintenance/includes/sql_update_task.class.php';
if (!class_exists('update_shoutbox_033')) {
    class update_shoutbox_033 extends sql_update_task
    {
        public $author = 'Aderyn';
        public $version = '0.3.3';
        // new version
        public $name = 'Shoutbox 0.3.3 Update';
        public $type = 'plugin_update';
        public $plugin_path = 'shoutbox';
        // important!
        /**
         * Constructor
         */
        public function __construct()
        {
开发者ID:ZerGabriel,项目名称:plugin-shoutbox,代码行数:31,代码来源:update_shoutbox_033.class.php


注:本文中的registry::get_const方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。