function display_help() { $boost_info = plugin_boost_version(); print "Boost RRD Updater Process Control Version " . $boost_info["version"] . ", Copyright 2005-2010 - Larry Adams\n\n"; print "usage: poller_boost.php [-f | --force] [-d | --debug] [-h | -H | --help] [-v | -V | --version]\n\n"; print "-f | --force - Force the execution of a update process\n"; print "-v | --verbose - Show details logs at the command line\n"; print "-d | --debug - Display verbose output during execution\n"; print "-V | --version - Display this help message\n"; print "-h -H --help - display this help message\n"; }
function boost_check_upgrade() { global $config; $files = array('index.php', 'plugins.php'); if (isset($_SERVER['PHP_SELF']) && !in_array(basename($_SERVER['PHP_SELF']), $files)) { return; } $current = plugin_boost_version(); $current = $current['version']; $old = db_fetch_row("SELECT * FROM plugin_config WHERE directory='boost'"); if (sizeof($old) && $current != $old["version"]) { /* if the plugin is installed and/or active */ if ($old["status"] == 1 || $old["status"] == 4) { /* re-register the hooks */ plugin_boost_install(); /* perform a database upgrade */ boost_database_upgrade(); } /* update the plugin information */ $info = plugin_boost_version(); $id = db_fetch_cell("SELECT id FROM plugin_config WHERE directory='boost'"); db_execute("UPDATE plugin_config\r\n\t\t\tSET name='" . $info["longname"] . "',\r\n\t\t\tauthor='" . $info["author"] . "',\r\n\t\t\twebpage='" . $info["homepage"] . "',\r\n\t\t\tversion='" . $info["version"] . "'\r\n\t\t\tWHERE id='{$id}'"); } if ($old < 5.0) { boost_recreate_output_table_indexes(); } }