public function __construct($config = null) { parent::__construct($config); $this->pageview_event = $this->makeEvent(); $this->pageview_event->setEventType('base.page_request'); owa_coreAPI::registerStateStore('v', time() + 3600 * 24 * 365 * 10, '', 'assoc', 'cookie', true); owa_coreAPI::registerStateStore('s', time() + 3600 * 24 * 365 * 10, '', 'assoc', 'cookie', true); owa_coreAPI::registerStateStore('b', null, '', 'json', 'cookie', true); $cwindow = owa_coreAPI::getSetting('base', 'campaignAttributionWindow'); owa_coreAPI::registerStateStore('c', time() + 3600 * 24 * $cwindow, '', 'json', 'cookie', true); $this->organicSearchEngines = array(array('d' => 'google', 'q' => 'q'), array('d' => 'yahoo', 'q' => 'p'), array('d' => 'msn', 'q' => 'q'), array('d' => 'bing', 'q' => 'q'), array('d' => 'images.google', 'q' => 'q'), array('d' => 'images.search.yahoo.com', 'q' => 'p'), array('d' => 'aol', 'q' => 'query'), array('d' => 'aol', 'q' => 'encquery'), array('d' => 'aol', 'q' => 'q'), array('d' => 'lycos', 'q' => 'query'), array('d' => 'ask', 'q' => 'q'), array('d' => 'altavista', 'q' => 'q'), array('d' => 'netscape', 'q' => 'query'), array('d' => 'cnn', 'q' => 'query'), array('d' => 'about', 'q' => 'terms'), array('d' => 'mamma', 'q' => 'q'), array('d' => 'daum', 'q' => 'q'), array('d' => 'eniro', 'q' => 'search_word'), array('d' => 'naver', 'q' => 'query'), array('d' => 'pchome', 'q' => 'q'), array('d' => 'alltheweb', 'q' => 'q'), array('d' => 'voila', 'q' => 'rdata'), array('d' => 'virgilio', 'q' => 'qs'), array('d' => 'live', 'q' => 'q'), array('d' => 'baidu', 'q' => 'wd'), array('d' => 'alice', 'q' => 'qs'), array('d' => 'yandex', 'q' => 'text'), array('d' => 'najdi', 'q' => 'q'), array('d' => 'mama', 'q' => 'query'), array('d' => 'seznam', 'q' => 'q'), array('d' => 'search', 'q' => 'q'), array('d' => 'wp', 'q' => 'szukaj'), array('d' => 'onet', 'q' => 'qt'), array('d' => 'szukacz', 'q' => 'q'), array('d' => 'yam', 'q' => 'k'), array('d' => 'kvasir', 'q' => 'q'), array('d' => 'sesam', 'q' => 'q'), array('d' => 'ozu', 'q' => 'q'), array('d' => 'terra', 'q' => 'query'), array('d' => 'mynet', 'q' => 'q'), array('d' => 'ekolay', 'q' => 'q'), array('d' => 'rambler', 'q' => 'query'), array('d' => 'rambler', 'q' => 'words')); }
} elseif (!empty($argv)) { $params = array(); // get params from the command line args // $argv is a php super global variable for ($i = 1; $i < count($argv); $i++) { $it = explode("=", $argv[$i]); $params[$it[0]] = $it[1]; } unset($params['action']); unset($params['do']); } else { // No params found exit; } // Initialize owa $owa = new owa_caller(); if ($owa->isEndpointEnabled(basename(__FILE__))) { // setting CLI mode to true $owa->setSetting('base', 'cli_mode', true); // setting user auth $owa->setCurrentUser('admin', 'cli-user'); // run controller or view and echo page content $s = owa_coreAPI::serviceSingleton(); $s->loadCliCommands(); if (array_key_exists('cmd', $params)) { $cmd = $s->getCliCommandClass($params['cmd']); if ($cmd) { $params['do'] = $cmd; echo $owa->handleRequest($params); } else { echo "Invalid command name.";