Skip to content
Snippets Groups Projects
Commit 19122ec4 authored by ale's avatar ale
Browse files

Remove obsolete fix-rewrites and set-readonly commands

The tool no longer has write access to .htaccess files.
parent ed181ab0
No related branches found
No related tags found
No related merge requests found
...@@ -44,9 +44,6 @@ Known commands: ...@@ -44,9 +44,6 @@ Known commands:
for a blog that is not local is dangerous! Use the 'on-local-blogs' for a blog that is not local is dangerous! Use the 'on-local-blogs'
wrapper. wrapper.
fix-rewrites BLOG [...]
Fix broken rewrite rules for the specified blogs. NOTE: dangerous!!!!
close-comments-if-inactive BLOG [...] close-comments-if-inactive BLOG [...]
Closes old posts for comments on non-active blogs. Closes old posts for comments on non-active blogs.
...@@ -61,10 +58,6 @@ Known commands: ...@@ -61,10 +58,6 @@ Known commands:
-mail sends email to ai-changes@investici.org -mail sends email to ai-changes@investici.org
-json print JSON output -json print JSON output
set-readonly on|off
Set read-only mode for the local noblogs installation. The argument
must be either the literal 'on' or 'off'.
ngg-convert BLOG ngg-convert BLOG
Convert Next Gen Gallery (NGG) photo galleries to stardard Wordpress Convert Next Gen Gallery (NGG) photo galleries to stardard Wordpress
galleries, and then notify (via email) admins of the fact. galleries, and then notify (via email) admins of the fact.
...@@ -205,7 +198,6 @@ function do_dump_shards($args) { ...@@ -205,7 +198,6 @@ function do_dump_shards($args) {
echo "\n"; echo "\n";
} }
// 'print-all-blogs': List all blog IDs. // 'print-all-blogs': List all blog IDs.
function do_print_all_blogs($args) { function do_print_all_blogs($args) {
$blogs = noblogs_get_blogs(); $blogs = noblogs_get_blogs();
...@@ -214,7 +206,6 @@ function do_print_all_blogs($args) { ...@@ -214,7 +206,6 @@ function do_print_all_blogs($args) {
} }
} }
// 'print-local-blogs': List the blog IDs that are local to this machine. // 'print-local-blogs': List the blog IDs that are local to this machine.
function do_print_local_blogs($args) { function do_print_local_blogs($args) {
$local_blogs = noblogs_get_local_blogs(); $local_blogs = noblogs_get_local_blogs();
...@@ -223,7 +214,6 @@ function do_print_local_blogs($args) { ...@@ -223,7 +214,6 @@ function do_print_local_blogs($args) {
} }
} }
// 'remove-network-upgrade-message': Remove the annoying "network // 'remove-network-upgrade-message': Remove the annoying "network
// upgrade necessary" banner from the dashboard. // upgrade necessary" banner from the dashboard.
function do_remove_network_upgrade_message($args) { function do_remove_network_upgrade_message($args) {
...@@ -231,7 +221,6 @@ function do_remove_network_upgrade_message($args) { ...@@ -231,7 +221,6 @@ function do_remove_network_upgrade_message($args) {
update_site_option('wpmu_upgrade_site', $wp_db_version); update_site_option('wpmu_upgrade_site', $wp_db_version);
} }
// 'check-upgrade': Check if a blog needs to be upgraded. // 'check-upgrade': Check if a blog needs to be upgraded.
function do_check_upgrade($args) { function do_check_upgrade($args) {
global $wp_db_version; global $wp_db_version;
...@@ -252,7 +241,6 @@ function do_check_upgrade($args) { ...@@ -252,7 +241,6 @@ function do_check_upgrade($args) {
} }
} }
// 'upgrade': Upgrade a blog. // 'upgrade': Upgrade a blog.
function do_upgrade($args) { function do_upgrade($args) {
//include(NOBLOGS_ROOT . "/wp-admin/includes/upgrade.php"); //include(NOBLOGS_ROOT . "/wp-admin/includes/upgrade.php");
...@@ -270,7 +258,6 @@ function do_upgrade($args) { ...@@ -270,7 +258,6 @@ function do_upgrade($args) {
} }
} }
// 'run-cron': Run cron jobs. // 'run-cron': Run cron jobs.
function do_run_cron($args) { function do_run_cron($args) {
foreach ($args as $arg) { foreach ($args as $arg) {
...@@ -286,25 +273,6 @@ function do_run_cron($args) { ...@@ -286,25 +273,6 @@ function do_run_cron($args) {
} }
} }
// 'fix-rewrites': Fix rewrite rules
function do_fix_rewrites($args) {
global $wp_rewrite;
foreach ($args as $arg) {
$blog = noblogs_get_blog($arg);
if (!$blog) {
echo "Blog {$arg} not found.\n";
continue;
}
switch_to_blog($blog->blog_id);
$wp_rewrite->init();
create_initial_taxonomies();
$wp_rewrite->flush_rules();
echo "{$arg}: ok\n";
restore_current_blog();
}
}
function do_check_spam($args) { function do_check_spam($args) {
global $wpdb; global $wpdb;
$spamcount = 0; $spamcount = 0;
...@@ -422,19 +390,6 @@ function do_check_updates($args) { ...@@ -422,19 +390,6 @@ function do_check_updates($args) {
} }
// 'set-readonly': toggle readonly mode by modifying .htaccess
function do_set_readonly($args) {
$htaccess = NOBLOGS_ROOT . '/.htaccess';
if ($args[0] == "on") {
comment_with_markers($htaccess, 'readonly', false);
} elseif ($args[0] == "off") {
comment_with_markers($htaccess, 'readonly', true);
} else {
print "Argument must be either 'on' or 'off'.";
}
}
function do_ngg_convert($args) { function do_ngg_convert($args) {
require_once(dirname(__FILE__) . '/ngg.php'); require_once(dirname(__FILE__) . '/ngg.php');
foreach ($args as $arg) { foreach ($args as $arg) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment