Changeset 201
- Timestamp:
- Jul 7, 2006 10:53:09 PM (18 years ago)
- Location:
- trunk/lib
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/ACL.inc.php
r199 r201 122 122 $db->query("DROP TABLE IF EXISTS aco_tbl"); 123 123 $db->query("DROP TABLE IF EXISTS axo_tbl"); 124 $app->logMsg(sprintf('Dropping and recreating tables acl_tbl, aro_tbl, aco_tbl, axo_tbl.', null), LOG_ DEBUG, __FILE__, __LINE__);124 $app->logMsg(sprintf('Dropping and recreating tables acl_tbl, aro_tbl, aco_tbl, axo_tbl.', null), LOG_INFO, __FILE__, __LINE__); 125 125 } 126 126 … … 261 261 "); 262 262 263 $app->logMsg(sprintf('Added %s node %s to parent %s.', $type, $name, $parent), LOG_ DEBUG, __FILE__, __LINE__);263 $app->logMsg(sprintf('Added %s node %s to parent %s.', $type, $name, $parent), LOG_INFO, __FILE__, __LINE__); 264 264 return mysql_insert_id($db->getDBH()); 265 265 } … … 342 342 $db->query("UPDATE $tbl SET rgt = rgt - ($rgt - $lft + 1) WHERE rgt > $rgt"); 343 343 344 $app->logMsg(sprintf('Removed %s node %s along with %s children.', $type, $name, $num_deleted_nodes - 1), LOG_ DEBUG, __FILE__, __LINE__);344 $app->logMsg(sprintf('Removed %s node %s along with %s children.', $type, $name, $num_deleted_nodes - 1), LOG_INFO, __FILE__, __LINE__); 345 345 return true; 346 346 } … … 464 464 $db->query("UPDATE $tbl SET rgt = rgt + $total_transversal_value WHERE rgt >= $new_parent_rgt AND $primary_key NOT IN ('" . join("','", $ids) . "')"); 465 465 466 $app->logMsg(sprintf('Moved %s node %s to new parent %s.', $type, $name, $new_parent), LOG_ DEBUG, __FILE__, __LINE__);466 $app->logMsg(sprintf('Moved %s node %s to new parent %s.', $type, $name, $new_parent), LOG_INFO, __FILE__, __LINE__); 467 467 return true; 468 468 } … … 529 529 530 530 $db->query("REPLACE INTO acl_tbl VALUES ('$aro_id', '$aco_id', '$axo_id', '$allow', NOW())"); 531 $app->logMsg(sprintf('Set %s: %s -> %s -> %s.', $allow, $aro, $aco, $axo), LOG_ DEBUG, __FILE__, __LINE__);531 $app->logMsg(sprintf('Set %s: %s -> %s -> %s.', $allow, $aro, $aco, $axo), LOG_INFO, __FILE__, __LINE__); 532 532 533 533 return true; … … 647 647 if (!list($access) = mysql_fetch_row($qid)) { 648 648 $this->cache->set($cache_hash, 'deny'); 649 //$app->logMsg(sprintf('Access denyed: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);649 $app->logMsg(sprintf('Access denyed: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__); 650 650 return false; 651 651 } … … 654 654 655 655 if ('allow' == $access) { 656 //$app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);656 $app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__); 657 657 return true; 658 658 } else { 659 //$app->logMsg(sprintf('Access denyed: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);659 $app->logMsg(sprintf('Access denyed: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__); 660 660 return false; 661 661 } -
trunk/lib/App.inc.php
r189 r201 345 345 } 346 346 $this->timer->stop('_app'); 347 $this->logMsg(sprintf('Script ended gracefully. Execution time: %s. Number of db queries: %s.', $this->timer->getTime('_app'), $num_queries), LOG_ DEBUG, __FILE__, __LINE__);347 $this->logMsg(sprintf('Script ended gracefully. Execution time: %s. Number of db queries: %s.', $this->timer->getTime('_app'), $num_queries), LOG_INFO, __FILE__, __LINE__); 348 348 } 349 349 -
trunk/lib/Auth_SQL.inc.php
r199 r201 135 135 if ($recreate_db) { 136 136 $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table')); 137 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_ DEBUG, __FILE__, __LINE__);137 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__); 138 138 } 139 139 … … 192 192 if ($recreate_db) { 193 193 $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_login_table')); 194 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_login_table')), LOG_ DEBUG, __FILE__, __LINE__);194 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_login_table')), LOG_INFO, __FILE__, __LINE__); 195 195 } 196 196 $db->query("CREATE TABLE IF NOT EXISTS " . $this->getParam('db_login_table') . " ( -
trunk/lib/Cache.inc.php
r188 r201 52 52 53 53 if (true !== $app->getParam('enable_session')) { 54 $app->logMsg('Cache disabled, enable_session is false.', LOG_ DEBUG, __FILE__, __LINE__);54 $app->logMsg('Cache disabled, enable_session is false.', LOG_INFO, __FILE__, __LINE__); 55 55 $this->setParam(array('enabled' => false)); 56 56 } -
trunk/lib/DBSessionHandler.inc.php
r146 r201 81 81 if ($recreate_db) { 82 82 $this->db->query("DROP TABLE IF EXISTS " . $this->db->escapeString($this->_params['db_table'])); 83 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->_params['db_table']), LOG_ DEBUG, __FILE__, __LINE__);83 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->_params['db_table']), LOG_INFO, __FILE__, __LINE__); 84 84 } 85 85 $this->db->query("CREATE TABLE IF NOT EXISTS " . $this->db->escapeString($this->_params['db_table']) . " ( -
trunk/lib/Email.inc.php
r146 r201 294 294 // Ensure message was successfully accepted for delivery. 295 295 if (mail($final_to, $this->_params['subject'], $final_body, $final_headers, $envelope_sender_header)) { 296 $app->logMsg(sprintf('Email successfully sent to %s', $final_to), LOG_ DEBUG, __FILE__, __LINE__);296 $app->logMsg(sprintf('Email successfully sent to %s', $final_to), LOG_INFO, __FILE__, __LINE__); 297 297 return true; 298 298 } else { -
trunk/lib/Hierarchy.inc.php
r141 r201 210 210 ) 211 211 "); 212 $app->logMsg(sprintf('insertNode: Added node %s %s with parent %s %s.', $child_type, $child_id, $parent['node_type'], $parent['node_id']), LOG_ DEBUG, __FILE__, __LINE__);212 $app->logMsg(sprintf('insertNode: Added node %s %s with parent %s %s.', $child_type, $child_id, $parent['node_type'], $parent['node_id']), LOG_INFO, __FILE__, __LINE__); 213 213 } 214 214 return true; … … 256 256 AND child_id = '" . $db->escapeString($child_id) . "' 257 257 "); 258 $app->logMsg(sprintf('deleteNode: Deleted node %s %s.', $child_type, $child_id), LOG_ DEBUG, __FILE__, __LINE__);258 $app->logMsg(sprintf('deleteNode: Deleted node %s %s.', $child_type, $child_id), LOG_INFO, __FILE__, __LINE__); 259 259 260 260 return true; … … 336 336 AND relationship_type " . (is_null($relationship_type) ? "IS NULL" : "= '" . $db->escapeString($relationship_type) . "'") . " 337 337 "); 338 $app->logMsg(sprintf('moveNode: Deleted node %s %s.', $child_type, $child_id), LOG_ DEBUG, __FILE__, __LINE__);338 $app->logMsg(sprintf('moveNode: Deleted node %s %s.', $child_type, $child_id), LOG_INFO, __FILE__, __LINE__); 339 339 340 340 // Insert new nodes with the new parents. -
trunk/lib/ImageThumb.inc.php
r199 r201 367 367 $file_size = filesize($dest_file); 368 368 if (false !== $file_size && $file_size < $spec['keep_filesize']) { 369 $app->logMsg(sprintf('Skipping thumbnail %s. File already exists and file size is less than %s bytes.', $spec['dest_dir'] . '/' . $file_name, $spec['keep_filesize']), LOG_ DEBUG, __FILE__, __LINE__);369 $app->logMsg(sprintf('Skipping thumbnail %s. File already exists and file size is less than %s bytes.', $spec['dest_dir'] . '/' . $file_name, $spec['keep_filesize']), LOG_INFO, __FILE__, __LINE__); 370 370 continue; 371 371 } … … 376 376 if ($image_size['0'] <= $spec['width'] && $image_size['1'] <= $spec['height'] && !$spec['allow_upscaling']) { 377 377 $spec['scaling_type'] = IMAGETHUMB_NO_SCALE; 378 $app->logMsg(sprintf('Image %s smaller than specified %s thumbnail size. Keeping original size.', $file_name, basename($spec['dest_dir'])), LOG_ DEBUG, __FILE__, __LINE__);378 $app->logMsg(sprintf('Image %s smaller than specified %s thumbnail size. Keeping original size.', $file_name, basename($spec['dest_dir'])), LOG_INFO, __FILE__, __LINE__); 379 379 } 380 380 … … 382 382 if (IMAGETHUMB_METHOD_NETPBM === $this->getParam('resize_method') && file_exists($this->getParam('anytopnm_binary')) && file_exists($this->getParam('pnmscale_binary')) && file_exists($this->getParam('cjpeg_binary'))) { 383 383 // Resize using Netpbm binaries. 384 //$app->logMsg(sprintf('Resizing with Netpbm: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__);384 $app->logMsg(sprintf('Resizing with Netpbm: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__); 385 385 $return_val += $this->_resizeWithNetpbm($source_file, $dest_file, $spec); 386 386 } else if (IMAGETHUMB_METHOD_GD === $this->getParam('resize_method') && extension_loaded('gd')) { 387 387 // Resize with GD. 388 //$app->logMsg(sprintf('Resizing with GD: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__);388 $app->logMsg(sprintf('Resizing with GD: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__); 389 389 $return_val += $this->_resizeWithGD($source_file, $dest_file, $spec); 390 390 } else { … … 637 637 } 638 638 } 639 $app->logMsg(sprintf('THumbnails successfully deleted for file: %s', $file_name), LOG_ DEBUG, __FILE__, __LINE__);639 $app->logMsg(sprintf('THumbnails successfully deleted for file: %s', $file_name), LOG_INFO, __FILE__, __LINE__); 640 640 return 0 === $return_val; 641 641 } … … 658 658 } 659 659 660 // Ensure we have a source. 661 if ('' == $file_name) { 662 $app->logMsg(sprintf('Cannot delete, filename empty.'), LOG_WARNING, __FILE__, __LINE__); 663 return false; 664 } 665 660 666 $source_file = realpath(sprintf('%s/%s', $this->getParam('source_dir'), $file_name)); 661 if (!unlink($source_file)) { 667 if (is_file($source_file) && unlink($source_file)) { 668 $app->logMsg(sprintf('Original file successfully deleted: %s', $file_name), LOG_INFO, __FILE__, __LINE__); 669 return true; 670 } else { 662 671 $app->logMsg(sprintf('Delete original failed: %s', $source_file), LOG_WARNING, __FILE__, __LINE__); 663 672 return false; 664 673 } 665 $app->logMsg(sprintf('Original file successfully deleted: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__);666 return true;667 674 } 668 675 -
trunk/lib/Lock.inc.php
r185 r201 84 84 if ($recreate_db) { 85 85 $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table')); 86 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_ DEBUG, __FILE__, __LINE__);86 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__); 87 87 } 88 88 $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " ( -
trunk/lib/MCVE.inc.php
r141 r201 161 161 mcve_text_avs(MCVE_TransactionAVS($this->conn, $tid)), 162 162 mcve_text_cv(MCVE_TransactionCV($this->conn, $tid)) 163 ), LOG_ DEBUG, __FILE__, __LINE__);163 ), LOG_INFO, __FILE__, __LINE__); 164 164 return true; 165 165 } else { -
trunk/lib/Prefs.inc.php
r190 r201 93 93 if ($recreate_db) { 94 94 $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table')); 95 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_ DEBUG, __FILE__, __LINE__);95 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__); 96 96 } 97 97 $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " ( -
trunk/lib/Utilities.inc.php
r191 r201 250 250 * @version 1.1.0 251 251 */ 252 function humanFileSize($size, $ max_unit=null, $format='%01.2f %s')252 function humanFileSize($size, $format='%01.2f %s', $max_unit=null) 253 253 { 254 254 // Units … … 653 653 654 654 if ('' == trim($val)) { 655 $app->logMsg(sprintf('Cannot add signature to an empty string.', null), LOG_ DEBUG, __FILE__, __LINE__);655 $app->logMsg(sprintf('Cannot add signature to an empty string.', null), LOG_INFO, __FILE__, __LINE__); 656 656 return ''; 657 657 } -
trunk/lib/Version.inc.php
r169 r201 90 90 if ($recreate_db) { 91 91 $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table')); 92 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_ DEBUG, __FILE__, __LINE__);92 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__); 93 93 } 94 94 $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
Note: See TracChangeset
for help on using the changeset viewer.