function _executeSqlStatements($file, $name) { $db_corrupted = false; $path_found = false; $path_to_file = '/' . $name . '/db/' . $file . '.sql'; $possible_file_names = array($GLOBALS['sys_pluginsroot'] . $path_to_file, $GLOBALS['sys_custompluginsroot'] . $path_to_file); while (!$path_found && (list(, $sql_filename) = each($possible_file_names))) { if (file_exists($sql_filename)) { $dbtables = new DBTablesDAO(CodendiDataAccess::instance()); if (!$dbtables->updateFromFile($sql_filename)) { $db_corrupted = true; } } } return $db_corrupted; }
private function installPlugin() { $dbtables = new DBTablesDAO(); $dbtables->updateFromFile(dirname(__FILE__) . '/../../db/install.sql'); }
function _executeSqlStatements($file, $name) { $db_corrupted = false; $path_to_file = '/' . $name . '/db/' . $file . '.sql'; foreach ($this->plugin_factory->getAllPossiblePluginsDir() as $dir) { $sql_filename = $dir . $path_to_file; if (file_exists($sql_filename)) { $dbtables = new DBTablesDAO(); if (!$dbtables->updateFromFile($sql_filename)) { $db_corrupted = true; } } } return $db_corrupted; }