Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Config{
- var $base;
- var $password;
- var $user;
- var $host;
- var $charset;
- var $collation;
- var $cache;
- var $template;
- var $script_url;
- var $lic_key;
- var $domain;
- var $update_info;
- var $timezone;
- var $timezone_2;
- var $general_dir;
- var $add;
- function __construct() {
- $this->db_config();
- $this->template_config();
- $this->general();
- $this->update_info();
- }
- function general(){
- $this->general_dir='/var/www/www-root/data/www/';
- $this->add='http://domain_here/';
- if(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"]=='on'){
- $url='https://'.$_SERVER["SERVER_NAME"];
- }else{
- $url='http://'.$_SERVER["SERVER_NAME"];
- }
- $url .= ( $_SERVER["SERVER_PORT"] != 80 ) ? ":".$_SERVER["SERVER_PORT"] : "";
- $url .= $_SERVER["REQUEST_URI"];
- $domain=$_SERVER["SERVER_NAME"];
- if(file_exists('configuration/key.cpatools')){
- $lic_key = file_get_contents($this->general_dir.'configuration/key.cpatools');
- }else{
- $lic_key = 'err:106';
- }
- $script_url=explode('?', $url);
- $script_url=$script_url[0];
- $this->script_url=$script_url;
- $this->lic_key=$lic_key;
- $this->domain=$domain;
- $this->domain=$domain;
- $this->timezone=3*3600;
- $this->timezone_2='+3';
- }
- function db_config(){
- $this->base='BASE_NAME';
- $this->password='PASS';
- $this->user='root';
- $this->host='localhost';
- $this->charset='UTF8';
- $this->collation='utf8_general_ci';
- $this->cache='0';
- }
- function template_config(){
- $this->template='standart';
- }
- function update_info(){
- if(file_exists('configuration/info.xml')){
- $info = file_get_contents($this->general_dir.'configuration/info.xml');
- }
- if(isset($info)){
- $update_info = new SimpleXMLElement($info);
- $arr['name']=$update_info->info->name.' '.$update_info->info->version.' ('.$update_info->info->date.')';
- $arr['version_name']=$update_info->info->version;
- $arr['version']=$update_info->update->version;
- $arr['date_update']=$update_info->update->date_update;
- }
- if(isset($arr)){
- $this->update_info = $arr;
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement