<?php require "lib/localresource.php"; $url = "http://" . $_SERVER['SERVER_NAME'] . "/" . $_SERVER['REQUEST_URI']; $file = __FILE__; $here = new LocalResource($url, $file); $console = $here->base()->get("/bazdig/console/")->url; header("Location: {$console}", true, 307);
<?php require 'lib/localresource.php'; $url = "http://" . $_SERVER['SERVER_NAME'] . "/" . $_SERVER['REQUEST_URI']; $file = $_SERVER['SCRIPT_FILENAME']; $here = new LocalResource($url, $file); $root = $here->base()->get(ROOT); $ini['db'] = "sqlite:" . $root->file . "/test/waraq.db"; $ini['db.user'] = ""; $ini['db.password'] = "";
<?php define('WARAQ_CLASSPATH', realpath(WARAQ_ROOT) . "/lib"); set_include_path(get_include_path() . PATH_SEPARATOR . WARAQ_CLASSPATH); ini_set("session.save_path", realpath(WARAQ_ROOT)); require_once "waraqservice.php"; $url = "http://" . $_SERVER['SERVER_NAME'] . "/" . str_trunkate($_SERVER['REQUEST_URI'], '?'); $file = $_SERVER['SCRIPT_FILENAME']; $requestedService = new LocalResource($url, $file); $bazdigService = $requestedService->base()->get(WARAQ_ROOT . '/bazdig'); $GLOBALS['bazdig'] = new WaraqService($bazdigService->url, $bazdigService->file); $bazdig =& $GLOBALS['bazdig']; $bazdig->setparam("db", $bazdig->get('/bazdig.db')); function firstWord($string) { $string = trim($string); return str_trunkate($string, ' '); } function str_trunkate($haystack, $needle) { if (!($pos = strpos($haystack, $needle))) { return $haystack; } return substr($haystack, 0, $pos); }
<?php require "../lib/localresource.php"; $url = "http://" . $_SERVER['SERVER_NAME'] . "/" . $_SERVER['REQUEST_URI']; $file = $_SERVER['SCRIPT_FILENAME']; $here = new LocalResource($url, $file); $service = $here->base()->get('/../'); ?> function search_bashoola(){ this.name = "bashoola"; this.aliases = new Array("bashoola","bash", "sh"); this.mode = true; this.help = "execute bash commands"; this.call = function(args){ this.start = 0; this.query(args.join(" ")); } this.query = function(A) { var serviceUrl = "<?php echo $service->url; ?> "; ajaxquery(serviceUrl+"?&callback=searchers_"+this.name+".render&c="+encodeURIComponent(A)); } this.render = function(context, results){ if (iscontext(context)) { output.innerHTML+=results;