ZBlogPHP::Initialize PHP Method

Initialize() public method

初始化$zbp
public Initialize ( ) : boolean
return boolean
    public function Initialize()
    {
        $oldzone = $this->option['ZC_TIME_ZONE_NAME'];
        date_default_timezone_set($oldzone);
        $oldlang = $this->option['ZC_BLOG_LANGUAGEPACK'];
        $this->LoadLanguage('system', '');
        if ($this->option['ZC_CLOSE_WHOLE_SITE'] == true) {
            Http503();
            $this->ShowError(82, __FILE__, __LINE__);
            return false;
        }
        if (!$this->OpenConnect()) {
            return false;
        }
        $this->ConvertTableAndDatainfo();
        $this->LoadConfigs();
        $this->LoadCache();
        $this->LoadOption();
        $this->RegPostType(0, 'article', $this->option['ZC_ARTICLE_REGEX'], $this->option['ZC_POST_DEFAULT_TEMPLATE']);
        $this->RegPostType(1, 'page', $this->option['ZC_PAGE_REGEX'], $this->option['ZC_POST_DEFAULT_TEMPLATE']);
        if ($this->option['ZC_BLOG_LANGUAGEPACK'] === 'SimpChinese') {
            $this->option['ZC_BLOG_LANGUAGEPACK'] = 'zh-cn';
        }
        if ($this->option['ZC_BLOG_LANGUAGEPACK'] === 'TradChinese') {
            $this->option['ZC_BLOG_LANGUAGEPACK'] = 'zh-tw';
        }
        if ($oldlang != $this->option['ZC_BLOG_LANGUAGEPACK']) {
            $this->LoadLanguage('system', '');
        }
        if (isset($this->option['ZC_DEBUG_MODE_STRICT'])) {
            ZBlogException::$isstrict = (bool) $this->option['ZC_DEBUG_MODE_STRICT'];
        }
        if (isset($this->option['ZC_DEBUG_MODE_WARNING'])) {
            ZBlogException::$iswarning = (bool) $this->option['ZC_DEBUG_MODE_WARNING'];
        }
        if (isset($this->option['ZC_DEBUG_LOG_ERROR'])) {
            ZBlogException::$islogerror = (bool) $this->option['ZC_DEBUG_LOG_ERROR'];
        }
        if (substr($this->host, 0, 8) == 'https://') {
            $this->ishttps = true;
        }
        if ($this->option['ZC_PERMANENT_DOMAIN_ENABLE'] == true) {
            $this->host = $this->option['ZC_BLOG_HOST'];
            $this->cookiespath = strstr(str_replace('://', '', $this->host), '/');
        } else {
            $this->option['ZC_BLOG_HOST'] = $this->host;
        }
        $this->option['ZC_BLOG_PRODUCT'] = 'Z-BlogPHP';
        $this->option['ZC_BLOG_VERSION'] = ZC_BLOG_VERSION;
        $this->option['ZC_NOW_VERSION'] = $this->version;
        //ZC_LAST_VERSION
        $this->option['ZC_BLOG_PRODUCT_FULL'] = $this->option['ZC_BLOG_PRODUCT'] . ' ' . ZC_VERSION_DISPLAY;
        $this->option['ZC_BLOG_PRODUCT_FULLHTML'] = '<a href="http://www.zblogcn.com/" title="RainbowSoft Z-BlogPHP" target="_blank">' . $this->option['ZC_BLOG_PRODUCT_FULL'] . '</a>';
        $this->option['ZC_BLOG_PRODUCT_HTML'] = '<a href="http://www.zblogcn.com/" title="RainbowSoft Z-BlogPHP" target="_blank">' . $this->option['ZC_BLOG_PRODUCT'] . '</a>';
        if ($oldzone != $this->option['ZC_TIME_ZONE_NAME']) {
            date_default_timezone_set($this->option['ZC_TIME_ZONE_NAME']);
        }
        /*if(isset($_COOKIE['timezone'])){
              $tz=GetVars('timezone','COOKIE');
              if(is_numeric($tz)){
              $tz=sprintf('%+d',-$tz);
              date_default_timezone_set('Etc/GMT' . $tz);
              $this->timezone=date_default_timezone_get();
              }
          */
        header('Product:' . $this->option['ZC_BLOG_PRODUCT_FULL']);
        $this->validcodeurl = $this->host . 'zb_system/script/c_validcode.php';
        $this->feedurl = $this->host . 'feed.php';
        $this->searchurl = $this->host . 'search.php';
        $this->ajaxurl = $this->host . 'zb_system/cmd.php?act=ajax&src=';
        $this->xmlrpcurl = $this->host . 'zb_system/xml-rpc/index.php';
        $this->isinitialized = true;
        return true;
    }
ZBlogPHP