Exemple #1
0
 fix_htaccess();
 remove_beginning_slash_from_post_url();
 move_yml_yaml();
 update_protection();
 theme_default_to_stardust();
 Config::fallback("routes", array());
 Config::fallback("secure_hashkey", md5(random(32, true)));
 Config::fallback("enable_xmlrpc", true);
 Config::fallback("enable_ajax", true);
 Config::fallback("uploads_path", "/uploads/");
 Config::fallback("chyrp_url", Config::get("url"));
 Config::fallback("sql", Config::$yaml["database"]);
 Config::fallback("timezone", "America/Indiana/Indianapolis");
 Config::remove("rss_posts");
 Config::remove("time_offset");
 move_upload();
 remove_database_config_file();
 rename_database_setting_to_sql();
 update_custom_routes();
 default_db_adapter_to_mysql();
 # Perform database upgrade tasks after all the files/config upgrade tasks are done.
 # Prepare the SQL interface.
 $sql = SQL::current();
 # Set the SQL info.
 foreach (Config::$yaml["config"]["sql"] as $name => $value) {
     $sql->{$name} = $value;
 }
 # Initialize connection to SQL server.
 $sql->connect();
 tweets_to_posts();
 pages_parent_id_column();
Exemple #2
0
 //logit('ontv basis '.$year_start.'/'.$year_end.' versie '.$version);
 if (mdb2_single_val("SELECT rooster_id FROM roosters WHERE week_id = %i", $_POST['week_id']) && isset($_POST['overwrite']) && $_POST['overwrite'] != 'true') {
     fatal_error("er staat al een basisrooster in deze week, vink de checkbox aan als je wilt overschrijven");
 }
 $md5 = calc_md5($_FILES['uploadedfile']['tmp_name']);
 $file_id = get_file_id($md5, 1, 1);
 $week = mdb2_single_val("SELECT week FROM weken WHERE week_id = %i", $_POST['week_id']);
 if (!$file_id) {
     $file_id = get_file_id($md5, 1, 0);
     if ($file_id) {
         logit('dit basisrooster kennen we al, maar de import is eerder mis gegaan');
     } else {
         mdb2_exec("INSERT INTO files ( file_name, file_md5, file_time, file_type, file_status, file_version ) VALUES ( '%q', '{$md5}', %i, 1, 0, {$version} )", $filename, time());
         $file_id = get_file_id($md5, 1, 0);
     }
     $new_filename = move_upload('basis', $md5, $week);
     import_basisrooster($file_id, $new_filename);
     $status = mdb2_single_val("SELECT file_status FROM files WHERE file_id = {$file_id}");
     if (!$status) {
         fatal_error('de import is fout gegaan, we kunnen dit rooster niet publiceren :(, mail snelr@ovc.nl');
     }
     //logit('import succesvol, nu nog koppelen aan weken');
 } else {
     //logit('file was al succesvol geimporteerd');
 }
 $basis_id = mdb2_single_val("SELECT MAX(basis_id) FROM roosters");
 if (!$basis_id) {
     $basis_id = 0;
 }
 // fixme, controleer of deze upload invloed heeft op de roosters
 // als er op geen enkel rooster invloed heeft (dit is het huidige basisrooster voor alle weken waarop deze upload van toepassing is en in geen enkele week