. /** * url_finder cli script. Examines DB for non-https src or data links, and replaces them. * * @package tool_httpsreplace * @copyright Copyright (c) 2016 Blackboard Inc. (http://www.blackboard.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define('CLI_SCRIPT', true); require(__DIR__ . '/../../../../config.php'); require_once($CFG->libdir.'/clilib.php'); list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help')); if ($unrecognized) { $unrecognized = implode("\n ", $unrecognized); cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2); } if ($options['help']) { $help = "Replaces http urls with https across a site's content Options: -h, --help Print out this help Example: \$sudo -u www-data /usr/bin/php admin/tool/httpsreplace/cli/url_replace.php \n"; echo $help; exit(0); } $urlfinder = new \tool_httpsreplace\url_finder(); $urlfinder->upgrade_http_links();