Exemplo n.º 1
0
/**
 * Install Page Wrapper Script
 * 
 * @author      Peter Adams <*****@*****.**>
 * @copyright   Copyright &copy; 2006 Peter Adams <*****@*****.**>
 * @license     http://www.gnu.org/copyleft/gpl.html GPL v2.0
 * @category    owa
 * @package     owa
 * @version		$Revision$	      
 * @since		owa 1.0.0
 */
// Initialize owa
//define('OWA_ERROR_HANDLER', 'development');
define('OWA_CACHE_OBJECTS', false);
define('OWA_INSTALLING', true);
$owa = new owa_php();
if ($owa->isEndpointEnabled(basename(__FILE__))) {
    // need third param here so that seting is not persisted.
    $owa->setSetting('base', 'main_url', 'install.php');
    // run controller, echo page content
    $do = owa_coreAPI::getRequestParam('do');
    $params = array();
    if (empty($do)) {
        $params['do'] = 'base.installStart';
    }
    // run controller or view and echo page content
    echo $owa->handleRequest($params);
} else {
    // unload owa
    $owa->restInPeace();
}
Exemplo n.º 2
0
// See the License for the specific language governing permissions and
// limitations under the License.
//
// $Id$
//
require_once 'owa_env.php';
require_once OWA_DIR . 'owa_php.php';
/**
 * Main Admin Page Wrapper Script
 * 
 * @author      Peter Adams <*****@*****.**>
 * @copyright   Copyright &copy; 2006 Peter Adams <*****@*****.**>
 * @license     http://www.gnu.org/copyleft/gpl.html GPL v2.0
 * @category    owa
 * @package     owa
 * @version		$Revision$	      
 * @since		owa 1.0.0
 */
// Initialize owa admin
$owa = new owa_php();
if (!$owa->isOwaInstalled()) {
    // redirect to install
    owa_lib::redirectBrowser(owa_coreAPI::getSetting('base', 'public_url') . 'install.php');
}
if ($owa->isEndpointEnabled(basename(__FILE__))) {
    // run controller or view and echo page content
    echo $owa->handleRequestFromURL();
} else {
    // unload owa
    $owa->restInPeace();
}
Exemplo n.º 3
0
ignore_user_abort(true);
set_time_limit(180);
include_once 'owa_env.php';
require_once OWA_BASE_DIR . '/owa_php.php';
/**
 * Remote Event Queue Endpoint
 * 
 * @author      Peter Adams <*****@*****.**>
 * @copyright   Copyright &copy; 2006 Peter Adams <*****@*****.**>
 * @license     http://www.gnu.org/copyleft/gpl.html GPL v2.0
 * @category    owa
 * @package     owa
 * @version		$Revision$	      
 * @since		owa 1.3.0
 */
$owa = new owa_php();
if ($owa->isEndpointEnabled(basename(__FILE__))) {
    $owa->setSetting('base', 'is_remote_event_queue', true);
    $owa->e->debug('post: ' . print_r($_POST, true));
    $raw_event = owa_coreAPI::getRequestParam('event');
    if ($raw_event) {
        $dispatch = owa_coreAPI::getEventDispatch();
        $event = $dispatch->makeEvent();
        $event->loadFromArray($raw_event);
        $owa->e->debug(print_r($event, true));
        $dispatch->asyncNotify($event);
    }
} else {
    // unload owa
    $owa->restInPeace();
}
Exemplo n.º 4
0
// $Id$
//
/**
 * OWA Daemon
 * 
 * @author      Peter Adams <*****@*****.**>
 * @copyright   Copyright &copy; 2006-2011 Peter Adams <*****@*****.**>
 * @license     http://www.gnu.org/copyleft/gpl.html GPL v2.0
 * @category    owa
 * @package     owa
 * @version		$Revision$	      
 * @since		owa 1.4.0
 */
require_once 'owa_env.php';
require_once OWA_DIR . 'owa_php.php';
require_once OWA_BASE_CLASS_DIR . 'daemon.php';
define('OWA_DAEMON', true);
if (!empty($_POST)) {
    exit;
} elseif (!empty($_GET)) {
    exit;
}
$owa = new owa_php();
if ($owa->isEndpointEnabled(basename(__FILE__))) {
    // start daemon
    $daemon = new owa_daemon();
    $daemon->start();
} else {
    // unload owa
    $owa->restInPeace();
}
Exemplo n.º 5
0
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// $Id$
//
include_once 'owa_env.php';
require_once OWA_BASE_DIR . '/owa_php.php';
/**
 * REST API
 * 
 * @author      Peter Adams <*****@*****.**>
 * @copyright   Copyright &copy; 2010 Peter Adams <*****@*****.**>
 * @license     http://www.gnu.org/copyleft/gpl.html GPL v2.0
 * @category    owa
 * @package     owa
 * @version		$Revision$	      
 * @since		owa 1.3.0
 * @link		http://wiki.openwebanalytics.com/index.php?title=REST_API
 */
// define entry point cnstant
define('OWA_API', true);
// invoke OWA
$owa = new owa_php();
if ($owa->isEndpointEnabled(basename(__FILE__))) {
    // run api command and echo page content
    echo $owa->handleRequest('', 'base.apiRequest');
} else {
    // unload owa
    $owa->restInPeace();
}
Exemplo n.º 6
0
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // redirect to blank.php
    owa_lib::redirectBrowser(str_replace('log.php', 'blank.php', owa_lib::get_current_url()));
    // necessary or else buffer is not actually flushed
    echo ' ';
} else {
    // return 1x1 pixel gif
    header("Content-type: image/gif");
    // needed to avoid cache time on browser side
    header("Content-Length: 42");
    header("Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate");
    header("Expires: Wed, 11 Jan 2000 12:59:00 GMT");
    header("Last-Modified: Wed, 11 Jan 2006 12:59:00 GMT");
    header("Pragma: no-cache");
    echo sprintf('%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%', 71, 73, 70, 56, 57, 97, 1, 0, 1, 0, 128, 255, 0, 192, 192, 192, 0, 0, 0, 33, 249, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59);
}
// flush all output buffers. No reason to make the user wait for OWA.
ob_flush();
flush();
ob_end_flush();
// Create instance of OWA
require_once OWA_BASE_DIR . '/owa_php.php';
$owa = new owa_php();
// check to see if this endpoint is enabled.
if ($owa->isEndpointEnabled(basename(__FILE__))) {
    $owa->e->debug('Logging new tracking event from request.');
    $owa->logEventFromUrl();
} else {
    // unload owa
    $owa->restInPeace();
}