Ejemplo n.º 1
0
 public function createdb()
 {
     if (!$this->dropdb()) {
         return false;
     }
     if (!$this->db->query(repository::sql())) {
         return false;
     }
     if (!$this->db->query(package::sql())) {
         return false;
     }
     if (!$this->db->query(filelist::sql())) {
         return false;
     }
     if (!$this->db->query(guestbook::sql())) {
         return false;
     }
     if (!$this->db->query("\n\t\t  CREATE TABLE IF NOT EXISTS #__mixed (\n\t\t    field VARCHAR( 255 ) NOT NULL ,\n                    value VARCHAR( 255 ) NULL ,\n                    PRIMARY KEY ( field )\n\t\t  ) ENGINE = MyISAM;\n\t\t")) {
         return false;
     }
     if (!$this->db->query("\n\t\t  CREATE TABLE IF NOT EXISTS #__searches (\n\t\t    dt    DATETIME,\n\t\t    sname VARCHAR(50),\n\t\t    sdesc VARCHAR(50),\n\t\t    sfile VARCHAR(50),\n\t\t    ip    VARCHAR(15),\n\t\t    srepo INT,\n\t\t    results INT,\n\t\t    duration INT\n\t\t  ) ENGINE = MyISAM;\n\t        ")) {
         return false;
     }
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_visits','1');");
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_searches','1');");
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_srctxt','1');");
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_srcxml','1');");
     return true;
 }