Skip to content

Commit

Permalink
- adding form validation framework
Browse files Browse the repository at this point in the history
- refactored settings/config into real object
- added modules roster and stub for activate/deactivate
  • Loading branch information
padams committed Feb 5, 2007
1 parent dad3177 commit 88efd2d
Show file tree
Hide file tree
Showing 91 changed files with 4,155 additions and 3,638 deletions.
9 changes: 3 additions & 6 deletions asyncEventProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
// $Id$
//

require_once 'owa_settings_class.php';
require_once 'owa_lib.php';
require_once 'owa_env.php';
require_once 'eventQueue.php';
require_once (OWA_PEARLOG_DIR . '/Log.php');
require_once 'owa_session_class.php';
require_once 'owa_request_class.php';
//require_once (OWA_PEARLOG_DIR . '/Log.php');
require_once 'owa_caller.php';
require_once('owa_db.php');


/**
* Asynchronous Event Processsor
Expand Down Expand Up @@ -86,7 +83,7 @@ function asyncEventProcessor($config = null) {
// Turns off async setting so that the proper event queue is created
$this->config['async_db'] = false;
$this->eq = &eventQueue::get_instance();
$this->db = &owa_db::get_instance();
$this->db = &owa_coreAPI::dbSingleton();

// Create Error Logger - NEEDED?
$conf = array('mode' => 640, 'timeFormat' => '%X %x');
Expand Down
215 changes: 108 additions & 107 deletions eventQueue.php
Original file line number Diff line number Diff line change
@@ -1,107 +1,108 @@
<?php

//
// Open Web Analytics - An Open Source Web Analytics Framework
//
// Copyright 2006 Peter Adams. All rights reserved.
//
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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$
//

require_once OWA_PEARLOG_DIR . '/Log.php';
require_once OWA_PLUGINS_DIR . '/log/queue.php';
require_once OWA_PLUGINS_DIR . '/log/async_queue.php';
require_once 'owa_observer.php';

/**
* Event Queue
*
* @author Peter Adams <[email protected]>
* @copyright Copyright &copy; 2006 Peter Adams <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
* @category owa
* @package owa
* @version $Revision$
* @since owa 1.0.0
*/
class eventQueue {

/**
* Configuration
*
* @var array
*/
var $config;

/**
* Constructor
*
* @return eventQueue
*/
function eventQueue() {

return;
}

/**
* Event Queue factory
* @static
* @return object
* @access public
*/
function &get_instance() {

static $eq;

$this->config = &owa_settings::get_settings();

if (!isset($eq)):
// Create an async event queue
if ($this->config['async_db'] == true):
$conf = array('mode' => 0600, 'timeFormat' => '%X %x');
$eq = &Log::singleton('async_queue', $this->config['async_log_dir'].$this->config['async_log_file'], 'async_event_queue', $conf);
$eq->_lineFormat = '%1$s|*|%2$s|*|[%3$s]|*|%4$s|*|%5$s';
// not sure why this is needed but it is.
$eq->_filename = $this->config['async_log_dir'].$this->config['async_log_file'];

// This observer will watch the queue and exec a new php process that will process the events
require_once(OWA_PLUGINS_DIR.'/event_handlers/async/observer_async_helper.php');
$async_helper = &owa_observer::factory('async_helper', PEAR_LOG_INFO);
$eq->attach($async_helper);

else:
//Create a normal event queue using 'queue' which is an extension to PEAR LOG.
$eq = Log::singleton('queue', '', 'event_queue');

/* if ($dir = @opendir(OWA_PLUGINS_DIR.'/event_handlers')):
while (($file = @readdir($dir)) !== false) {
if (strstr($file, '.php') &&
substr($file, -1, 1) != "~" &&
substr($file, 0, 1) != "#"):
require_once(OWA_PLUGINS_DIR.'/event_handlers/'.$file);
$class = substr($file, 9, -4);
$plugin_name = &owa_observer::factory($class, PEAR_LOG_INFO);
$eq->attach($plugin_name);
endif;
}
@closedir($dir);
endif; */
endif;
endif;

return $eq;
}

}

?>
<?php

//
// Open Web Analytics - An Open Source Web Analytics Framework
//
// Copyright 2006 Peter Adams. All rights reserved.
//
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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$
//

require_once OWA_PEARLOG_DIR . '/Log.php';
require_once OWA_PLUGINS_DIR . '/log/queue.php';
require_once OWA_PLUGINS_DIR . '/log/async_queue.php';
require_once 'owa_observer.php';

/**
* Event Queue
*
* @author Peter Adams <[email protected]>
* @copyright Copyright &copy; 2006 Peter Adams <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
* @category owa
* @package owa
* @version $Revision$
* @since owa 1.0.0
*/
class eventQueue {

/**
* Configuration
*
* @var array
*/
var $config;

/**
* Constructor
*
* @return eventQueue
*/
function eventQueue() {

return;
}

/**
* Event Queue factory
* @static
* @return object
* @access public
*/
function &get_instance() {

static $eq;

$c = &owa_coreAPI::configSingleton();
$this->config = $c->fetch('base');

if (!isset($eq)):
// Create an async event queue
if ($this->config['async_db'] == true):
$conf = array('mode' => 0600, 'timeFormat' => '%X %x');
$eq = &Log::singleton('async_queue', $this->config['async_log_dir'].$this->config['async_log_file'], 'async_event_queue', $conf);
$eq->_lineFormat = '%1$s|*|%2$s|*|[%3$s]|*|%4$s|*|%5$s';
// not sure why this is needed but it is.
$eq->_filename = $this->config['async_log_dir'].$this->config['async_log_file'];

// This observer will watch the queue and exec a new php process that will process the events
require_once(OWA_PLUGINS_DIR.'/event_handlers/async/observer_async_helper.php');
$async_helper = &owa_observer::factory('async_helper', PEAR_LOG_INFO);
$eq->attach($async_helper);

else:
//Create a normal event queue using 'queue' which is an extension to PEAR LOG.
$eq = Log::singleton('queue', '', 'event_queue');

/* if ($dir = @opendir(OWA_PLUGINS_DIR.'/event_handlers')):
while (($file = @readdir($dir)) !== false) {
if (strstr($file, '.php') &&
substr($file, -1, 1) != "~" &&
substr($file, 0, 1) != "#"):
require_once(OWA_PLUGINS_DIR.'/event_handlers/'.$file);
$class = substr($file, 9, -4);
$plugin_name = &owa_observer::factory($class, PEAR_LOG_INFO);
$eq->attach($plugin_name);
endif;
}
@closedir($dir);
endif; */
endif;
endif;

return $eq;
}

}

?>
Loading

0 comments on commit 88efd2d

Please sign in to comment.