- Timestamp:
- Feb 10, 2019 9:48:46 PM (5 years ago)
- Location:
- trunk/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r661 r665 594 594 } 595 595 596 /* 597 * @access public 598 * @return bool True if running in the context of a CLI script. 599 * @author Quinn Comendant <quinn@strangecode.com> 600 * @since 10 Feb 2019 12:31:59 601 */ 602 public function isCLI() 603 { 604 return $this->cli; 605 } 596 606 597 607 /** -
trunk/lib/DB.inc.php
r661 r665 261 261 262 262 if ($this->getParam('db_die_on_failure')) { 263 if (!$app-> cli) {263 if (!$app->isCLI()) { 264 264 // For http requests, send a Service Unavailable header. 265 265 header(' ', true, 503); … … 357 357 $app->logMsg(sprintf('MySQL error %s: %s in query: %s', mysql_errno($this->dbh), mysql_error($this->dbh), $debugqry), LOG_EMERG, __FILE__, __LINE__); 358 358 if ($this->getParam('db_debug')) { 359 if (!$app-> cli) {359 if (!$app->isCLI()) { 360 360 echo '<pre style="padding:2em; background:#ddd; font:9px monaco;">' . wordwrap(mysql_error($this->dbh)) . '<hr>' . htmlspecialchars($debugqry) . '</pre>'; 361 361 } -
trunk/lib/FormValidator.inc.php
r597 r665 364 364 * @param string $form_name the name of the incoming form variable 365 365 * @param string $msg the message to display on error 366 * @param bool $negative_ok Set to true if negative numbers will be allowed. 366 367 * @param const $type A LOG_* constant (see App->logMsg()) 367 368 * @param const $file Filename to log (usually __FILE__) -
trunk/lib/Prefs.inc.php
r653 r665 178 178 179 179 // CLI scripts can't use prefs stored in HTTP-based protocols. 180 if ($app-> cli180 if ($app->isCLI() 181 181 && isset($params['storagetype']) 182 182 && in_array($params['storagetype'], array('cookie', 'session'))) { 183 $app->logMsg(sprintf('Storage type %s not available for CLI', $params['storagetype']), LOG_ NOTICE, __FILE__, __LINE__);183 $app->logMsg(sprintf('Storage type %s not available for CLI', $params['storagetype']), LOG_DEBUG, __FILE__, __LINE__); 184 184 } 185 185 … … 503 503 // Skip this method if not using the db. 504 504 if ('database' != $this->getParam('storagetype')) { 505 $app->logMsg('Prefs->load() does nothing unless using a database storagetype.', LOG_ NOTICE, __FILE__, __LINE__);505 $app->logMsg('Prefs->load() does nothing unless using a database storagetype.', LOG_DEBUG, __FILE__, __LINE__); 506 506 return true; 507 507 } … … 559 559 { 560 560 if ('database' != $this->getParam('storagetype')) { 561 $app->logMsg('Prefs->_isLoaded() does nothing unless using a database storagetype.', LOG_ NOTICE, __FILE__, __LINE__);561 $app->logMsg('Prefs->_isLoaded() does nothing unless using a database storagetype.', LOG_DEBUG, __FILE__, __LINE__); 562 562 return true; 563 563 } -
trunk/lib/Utilities.inc.php
r653 r665 42 42 $app =& App::getInstance(); 43 43 44 if ($app-> cli) {44 if ($app->isCLI()) { 45 45 echo "DUMP FROM: $file $line\n"; 46 46 } else { … … 76 76 } 77 77 78 if ($app-> cli) {78 if ($app->isCLI()) { 79 79 echo "\n"; 80 80 } else {
Note: See TracChangeset
for help on using the changeset viewer.