예제 #1
0
 function sqlFromFile($path)
 {
     return SQLFile::splitSQL(file_get_contents($path));
 }
예제 #2
0
 /**
  * applies queries to the database
  * @return
  * @param $filename Object
  */
 function applySQL($filename)
 {
     global $default;
     DBUtil::setupAdminDatabase();
     $db = $default->_admindb;
     $content = file_get_contents($filename);
     $aQueries = SQLFile::splitSQL($content);
     DBUtil::startTransaction();
     foreach ($aQueries as $sQuery) {
         $res = DBUtil::runQuery($sQuery, $db);
         if (PEAR::isError($res)) {
             continue;
         }
     }
     DBUtil::commit();
 }