Changeset 498
- Timestamp:
- 06/08/08 02:04:56 (7 months ago)
- Location:
- trunk
- Files:
-
- 10 added
- 53 modified
-
asyncEventProcessor.php (modified) (3 diffs)
-
conf/messages.php (modified) (2 diffs)
-
eventQueue.php (modified) (1 diff)
-
modules/base/classes/column.php (modified) (1 diff)
-
modules/base/classes/entityManager.php (modified) (2 diffs)
-
modules/base/classes/error.php (modified) (2 diffs)
-
modules/base/classes/event.php (modified) (2 diffs)
-
modules/base/classes/settings.php (modified) (1 diff)
-
modules/base/classes/update.php (added)
-
modules/base/classes/userManager.php (modified) (1 diff)
-
modules/base/entities/click.php (modified) (1 diff)
-
modules/base/entities/configuration.php (modified) (1 diff)
-
modules/base/entities/document.php (modified) (1 diff)
-
modules/base/entities/exit.php (added)
-
modules/base/entities/feed_request.php (modified) (1 diff)
-
modules/base/entities/host.php (modified) (1 diff)
-
modules/base/entities/impression.php (added)
-
modules/base/entities/os.php (added)
-
modules/base/entities/referer.php (modified) (1 diff)
-
modules/base/entities/request.php (modified) (1 diff)
-
modules/base/entities/session.php (modified) (1 diff)
-
modules/base/entities/site.php (modified) (1 diff)
-
modules/base/entities/ua.php (modified) (1 diff)
-
modules/base/entities/user.php (modified) (2 diffs)
-
modules/base/entities/visitor.php (modified) (1 diff)
-
modules/base/installEmbedded.php (modified) (1 diff)
-
modules/base/installStart.php (modified) (2 diffs)
-
modules/base/login.php (modified) (1 diff)
-
modules/base/module.php (modified) (3 diffs)
-
modules/base/optionsFlushCache.php (modified) (1 diff)
-
modules/base/optionsGeneral.php (modified) (3 diffs)
-
modules/base/optionsReset.php (modified) (2 diffs)
-
modules/base/optionsUpdate.php (modified) (2 diffs)
-
modules/base/sites.php (modified) (1 diff)
-
modules/base/templates/header.tpl (modified) (1 diff)
-
modules/base/templates/news.tpl (modified) (1 diff)
-
modules/base/templates/options_general.tpl (modified) (1 diff)
-
modules/base/templates/updates.tpl (added)
-
modules/base/templates/wrapper_default.tpl (modified) (1 diff)
-
modules/base/templates/wrapper_gallery2.tpl (modified) (1 diff)
-
modules/base/templates/wrapper_mediawiki.tpl (modified) (1 diff)
-
modules/base/templates/wrapper_public.tpl (modified) (2 diffs)
-
modules/base/templates/wrapper_wordpress.tpl (modified) (1 diff)
-
modules/base/updates (added)
-
modules/base/updates.php (added)
-
modules/base/updates/_002.php (added)
-
modules/base/updates/_003.php (added)
-
modules/hello/module.php (modified) (1 diff)
-
mw_plugin.php (modified) (1 diff)
-
owa_adminController.php (added)
-
owa_auth.php (modified) (1 diff)
-
owa_base.php (modified) (1 diff)
-
owa_caller.php (modified) (17 diffs)
-
owa_controller.php (modified) (6 diffs)
-
owa_coreAPI.php (modified) (7 diffs)
-
owa_entity.php (modified) (2 diffs)
-
owa_lib.php (modified) (1 diff)
-
owa_module.php (modified) (3 diffs)
-
owa_reportController.php (modified) (1 diff)
-
owa_requestContainer.php (modified) (4 diffs)
-
owa_template.php (modified) (1 diff)
-
plugins/db/owa_db_mysql.php (modified) (6 diffs)
-
wp_plugin.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/asyncEventProcessor.php
r493 r498 73 73 */ 74 74 function asyncEventProcessor($config = null) { 75 75 76 $this->owa_caller($config); 76 77 77 78 if ($this->config['error_handler'] == 'development'): 78 $this->config['error_handler'] = 'async_development'; 79 endif; 80 81 //$this->e = &owa_error::get_instance(); 82 79 //$this->config['error_handler'] = 'async_development'; 80 endif; 81 83 82 // Turns off async setting so that the proper event queue is created 84 83 $this->config['async_db'] = false; 84 $this->c->set('base', 'async_db', false); 85 86 // load event queue 85 87 $this->eq = &eventQueue::get_instance(); 88 89 // load DAO 86 90 $this->db = &owa_coreAPI::dbSingleton(); 87 91 … … 125 129 */ 126 130 function process_events($event_file) { 127 $this->e->info(sprintf('Starting Async Event Processing Run for: %s', 128 $event_file)); 129 //check for lock file 130 if (file_exists($this->config['async_log_dir'].$this->config['async_lock_file'])): 131 //read contents of lock file for last PID 132 $lock_file = fopen($this->config['async_log_dir'].$this->config['async_lock_file'], "r") or die ("Could not create lock file"); 133 if ($lock_file): 134 while (!feof($lock_file)) { 135 $former_pid = fgets($lock_file, 4096); 136 } 137 fclose($lock_file); 131 132 if (file_exists($event_file)): 133 $this->e->info(sprintf('Starting Async Event Processing Run for: %s', $event_file)); 134 //check for lock file 135 if (file_exists($this->config['async_log_dir'].$this->config['async_lock_file'])): 136 //read contents of lock file for last PID 137 $lock_file = fopen($this->config['async_log_dir'].$this->config['async_lock_file'], "r") or die ("Could not create lock file"); 138 if ($lock_file): 139 while (!feof($lock_file)) { 140 $former_pid = fgets($lock_file, 4096); 141 } 142 fclose($lock_file); 143 endif; 144 //check to see if former PID is still running 145 $ps_check = $this->is_running($former_pid); 146 //if the process is still running, exit. 147 if ($ps_check == true): 148 $this->e->info(sprintf('Previous Process (%d) still active. Terminating Run.', 149 $former_pid)); 150 exit; 151 //if it's not running remove the lock file and proceead. 152 else: 153 $this->e->info(sprintf('Process %d is not running. Continuing Run... \n', 154 $former_pid)); 155 unlink ($this->config['async_log_dir'].$this->config['async_lock_file']); 156 $this->process_event_log($event_file); 138 157 endif; 139 //check to see if former PID is still running 140 $ps_check = $this->is_running($former_pid); 141 //if the process is still running, exit. 142 if ($ps_check == true): 143 $this->e->info(sprintf('Previous Process (%d) still active. Terminating Run.', 144 $former_pid)); 145 exit; 146 //if it's not running remove the lock file and proceead. 158 147 159 else: 148 $this->e->info(sprintf('Process %d is not running. Continuing Run... \n',149 $former_pid));150 unlink ($this->config['async_log_dir'].$this->config['async_lock_file']);151 160 $this->process_event_log($event_file); 161 152 162 endif; 153 154 163 else: 155 $this->process_event_log($event_file); 156 164 $this->e->debug("No event file found at: ".$event_file); 157 165 endif; 158 166 return; … … 176 184 177 185 if (file_exists($file)): 186 $this->db->connect(); 178 187 if($this->db->connection_status == true): 179 188 $this->create_lock_file(); -
trunk/conf/messages.php
r452 r498 37 37 2002 => array("<B>Login Failed</B>. Your user name or password did not match.",0), 38 38 2003 => array("Your Account lacks the necessary priviledges to access the requested resource.",0), 39 2004 => array("You must login to access the requested resource." ),39 2004 => array("You must login to access the requested resource.",0), 40 40 2010 => array("Sucess. Logout Complete.",0), 41 41 … … 68 68 //install 69 69 3300 => array("Could not connect to the database. Please check the database connection settings in your configuration file and try again.",0), 70 3301 => array("The version of PHP installed on this server is too old. Please upgrade to at least PHP 4." ),70 3301 => array("The version of PHP installed on this server is too old. Please upgrade to at least PHP 4.",0), 71 71 3302 => array("Database Schema Installation failed. Please check the error log file for more details.",0), 72 72 3303 => array("Success. Default Site Added.",0), -
trunk/eventQueue.php
r415 r498 18 18 19 19 require_once(OWA_PEARLOG_DIR . DIRECTORY_SEPARATOR . 'Log.php'); 20 require_once(OWA_PLUGIN S_DIR . DIRECTORY_SEPARATOR . 'log/queue.php');21 require_once(OWA_PLUGIN S_DIR . DIRECTORY_SEPARATOR . 'log/async_queue.php');20 require_once(OWA_PLUGIN_DIR . 'log/queue.php'); 21 require_once(OWA_PLUGIN_DIR . 'log/async_queue.php'); 22 22 require_once(OWA_BASE_CLASSES_DIR. 'owa_observer.php'); 23 23 -
trunk/modules/base/classes/column.php
r334 r498 31 31 class owa_dbColumn { 32 32 33 var $name; 34 33 35 var $value; 36 37 var $data_type; 34 38 35 39 var $foriegn_key; 36 40 41 var $is_primary_key = false; 42 37 43 var $auto_increment = false; 38 44 39 function owa_dbColumn() { 45 var $is_unique = false; 46 47 var $is_not_null = false; 48 49 var $label; 50 51 function owa_dbColumn($params = array()) { 52 53 54 if (!empty($params)): 55 56 foreach ($params as $k => $v) { 57 58 $this->$k = $v; 59 60 } 61 62 endif; 40 63 41 64 return; 65 } 66 67 function get($name) { 68 69 return $this->$name; 70 } 71 72 function set($name, $value) { 73 74 $this->$name = $value; 75 76 return; 77 } 78 79 function getDefinition() { 80 81 $definition = ''; 82 83 $definition .= $this->get('data_type'); 84 85 // Check for auto increment 86 if ($this->get('auto_increment') == true): 87 $definition .= ' '.OWA_DTD_AUTO_INCREMENT; 88 endif; 89 90 // Check for auto Not null 91 if ($this->get('is_not_null') == true): 92 $definition .= ' '.OWA_DTD_NOT_NULL; 93 endif; 94 95 // Check for unique 96 if ($this->get('is_unique') == true): 97 $definition .= ' '.OWA_DTD_UNIQUE; 98 endif; 99 100 // check for primary key 101 if ($this->get('is_primary_key') == true): 102 $definition .= ' '.OWA_DTD_PRIMARY_KEY; 103 //$definition .= sprintf(", INDEX (%s)", $this->get('name')); 104 endif; 105 106 // check for index 107 if ($this->get('index') == true): 108 $definition .= sprintf(", INDEX (%s)", $this->get('name')); 109 endif; 110 111 return $definition; 112 42 113 } 43 114 -
trunk/modules/base/classes/entityManager.php
r446 r498 98 98 $all_cols = $this->entity->getColumns(); 99 99 100 $cols = ''; 100 $cols = array(); 101 101 102 // Control loop 102 103 foreach ($all_cols as $k => $v){ … … 127 128 128 129 /** 130 * Create Table 131 * 132 * Handled by DB abstraction layer because the SQ associated with this is way too DB specific 133 */ 134 function createTable() { 135 136 // Persist table 137 $status = $this->db->createTable($this->entity); 138 139 if ($status == true): 140 $this->e->notice(sprintf("%s Table Created.", get_class($this->entity))); 141 return true; 142 else: 143 $this->e->notice(sprintf("%s Table Creation Failed.", get_class($this->entity))); 144 return false; 145 endif; 146 147 } 148 149 /** 150 * DROP Table 151 * 152 * Drops a table. will throw error is table does not exist 153 */ 154 function dropTable() { 155 156 // Persist table 157 $status = $this->db->dropTable(get_class($this->entity)); 158 159 if ($status == true): 160 return true; 161 else: 162 return false; 163 endif; 164 165 } 166 167 function addColumn($column_name) { 168 169 // Persist table 170 $status = $this->db->addColumn(get_class($this->entity), $column_name, $this->entity->$column_name->getDefinition()); 171 172 if ($status == true): 173 return true; 174 else: 175 return false; 176 endif; 177 178 } 179 180 function dropColumn($column_name) { 181 182 $status = $this->db->dropColumn(get_class($this->entity), $column_name); 183 184 if ($status == true): 185 return true; 186 else: 187 return false; 188 endif; 189 190 } 191 192 function modifyColumn($column_name) { 193 194 $status = $this->db->modifyColumn(get_class($this->entity), $column_name, $this->entity->$column_name->getDefinition()); 195 196 if ($status == true): 197 return true; 198 else: 199 return false; 200 endif; 201 202 203 } 204 205 function renameColumn($old_column_name, $column_name) { 206 207 $status = $this->db->renameColumn(get_class($this->entity), $old_column_name, $column_name); 208 209 if ($status == true): 210 return true; 211 else: 212 return false; 213 endif; 214 215 } 216 217 function renameTable($new_table_name) { 218 219 $status = $this->db->renameTable(get_class($this->entity), $new_table_name); 220 221 if ($status == true): 222 return true; 223 else: 224 return false; 225 endif; 226 return; 227 } 228 229 230 231 /** 129 232 * Update all properties of an Existing object 130 233 * -
trunk/modules/base/classes/error.php
r478 r498 366 366 367 367 function logPhpErrors() { 368 368 error_reporting(E_ALL); 369 ini_set('display_errors', E_ALL); 369 370 return set_error_handler(array("owa_error", "handlePhpError")); 370 371 … … 406 407 return; 407 408 } 409 410 function backtrace() { 411 412 $dbgTrace = debug_backtrace(); 413 $bt = array(); 414 foreach($dbgTrace as $dbgIndex => $dbgInfo) { 415 416 $bt[$dbgIndex] = array('file' => $dbgInfo['file'], 417 'line' => $dbgInfo['line'], 418 'function' => $dbgInfo['function'], 419 'args' => $dbgInfo['args']); 420 } 421 422 return $bt; 423 424 } 408 425 409 426 } -
trunk/modules/base/classes/event.php
r480 r498 99 99 function setTime($timestamp = '') { 100 100 101 $this-> properties['timestamp'] = $timestamp;102 $this-> properties['year'] = date("Y", $this->properties['timestamp']);103 $this-> properties['month'] = date("n", $this->properties['timestamp']);104 $this-> properties['day'] = date("d", $this->properties['timestamp']);105 $this-> properties['dayofweek'] = date("D", $this->properties['timestamp']);106 $this-> properties['dayofyear'] = date("z", $this->properties['timestamp']);107 $this-> properties['weekofyear'] = date("W", $this->properties['timestamp']);108 $this-> properties['hour'] = date("G", $this->properties['timestamp']);109 $this-> properties['minute'] = date("i", $this->properties['timestamp']);110 $this-> properties['second'] = date("s", $this->properties['timestamp']);101 $this->set('timestamp', $timestamp); 102 $this->set('year', date("Y", $timestamp)); 103 $this->set('month', date("n", $timestamp)); 104 $this->set('day', date("d", $timestamp)); 105 $this->set('dayofweek', date("D", $timestamp)); 106 $this->set('dayofyear', date("z", $timestamp)); 107 $this->set('weekofyear', date("W", $timestamp)); 108 $this->set('hour', date("G", $timestamp)); 109 $this->set('minute', date("i", $timestamp)); 110 $this->set('second', date("s", $timestamp)); 111 111 112 112 //epoc time 113 113 list($msec, $sec) = explode(" ", microtime()); 114 $this-> properties['sec'] = $sec;115 $this-> properties['msec'] = $msec;114 $this->set('sec', $sec); 115 $this->set('msec', $msec); 116 116 117 117 // Calc time sinse the last request … … 593 593 } 594 594 595 595 function get($name) { 596 597 return $this->properties[$name]; 598 } 599 600 601 function set($name, $value) { 602 603 $this->properties[$name] = $value; 604 return; 605 } 596 606 597 607 } -
trunk/modules/base/classes/settings.php
r486 r498 411 411 'do_not_log_admins' => true, 412 412 'do_not_log_ips' => '', 413 'track_feed_links' => true 413 'track_feed_links' => true, 414 'start_page' => 'base.reportDashboard' 414 415 415 416 )); -
trunk/modules/base/classes/userManager.php
r467 r498 43 43 } 44 44 45 function owa_userManager() { 46 47 return $this->__construct(); 48 } 49 45 50 function createNewUser($user_params) { 46 51 -
trunk/modules/base/entities/click.php
r238 r498 31 31 class owa_click extends owa_entity { 32 32 33 var $id ; // BIGINT,34 var $last_impression_id ; //BIGINT,35 var $visitor_id ; // BIGINT,36 var $session_id ; // BIGINT,37 var $document_id ; // BIGINT,38 var $target_id ; // BIGINT,39 var $target_url ; // VARCHAR(255),40 var $timestamp ; // BIGINT,41 var $year ; // INT,42 var $month ; // INT,43 var $day ; // INT,44 var $dayofyear ; // INT,45 var $weekofyear ; // INT,46 var $hour ; // TINYINT(2),47 var $minute ; // TINYINT(2),48 var $second ; // INT,49 var $msec ; // VARCHAR(255),50 var $click_x ; // INT,51 var $click_y ; // INT,52 var $page_width ; // INT,53 var $page_height ; // INT,54 var $position ; // BIGINT,55 var $approx_position ; // BIGINT,56 var $dom_element_x ; // INT,57 var $dom_element_y ; // INT,58 var $dom_element_name ; // VARCHAR(255),59 var $dom_element_id ; // VARCHAR(255),60 var $dom_element_value ; // VARCHAR(255),61 var $dom_element_tag ; // VARCHAR(255),62 var $dom_element_text ; // VARCHAR(255),63 var $tag_id ; // BIGINT,64 var $placement_id ; // BIGINT,65 var $campaign_id ; // BIGINT,<
