コード例 #1
0
 /**
  *
  */
 public function __construct()
 {
     $this->Register = Register::getInstance();
     $this->setPhpSettings();
     $this->touchStartTime();
     $this->Register['Cache'] = new Cache();
     $viewerLoader = new Fps_Viewer_Loader(array('template_root' => ROOT . '/template/' . getTemplateName() . '/html/'));
     $this->Register['Viewer'] = new Fps_Viewer_Manager($viewerLoader);
     if (isInstall()) {
         $this->registerCustomTemplateFunctions();
         $this->Register['DB'] = class_exists('PDO') && Config::read('use_pdo') ? FpsPDO::get() : FpsDataBase::get();
         $this->Register['UserAuth'] = new UserAuth();
         $this->Register['Log'] = new Logination();
     }
     $this->Register['DocParser'] = new Document_Parser();
     $this->Register['ACL'] = new ACL(ROOT . '/sys/settings/');
     $this->Register['PrintText'] = new PrintText();
     $this->Register['Validate'] = new Validate(function ($errors) {
         $Register = Register::getInstance();
         return $Register['DocParser']->wrapErrors($errors);
     });
     $this->Register['ModManager'] = new ModulesManager(ROOT . '/sys/settings/modules_access.php');
     $this->Register['PluginController'] = new Plugins();
     $this->Register['URL'] = new AtmUrl();
     $this->Register['Protector'] = new Protect();
     if (isInstall()) {
         $this->inputCheck();
         $this->initProtect();
         $this->initUser();
         $this->loadLanguages();
     }
 }
コード例 #2
0
## CMS AtomX или ее частей,                     ##
## без согласия автора, является не законным    ##
##################################################
@ini_set('display_errors', 1);
session_start();
define('ROOT', dirname(dirname(__FILE__)));
if (function_exists('set_time_limit')) {
    set_time_limit(0);
}
include_once '../sys/boot.php';
$errors = array();
new Config('../sys/settings/config.php');
$set = Config::read('all');
if (class_exists('PDO')) {
    include_once '../sys/inc/fpspdo.class.php';
    $DB = FpsPDO::get();
} else {
    include_once '../sys/inc/fpsdatabase.class.php';
    $DB = FpsDataBase::get();
}
$array = array();
$array[] = "DROP TABLE IF EXISTS `{$set['db']['prefix']}forum_cat`";
$array[] = "CREATE TABLE `{$set['db']['prefix']}forum_cat` (\n  `id` int(11) NOT NULL auto_increment,\n  `title` varchar(255) collate utf8_general_ci default NULL,\n  `previev_id` int(11) NOT NULL,\n  PRIMARY KEY  (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci";
$array[] = "INSERT INTO `{$set['db']['prefix']}forum_cat` VALUES (1, 'TEST', 1)";
#####################################################################
$array[] = "DROP TABLE IF EXISTS `{$set['db']['prefix']}forums`";
$array[] = "CREATE TABLE `{$set['db']['prefix']}forums` (\n  `id` int(6) NOT NULL auto_increment,\n  `title` text character set utf8,\n  `description` mediumtext character set utf8,\n  `pos` smallint(6) NOT NULL default '0',\n  `in_cat` int(11) default NULL,\n  `last_theme_id` int(11) NOT NULL default 0,\n  `themes` int(11) default '0',\n  `posts` int(11) NOT NULL default '0',\n  `parent_forum_id` INT(11),\n  `lock_posts` INT( 11 ) DEFAULT '0' NOT NULL,\n  `lock_passwd` VARCHAR( 100 ) NOT NULL default 0,\n  PRIMARY KEY  (`id`),\n  INDEX (`in_cat`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci";
$array[] = "INSERT INTO `{$set['db']['prefix']}forums` (`title`, `description`, `pos`, `in_cat`) VALUES ('TEST', 'тестовый форум', 1, 1)";
#####################################################################
$array[] = "DROP TABLE IF EXISTS `{$set['db']['prefix']}forum_attaches`";
$array[] = "CREATE TABLE `{$set['db']['prefix']}forum_attaches` (\n\t`id` INT NOT NULL AUTO_INCREMENT ,\n\t`post_id` INT NOT NULL default '0',\n\t`theme_id` INT NOT NULL default '0',\n\t`user_id` INT NOT NULL ,\n\t`attach_number` INT NOT NULL default '0',\n\t`filename` VARCHAR( 100 ) NOT NULL ,\n\t`size` BIGINT NOT NULL ,\n\t`date` DATETIME NOT NULL ,\n\t`is_image` ENUM( '0', '1' ) DEFAULT '0' NOT NULL ,\n\tPRIMARY KEY ( `id` ),\n\tINDEX (`post_id`, `user_id`)\n) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;";
コード例 #3
0
 /**
  * Uses for singlton
  * Allow initialize only one object
  */
 public static function get()
 {
     if (!self::$instance) {
         self::$instance = new FpsPDO();
     }
     return self::$instance;
 }