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


PHP CLang::update方法代码示例

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


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

示例1: CConfig

try {
    $config = new CConfig();
    $d = $database->load($_POST['databasetype']);
    $d->connect($_POST['databasehost'], $_POST['databaseuser'], $_POST['databasepassword'], $_POST['databasename']);
    define('TBL_PREFIX', $_POST['databaseprefix']);
    $queries = file_get_contents('kernel/sql/users.sql');
    $queries .= file_get_contents('kernel/sql/news.sql');
    $queries .= file_get_contents('kernel/sql/polls.sql');
    $queries .= file_get_contents('kernel/sql/basic.sql');
    $queries .= file_get_contents('kernel/sql/help.sql');
    // TODO
    include_once 'kernel/language.class.php';
    $languages = new CLang();
    foreach ($languages->installed() as $language) {
        echo $language;
        $languages->update($language);
        $tmpquery = file_get_contents('kernel/sql/basicpages.sql');
        $tmpquery = ereg_replace('%language%', $languages->getPrefLangCode(), $tmpquery);
        $tmpquery = ereg_replace('%shown_logout%', $languages->translate('logout'), $tmpquery);
        $tmpquery = ereg_replace('%shown_index%', $languages->translate('Home'), $tmpquery);
        $tmpquery = ereg_replace('%shown_registerform%', $languages->translate('Register'), $tmpquery);
        $tmpquery = ereg_replace('%shown_sendpasswordform%', $languages->translate('Lost Password'), $tmpquery);
        $tmpquery = ereg_replace('%shown_changeoptionsform%', $languages->translate('Edit Settings'), $tmpquery);
        $tmpquery = ereg_replace('%shown_viewuserlist%', $languages->translate('Userlist'), $tmpquery);
        $queries .= $tmpquery;
    }
    $queries = ereg_replace('%show_logout_in_nav%', Yes, $queries);
    $queries = ereg_replace('%show_index_in_nav%', Yes, $queries);
    $queries = ereg_replace('%show_registerform_in_nav%', No, $queries);
    $queries = ereg_replace('%show_sendpasswordform_in_nav%', No, $queries);
    $queries = ereg_replace('%show_changeoptionsform_in_nav%', Yes, $queries);
开发者ID:BackupTheBerlios,项目名称:yapcas-svn,代码行数:31,代码来源:install.php

示例2: die

 function __construct()
 {
     error_reporting(E_ALL);
     session_start();
     // check for PHP version
     $req = '5.0.0';
     if (version_compare($req, phpversion(), '>=')) {
         die('PHP Version ' . $req . ' or higher is required');
     }
     // as it crashes between this and load of the config
     // we need to have all debug info
     // FIXME
     if (!file_exists('.install.php')) {
         include_once 'kernel/constants.php';
         include_once 'kernel/config.class.php';
         include_once 'kernel/language.class.php';
         $config = new CConfig();
         $config->addConfigByFileName('site.config.php', TYPE_STRING, 'database/tblprefix', 0);
         define('TBL_PREFIX', $config->getConfigByNameType('database/tblprefix', TYPE_STRING));
         include_once 'kernel/help.class.php';
         include_once 'kernel/users.class.php';
         include_once 'kernel/news.class.php';
         include_once 'kernel/polls.class.php';
         include_once 'kernel/exception.class.php';
         include_once 'kernel/database.class.php';
         define('TBL_PAGES', TBL_PREFIX . 'pages');
         $config->addConfigByFileName('site.config.php', TYPE_INT, 'general/errorreporting', 0);
         $config->addConfigByFileName('site.config.php', TYPE_STRING, 'general/webmastermail', 0);
         error_reporting($config->getConfigByNameType('general/errorreporting', TYPE_INT));
         $config->addConfigByFileName('site.config.php', TYPE_STRING, 'general/databasetype', 0);
         $dbType = $config->getConfigByNameType('general/databasetype', TYPE_STRING);
         $dbclass = new CDatabase();
         $database = $dbclass->load($dbType, $config, 'site.config.php');
         $config->addConfigByFileName('site.config.php', TYPE_STRING, 'database/host', 'localhost');
         $config->addConfigByFileName('site.config.php', TYPE_STRING, 'database/user', 0);
         $config->addConfigByFileName('site.config.php', TYPE_STRING, 'database/password', 0);
         $config->addConfigByFileName('site.config.php', TYPE_STRING, 'database/name', 0);
         $host = $config->getConfigByNameType('database/host', TYPE_STRING);
         $user = $config->getConfigByNameType('database/user', TYPE_STRING);
         $password = $config->getConfigByNameType('database/password', TYPE_STRING);
         $dbname = $config->getConfigByNameType('database/name', TYPE_STRING);
         $database->connect($host, $user, $password, $dbname);
         // TODO
         $tables = array();
         if (checkDatabase($database, $tables)) {
             // Database seems to be OK
             $config->addConfigByFileName('site.config.php', TYPE_BOOL, 'user/activatemail', 0);
             $lang = new CLang();
             $user = new CUser($database, $config->getConfigByNameType('user/activatemail', TYPE_BOOL), $lang);
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('contentlanguage', $user, 'contentlanguage', 'site.config.php'), 'general/contentlanguage', TYPE_STRING, DEFAULT_CONTENT_LANG);
             $contentLang = $config->getConfigByNameType('general/contentlanguage', TYPE_STRING);
             $news = new CNews($database, $lang, $contentLang);
             $poll = new CPoll($database, $config, $lang);
             $this->help = new CHelp($database, $config, $lang);
             $config->addConfigByFileName('site.config.php', TYPE_STRING, 'general/httplink');
             $config->addConfigByFileName('site.config.php', TYPE_STRING, 'general/sitename');
             $config->addConfigByFileName('site.config.php', TYPE_STRING, 'general/description');
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('timezone', $user, 'timezone', 'site.config.php'), 'general/timezone', TYPE_FLOAT, 0);
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('timeformat', $user, 'timeformat', 'site.config.php'), 'general/timeformat', TYPE_STRING, '');
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('uilanguage', $user, 'uilanguage', 'site.config.php'), 'general/uilanguage', TYPE_STRING, STANDARD_LANGUAGE);
             $lang->update($config->getConfigByNameType('general/uilanguage', TYPE_STRING));
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('theme', $user, 'theme', 'site.config.php'), 'general/theme', TYPE_STRING, 'moderngray');
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('threaded', $user, 'threaded', 'site.config.php'), 'news/threaded', TYPE_BOOL, YES);
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('headlines', $user, 'headlines', 'site.config.php'), 'news/headlines', TYPE_INT, 5);
             $config->addConfigByList('GET;YAPCAS_USER;COOKIE;FILE', array('postsonpage', $user, 'postsonpage', 'site.config.php'), 'news/postsonpage', TYPE_INT, 10);
             $config->addConfigByList('YAPCAS_USER', array($user), 'user/email', TYPE_STRING);
             $config->addConfigByList('YAPCAS_USER', array($user), 'user/name', TYPE_STRING, 'anonymous');
             $this->loadtheme($config->getConfigByNameType('general/theme', TYPE_STRING));
             $this->config = $config;
             $this->news = $news;
             $this->config = $config;
             $this->poll = $poll;
             $this->lang = $lang;
             $this->user = $user;
             $this->database = $database;
             $this->BBCTags = array('b', 'u', 'i', 'quote');
             global $theme, $config, $news, $poll, $user, $lang, $database;
             $config = $this->config;
             $news = $this->news;
             $config = $this->config;
             $poll = $this->poll;
             $lang = $this->lang;
             $user = $this->user;
             $database = $this->database;
             $theme = $this;
         }
     } else {
         if (file_exists('site.config.php')) {
             include_once 'kernel/config.class.php';
             $config = new config();
             $config->addConfigByFileName('site.config.php', TYPE_STRING, 'database/tblprefix', 0);
             define('TBL_PREFIX', $config->getConfigByNameType('database/tblprefix', TYPE_STRING));
             define('TBL_PAGES', TBL_PREFIX . 'pages');
             $config->addConfigByFileName('site.config.php', TYPE_INT, 'general/errorreporting', 0);
             //error_reporting ($config->getConfigByNameType('general/errorreporting',TYPE_INT));
             $config->addConfigByFileName('site.config.php', TYPE_STRING, 'general/databasetype', 0);
             loaddbclass($config->getConfigByNameType('general/databasetype', TYPE_STRING));
             $database = new database($config, 'site.config.php');
             $database->connect();
             // FIXME
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:yapcas-svn,代码行数:101,代码来源:skin.class.php


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