Skip to content
Snippets Groups Projects
Commit 399bbfe7 authored by lucha's avatar lucha
Browse files

command to fix cdn config

parent db32f537
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -75,6 +75,9 @@ Known commands:
https-siteurl BLOG
Adds https (instead of http) to siteurl and home options.
fix-cdn BLOG
Sets the correct CDN config.
<?php
exit(1);
}
......@@ -469,6 +472,35 @@ function do_https_siteurl($args){
}
}
// rewrites the correct settings for the CDN
function do_fix_cdn($args){
$config = array(
'ossdl_off_cdn_url' => "https://noblogs.ai-cdn.net",
'ossdl_off_include_dirs' => "wp-content,wp-includes",
'ossdl_off_exclude' => ".php, blogs.dir",
);
foreach ($args as $arg) {
$blog = noblogs_get_blog($arg);
if (!$blog) {
echo "{$arg}: blog not found.\n";
continue;
}
switch_to_blog($blog->blog_id);
foreach ($config as $opt => $new){
$old = get_option($opt);
if ($old === $new){
continue;
}
update_option($opt,$new);
}
echo "{$arg}\n";
restore_current_blog();
}
}
// Command-line parsing.
$cmd = $argv[1];
if (!$cmd) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment