-require_once("boot.php");
-require_once("include/socgraph.php");
-
-function discover_poco_run(&$argv, &$argc){
- global $a, $db;
-
- if(is_null($a)) {
- $a = new App;
- }
-
- if(is_null($db)) {
- @include(".htconfig.php");
- require_once("include/dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
- unset($db_host, $db_user, $db_pass, $db_data);
- };
-
- require_once('include/session.php');
- require_once('include/datetime.php');
-
- Config::load();
-
- // Don't check this stuff if the function is called by the poller
- if (App::callstack() != "poller_run")
- if ($a->maxload_reached())
- return;
-
- if(($argc > 2) && ($argv[1] == "dirsearch")) {
+require_once('include/socgraph.php');
+require_once('include/datetime.php');
+
+function discover_poco_run(&$argv, &$argc) {
+
+ /*
+ This function can be called in these ways:
+ - dirsearch <search pattern>: Searches for "search pattern" in the directory. "search pattern" is url encoded.
+ - checkcontact: Updates gcontact entries
+ - suggestions: Discover other servers for their contacts.
+ - server <poco url>: Searches for the poco server list. "poco url" is base64 encoded.
+ - update_server: Frequently check the first 250 servers for vitality.
+ - update_server_directory: Discover the given server id for their contacts
+ - poco_load: Load POCO data from a given POCO address
+ */
+
+ if (($argc > 2) && ($argv[1] == "dirsearch")) {