function daemon() { global $argv, $title; $sphinx = new Sphinx(); printf("%s", $title); if (isWindows()) { if (strpos($argv[2], "--stop") !== false) { runCmd("net stop sphinxsearch", true); } else { runCmd("net start sphinxsearch", true); } } else { $search = $sphinx->getSphinxBinPath("searchd"); $cmd = sprintf("%s %s", $search, implode(' ', array_slice($argv, 2))); passthru($cmd); } return true; }