From 5ce4a27ad170b0927cc91ec1e092738aad213c99 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 13 Jan 2008 00:19:10 -0800 Subject: [PATCH] Refactoring all the static functions to not use the upper camel-case nomenclature, but rather underscores --- Api.php | 24 +++++++------- App.php | 66 +++++++++++++++++++------------------- Date.php | 2 +- Db.php | 2 +- Functions.php | 62 +++++++++++++++++------------------ Input.php | 10 +++--- Installer.php | 4 +-- Mail.php | 20 ++++++------ Pagination.php | 4 +-- Printer.php | 26 +++++++-------- PrinterNavigation.php | 2 +- PrinterRootElementPage.php | 28 ++++++++-------- PrinterTableElement.php | 20 ++++++------ Template.php | 24 +++++++------- 14 files changed, 147 insertions(+), 147 deletions(-) diff --git a/Api.php b/Api.php index 47ca47d..227240e 100644 --- a/Api.php +++ b/Api.php @@ -139,7 +139,7 @@ abstract class BSApi */ public function __construct() { - BSApp::RequiredModules(array('Db', 'Input')); + BSApp::required_modules(array('Db', 'Input')); } // ################################################################### @@ -186,7 +186,7 @@ abstract class BSApi throw new Exception('Field "' . $field . '" is not valid'); } - $this->values["$field"] = ($doclean ? BSApp::Registry()->getType('Input')->clean($value, $this->fields["$field"][F_TYPE]) : $value); + $this->values["$field"] = ($doclean ? BSApp::registry()->getType('Input')->clean($value, $this->fields["$field"][F_TYPE]) : $value); $this->setfields["$field"] = $field; @@ -267,7 +267,7 @@ abstract class BSApi $this->_runActionMethod('pre_fetch', $doPre); - $result = BSApp::Registry()->getType('Db')->queryFirst("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); + $result = BSApp::registry()->getType('Db')->queryFirst("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); if (!$result) { return false; @@ -301,9 +301,9 @@ abstract class BSApi $values[] = $this->_prepareFieldForSql($field); } - BSApp::Registry()->getType('Db')->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")"); + BSApp::registry()->getType('Db')->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")"); - if (BSApp::Registry()->getType('DbPostgreSql')) + if (BSApp::registry()->getType('DbPostgreSql')) { foreach ($this->fields AS $field => $info) { @@ -314,11 +314,11 @@ abstract class BSApi } } - $this->insertid = BSApp::Registry()->getType('Db')->insertId($this->prefix . $this->table, $autofield); + $this->insertid = BSApp::registry()->getType('Db')->insertId($this->prefix . $this->table, $autofield); } else { - $this->insertid = BSApp::Registry()->getType('Db')->insertId(); + $this->insertid = BSApp::registry()->getType('Db')->insertId(); } $this->_runActionMethod('post_insert', $doPost); @@ -348,7 +348,7 @@ abstract class BSApi } $updates = implode(', ', $updates); - BSApp::Registry()->getType('Db')->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}"); + BSApp::registry()->getType('Db')->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}"); $this->_runActionMethod('post_update', $doPost); } @@ -371,7 +371,7 @@ abstract class BSApi $this->_runActionMethod('pre_remove', $doPre); - BSApp::Registry()->getType('Db')->query("DELETE FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); + BSApp::registry()->getType('Db')->query("DELETE FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); $this->_runActionMethod('post_remove', $doPost); } @@ -430,7 +430,7 @@ abstract class BSApi if ($type == TYPE_NONE OR $type == TYPE_STR OR $type == TYPE_STRUN) { - return "'" . BSApp::Registry()->getType('Db')->escapeString($this->values["$name"]) . "'"; + return "'" . BSApp::registry()->getType('Db')->escapeString($this->values["$name"]) . "'"; } else if ($type == TYPE_BOOL) { @@ -438,7 +438,7 @@ abstract class BSApi } else if ($type == TYPE_BIN) { - return "'" . BSApp::Registry()->getType('Db')->escapeBinary($this->values["$name"]) . "'"; + return "'" . BSApp::registry()->getType('Db')->escapeBinary($this->values["$name"]) . "'"; } else { @@ -482,7 +482,7 @@ abstract class BSApi */ protected function _verifyIsNotUnique($field) { - $res = BSApp::Registry()->getType('Db')->queryFirst("SELECT $field FROM {$this->prefix}{$this->table} WHERE $field = " . $this->_prepareFieldForSql($field) . (empty($this->condition) ? "" : " AND !({$this->condition})")); + $res = BSApp::registry()->getType('Db')->queryFirst("SELECT $field FROM {$this->prefix}{$this->table} WHERE $field = " . $this->_prepareFieldForSql($field) . (empty($this->condition) ? "" : " AND !({$this->condition})")); if ($res) { $this->_error(new FieldException(sprintf(_('The "%1$s" field must contain a unique value'), $field), $field)); diff --git a/App.php b/App.php index 9c95af3..5869303 100644 --- a/App.php +++ b/App.php @@ -133,7 +133,7 @@ class BSApp * * @return object BSApp instance */ - private static function _Instance() + private static function _instance() { if (!self::$instance) { @@ -148,9 +148,9 @@ class BSApp * * @param string Application name */ - public static function SetApplication($name) + public static function set_application($name) { - self::_Instance()->application = $name; + self::_instance()->application = $name; } // ################################################################### @@ -159,9 +159,9 @@ class BSApp * * @return string Application name */ - public static function GetApplication() + public static function get_application() { - return self::_Instance()->application; + return self::_instance()->application; } // ################################################################### @@ -170,9 +170,9 @@ class BSApp * * @param string Path */ - public static function SetAppPath($path) + public static function set_app_path($path) { - self::_Instance()->appPath = BSFunctions::FetchSourcePath($path); + self::_instance()->appPath = BSFunctions::fetch_source_path($path); } // ################################################################### @@ -181,9 +181,9 @@ class BSApp * * @return string Application path */ - public static function GetAppPath() + public static function get_app_path() { - return self::_Instance()->appPath; + return self::_instance()->appPath; } // ################################################################### @@ -192,9 +192,9 @@ class BSApp * * @param string Application version */ - public static function SetAppVersion($vers) + public static function set_app_version($vers) { - self::_Instance()->appVersion = $vers; + self::_instance()->appVersion = $vers; } // ################################################################### @@ -203,9 +203,9 @@ class BSApp * * @return string Application version */ - public static function GetAppVersion() + public static function get_app_version() { - return self::_Instance()->appVersion; + return self::_instance()->appVersion; } // ################################################################### @@ -215,9 +215,9 @@ class BSApp * * @param string Path */ - public static function SetWebPath($path) + public static function set_web_path($path) { - self::_Instance()->webPath = BSFunctions::FetchSourcePath($path); + self::_instance()->webPath = BSFunctions::fetch_source_path($path); } // ################################################################### @@ -226,9 +226,9 @@ class BSApp * * @return string Application's web path */ - public static function GetWebPath() + public static function get_web_path() { - return self::_Instance()->webPath; + return self::_instance()->webPath; } // ################################################################### @@ -237,9 +237,9 @@ class BSApp * * @param bool Debug mode on? */ - public static function SetDebug($debug) + public static function set_debug($debug) { - self::_Instance()->debug = $debug; + self::_instance()->debug = $debug; } // ################################################################### @@ -248,9 +248,9 @@ class BSApp * * @return bool Debug mode on? */ - public static function GetDebug() + public static function get_debug() { - return self::_Instance()->debug; + return self::_instance()->debug; } // ################################################################### @@ -260,9 +260,9 @@ class BSApp * * @return StdClass */ - public static function Registry() + public static function registry() { - return self::_Instance()->registry; + return self::_instance()->registry; } // ################################################################### @@ -272,11 +272,11 @@ class BSApp * * @param string Debug message */ - public static function Debug($msg) + public static function debug($msg) { - if (self::_Instance()->debug) + if (self::_instance()->debug) { - self::_Instance()->debugInfo[] = $msg; + self::_instance()->debugInfo[] = $msg; } } @@ -286,10 +286,10 @@ class BSApp * * @return string Debug list */ - public static function GetDebugList() + public static function get_debug_list() { - $output = ''; + foreach (self::_instance()->debugInfo AS $notice) { $output .= ""; } @@ -304,9 +304,9 @@ class BSApp * * @return object Instantiated module */ - public static function LoadModule($name) + public static function load_module($name) { - if (self::GetDebug()) + if (self::get_debug()) { include_once(ISSO . "/$name.php"); } @@ -335,11 +335,11 @@ class BSApp * * @param array Array of module names to check for loadedness */ - public static function RequiredModules($modules) + public static function required_modules($modules) { foreach ($modules AS $module) { - if (self::Registry()->getType($module) == null) + if (self::registry()->getType($module) == null) { throw new Exception('The ' . $module . ' module is required in order to use this framework module'); } diff --git a/Date.php b/Date.php index aa04bc4..7145399 100644 --- a/Date.php +++ b/Date.php @@ -87,7 +87,7 @@ class BSDate * * @return array List of timezones */ - public static function FetchTimeZoneList() + public static function fetch_time_zone_list() { $opt = array(); diff --git a/Db.php b/Db.php index f1b5e51..0457a0d 100644 --- a/Db.php +++ b/Db.php @@ -157,7 +157,7 @@ abstract class BSDb throw new BSDbException($this->_errorString(), $this->_errorNumber(), $string); } - $this->history[] = $history = array('query' => $string, 'time' => BSFunctions::FetchMicrotimeDiff($time), 'trace' => BSFunctions::FormatBacktrace(debug_backtrace())); + $this->history[] = $history = array('query' => $string, 'time' => BSFunctions::fetch_microtime_diff($time), 'trace' => BSFunctions::format_backtrace(debug_backtrace())); if (defined('ISSO_SHOW_QUERIES_LIVE')) { diff --git a/Functions.php b/Functions.php index 3305d9e..55d369c 100644 --- a/Functions.php +++ b/Functions.php @@ -80,7 +80,7 @@ class BSFunctions * * @return object Shared instance */ - private function _Instance() + private function _instance() { if (!self::$instance) { @@ -95,9 +95,9 @@ class BSFunctions * * @param string New path */ - public static function SetCookiePath($path) + public static function set_cookie_path($path) { - self::_Instance()->cookiePath = $path; + self::_instance()->cookiePath = $path; } // ################################################################### @@ -106,9 +106,9 @@ class BSFunctions * * @param string Cookie domain */ - public static function SetCookieDomain($domain) + public static function set_cookie_domain($domain) { - self::_Instance()->cookieDomain = $domain; + self::_instance()->cookieDomain = $domain; } // ################################################################### @@ -117,9 +117,9 @@ class BSFunctions * * @param integer Cookie timeout */ - public static function SetCookieTimeout($timeout) + public static function set_cookie_timeout($timeout) { - self::_Instance()->cookieTimeout = intval($timeout); + self::_instance()->cookieTimeout = intval($timeout); } // ################################################################### @@ -130,12 +130,12 @@ class BSFunctions * @param string Value of the cookie, FALSE to clear * @param bool Is the cookie permanent? */ - public static function Cookie($name, $value, $sticky = true) + public static function cookie($name, $value, $sticky = true) { // expire the cookie if ($value === false) { - setcookie($name, $value, time() - (2 * self::_Instance()->cookieTimeout), self::_Instance()->cookiePath, self::_Instance()->cookieDomain); + setcookie($name, $value, time() - (2 * self::_instance()->cookieTimeout), self::_instance()->cookiePath, self::_instance()->cookieDomain); } // set the cookie else @@ -146,10 +146,10 @@ class BSFunctions } else { - $expire = time() + self::_Instance()->cookieTimeout; + $expire = time() + self::_instance()->cookieTimeout; } - setcookie($name, $value, $expire, self::_Instance()->cookiePath, self::_Instance()->cookieDomain); + setcookie($name, $value, $expire, self::_instance()->cookiePath, self::_instance()->cookieDomain); } } @@ -178,7 +178,7 @@ class BSFunctions * * @return string Path with directory separator ending */ - public static function FetchSourcePath($source) + public static function fetch_source_path($source) { if (substr($source, strlen($source) - 1) != DIRECTORY_SEPARATOR) { @@ -195,9 +195,9 @@ class BSFunctions * @param string File name of the new file * @param bool Whether or not to die after stringeaming the file */ - public static function DownloadFile($file, $name, $exit = true) + public static function download_file($file, $name, $exit = true) { - if (self::IsBrowser('ie') OR self::IsBrowser('opera') OR self::IsBrowser('safari')) + if (self::is_browser('ie') OR self::is_browser('opera') OR self::is_browser('safari')) { $mime = 'application/octetstream'; } @@ -229,7 +229,7 @@ class BSFunctions * * @return bool Validity of the email address */ - public static function IsValidEmail($email) + public static function is_valid_email($email) { if (preg_match('#^[a-z0-9\.\-\+_]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $email)) { @@ -250,7 +250,7 @@ class BSFunctions * * @param mixed False if there is no match, the version if there is */ - public static function IsBrowser($check, $version = '') + public static function is_browser($check, $version = '') { $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); $browser = array(); @@ -400,7 +400,7 @@ class BSFunctions * * @return string A random string */ - public static function Random($length = 0) + public static function random($length = 0) { // custom high and lows if (is_array($length)) @@ -443,7 +443,7 @@ class BSFunctions * * @return mixed Return the elelment of the array that we just put the counter to */ - public static function ArraySetCurrent(&$array, $key) + public static function array_set_current(&$array, $key) { reset($array); while (current($array) !== false) @@ -466,7 +466,7 @@ class BSFunctions * * @return float Microtime difference */ - public static function FetchMicrotimeDiff($mtstart) + public static function fetch_microtime_diff($mtstart) { $mtend = microtime(); list($startMicro, $startSec) = explode(' ', $mtstart); @@ -483,7 +483,7 @@ class BSFunctions * * @return string The extension for the specifid file name */ - public static function FetchExtension($filename) + public static function fetch_extension($filename) { $array = explode('.', $filename); @@ -503,7 +503,7 @@ class BSFunctions * * @return integer The maximum file upload size in bytes */ - public static function FetchMaxPhpFileSize() + public static function fetch_max_php_file_size() { if ($size = @ini_get('upload_max_filesize')) { @@ -533,9 +533,9 @@ class BSFunctions * * @return array A list of all the files in the specified path */ - public static function ScanDirectory($path, $recurse = true, $ignoreDot = true) + public static function scan_directory($path, $recurse = true, $ignoreDot = true) { - return self::_helpScanDirectory($path, $recurse, $ignoreDot, ''); + return self::_helpscan_directory($path, $recurse, $ignoreDot, ''); } // ################################################################### @@ -550,10 +550,10 @@ class BSFunctions * * @return array A list of all the files in the specified path */ - private static function _helpScanDirectory($path, $recurse = true, $ignoreDot = true, $pathAdd = '') + private static function _help_scan_directory($path, $recurse = true, $ignoreDot = true, $pathAdd = '') { $filelist = array(); - $path = self::FetchSourcePath($path); + $path = self::fetch_source_path($path); $dir = new DirectoryIterator($path); foreach ($dir AS $file) @@ -566,7 +566,7 @@ class BSFunctions if ($file->isDir() AND $recurse) { - $filelist = array_merge($filelist, self::_helpScanDirectory($path . $name, $recurse, $ignoreDot, $pathAdd . BSFunctions::FetchSourcePath(str_replace($path, '', $file->getPathname())))); + $filelist = array_merge($filelist, self::_helpscan_directory($path . $name, $recurse, $ignoreDot, $pathAdd . BSFunctions::fetch_source_path(str_replace($path, '', $file->getPathname())))); continue; } @@ -585,7 +585,7 @@ class BSFunctions * * @return string Text with one type of line break */ - public static function ConvertLineBreaks($text, $convert_to = "\n") + public static function convert_line_breaks($text, $convert_to = "\n") { $text = trim($text); $text = str_replace(array("\r\n", "\r", "\n"), "\n", $text); @@ -602,13 +602,13 @@ class BSFunctions * * @return array Full-valued array */ - public static function ArrayStripEmpty($array) + public static function array_strip_empty($array) { foreach ($array AS $key => $value) { if (is_array($array["$key"])) { - $array["$key"] = self::ArrayStripEmpty($array["$key"]); + $array["$key"] = self::array_strip_empty($array["$key"]); } else if (empty($value) OR is_null($value)) { @@ -631,7 +631,7 @@ class BSFunctions * * @return string Formatted output */ - public static function FormatBacktrace($backtrace) + public static function format_backtrace($backtrace) { // Unset call to debug_print_backtrace array_shift($backtrace); @@ -695,7 +695,7 @@ class BSFunctions * * @return string Part of a string */ - public static function Substring($string, $start, $end) + public static function substring($string, $start, $end) { return substr($string, $start, $end - $start); } diff --git a/Input.php b/Input.php index 1a25be1..bfb37e4 100644 --- a/Input.php +++ b/Input.php @@ -108,8 +108,8 @@ class BSInput set_magic_quotes_runtime(0); // some debug info that's always useful - BSApp::Debug('magic_quotes_gpc = ' . $this->magicquotes); - BSApp::Debug('register_globals = ' . ini_get('register_globals')); + BSApp::debug('magic_quotes_gpc = ' . $this->magicquotes); + BSApp::debug('register_globals = ' . ini_get('register_globals')); $this->_sanitizeInputData(); @@ -209,7 +209,7 @@ class BSInput */ public function escape($str, $force = true) { - $db = BSApp::Registry()->getType('Db'); + $db = BSApp::registry()->getType('Db'); if ($this->magicquotes AND !$force) { if ($db) @@ -420,11 +420,11 @@ class BSInput throw new Exception('No external hosts are allowed to POST to this application'); exit; } - BSApp::Debug('remote post check = ok'); + BSApp::debug('remote post check = ok'); } else { - BSApp::Debug('remote post check = FAILED'); + BSApp::debug('remote post check = FAILED'); } } } diff --git a/Installer.php b/Installer.php index c65f471..64c1dde 100644 --- a/Installer.php +++ b/Installer.php @@ -60,7 +60,7 @@ abstract class BSInstaller { $this->fileName = $fileName; - BSApp::RequiredModules(array('Input')); + BSApp::required_modules(array('Input')); $methods = get_class_methods($this); foreach ($methods AS $name) @@ -72,7 +72,7 @@ abstract class BSInstaller } natsort($this->steps); - $this->_runStep(BSApp::Registry()->getType('Input')->inputClean('step', TYPE_UINT)); + $this->_runStep(BSApp::registry()->getType('Input')->inputClean('step', TYPE_UINT)); } // ################################################################### diff --git a/Mail.php b/Mail.php index 22d4ea8..d284985 100644 --- a/Mail.php +++ b/Mail.php @@ -186,18 +186,18 @@ class BSMail } // load the input sanitizer - $input = BSApp::Registry()->getType('Input'); + $input = BSApp::registry()->getType('Input'); if ($input == null) { - BSApp::Debug(ISSO . '/Input not loaded, so manually doing so'); - $input = BSApp::LoadModule('Input'); + BSApp::debug(ISSO . '/Input not loaded, so manually doing so'); + $input = BSApp::load_module('Input'); } // make sure we have a mailer // TODO - add support for SMTP if (!@ini_get('sendmail_path')) { - BSApp::Debug("email: no sendmail -> not sending"); + BSApp::debug("email: no sendmail -> not sending"); return false; } @@ -230,7 +230,7 @@ class BSMail } // sanitize the body - $bodyText = BSFunctions::ConvertLineBreaks($this->bodyText, $this->delim); + $bodyText = BSFunctions::convert_line_breaks($this->bodyText, $this->delim); $bodyText = trim($input->unsanitize($bodyText, true)); if (empty($bodyText)) { @@ -238,7 +238,7 @@ class BSMail } // attach additional headers - $headers = BSFunctions::ConvertLineBreaks($this->headers, $this->delim); + $headers = BSFunctions::convert_line_breaks($this->headers, $this->delim); $headers .= ((!preg_match("#{$this->delim}$#", $headers) AND $headers != '') ? "\n" : '') . "From: \"{$fromName}\" <{$from}>" . $this->delim; $headers .= "Return-Path: {$from}" . $this->delim; $headers .= "X-Mailer: ISSO Mail Framework" . $this->delim; @@ -250,7 +250,7 @@ class BSMail $boundary = 'ISSO-MULTIPART-' . BSFunctions::Rand(10); $headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\"" . $this->delim; - $bodyHtml = BSFunctions::ConvertLineBreaks($this->bodyHtml, $this->delim); + $bodyHtml = BSFunctions::convert_line_breaks($this->bodyHtml, $this->delim); // first part of the message (plaintext) $body = "--$boundary" . $this->delim; @@ -281,11 +281,11 @@ class BSMail // attempt to send the mail! if (mail($tostring, $subject, $body, $headers, "-f {$from}")) { - BSApp::Debug("email: sent to $address"); + BSApp::debug("email: sent to $address"); } else { - BSApp::Debug("email: error sending to $address"); + BSApp::debug("email: error sending to $address"); } } @@ -299,7 +299,7 @@ class BSMail */ private function _fetchFirstLine($string) { - $string = BSFunctions::ConvertLineBreaks($string); + $string = BSFunctions::convert_line_breaks($string); $broken = explode("\n", $string); return $broken[0]; } diff --git a/Pagination.php b/Pagination.php index b8434e1..a2325f7 100644 --- a/Pagination.php +++ b/Pagination.php @@ -241,8 +241,8 @@ class BSPagination $input = BSApp::GetType('Input'); if ($input == null) { - BSApp::Debug(ISSO . '/Input not loaded, so manually doing so'); - $input = BSApp::LoadModule('Input'); + BSApp::debug(ISSO . '/Input not loaded, so manually doing so'); + $input = BSApp::load_module('Input'); } $this->page = $input->inputClean($this->pagevar, TYPE_INT); diff --git a/Printer.php b/Printer.php index 5075b4d..38ab1a2 100644 --- a/Printer.php +++ b/Printer.php @@ -84,7 +84,7 @@ class BSPrinter * * @return BSPrinter Singleton instance */ - private static function _Instance() + private static function _instance() { if (!self::$instance) { @@ -99,9 +99,9 @@ class BSPrinter * * @return string Realm */ - public static function GetRealm() + public static function get_realm() { - return self::_Instance()->realm; + return self::_instance()->realm; } // ################################################################### @@ -110,9 +110,9 @@ class BSPrinter * * @param string Realm */ - public static function SetRealm($realm) + public static function set_realm($realm) { - self::_Instance()->realm = $realm; + self::_instance()->realm = $realm; } // ################################################################### @@ -121,9 +121,9 @@ class BSPrinter * * @return array Language array */ - public static function GetLanguageInformation() + public static function get_language_information() { - return self::_Instance()->language; + return self::_instance()->language; } // ################################################################### @@ -132,9 +132,9 @@ class BSPrinter * * @param array Language array */ - public static function SetLanguageInformation($lang) + public static function set_language_information($lang) { - self::_Instance()->language = $lang; + self::_instance()->language = $lang; } // ################################################################### @@ -143,9 +143,9 @@ class BSPrinter * * @return string Stylesheet link */ - public static function GetStylesheet() + public static function get_stylesheet() { - return self::_Instance()->stylesheet; + return self::_instance()->stylesheet; } // ################################################################### @@ -154,9 +154,9 @@ class BSPrinter * * @param string Path */ - public static function SetStylesheet($stylesheet) + public static function set_stylesheet($stylesheet) { - self::_Instance()->stylesheet = $stylesheet; + self::_instance()->stylesheet = $stylesheet; } } diff --git a/PrinterNavigation.php b/PrinterNavigation.php index 7398044..a22d8b2 100644 --- a/PrinterNavigation.php +++ b/PrinterNavigation.php @@ -177,7 +177,7 @@ class BSPrinterNavigation } $output .= "\n" . ''; diff --git a/PrinterRootElementPage.php b/PrinterRootElementPage.php index 85c7b15..4231c4e 100644 --- a/PrinterRootElementPage.php +++ b/PrinterRootElementPage.php @@ -79,7 +79,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement * @param string Redirect message to be shown * @param array An aray of POST variables to send through on the redirect */ - public static function Redirect($controller, $action, $message = null, $postvars = array()) + public static function redirect($controller, $action, $message = null, $postvars = array()) { if (!defined('ISSO_PRINTER_NO_NAVIGATION')) { @@ -135,7 +135,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement $override = true; } - $page->addChild(BSPrinterRootElementPage::Message(_('Redirect'), $showmessage)); + $page->addChild(BSPrinterRootElementPage::message(_('Redirect'), $showmessage)); $page->paint(); exit; @@ -150,7 +150,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement * * @return BSPrinterRootElementTable A table */ - public static function Message($title, $message) + public static function message($title, $message) { $table = new BSPrinterRootElementTable(); @@ -177,7 +177,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement * @param string Action to pass * @param array Hidden parameters to pass to the next page */ - public static function Confirm($message, $controller, $action, $params) + public static function confirm($message, $controller, $action, $params) { if (!defined('ISSO_PRINTER_NO_NAVIGATION')) { @@ -204,7 +204,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement $table->addChild(new BSPrinterTableElement(new BSPrinterLabelElement("
$message
"))); $no = new BSPrinterBaseElement('button', '__no__', _('No')); $no->setOnClick('history.back(1); return false;'); - $table->addChild(BSPrinterTableElement::RowSubmit(array($no), _('Yes'), null)); + $table->addChild(BSPrinterTableElement::row_submit(array($no), _('Yes'), null)); $form->addChild($table); @@ -218,7 +218,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement * * @param string Error string */ - public static function Error($message) + public static function error($message) { if (!defined('ISSO_PRINTER_NO_NAVIGATION')) { @@ -226,7 +226,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement } $page = new BSPrinterRootElementPage(_('Error')); - $page->addChild(BSPrinterRootElementPage::Message(_('Error'), $message)); + $page->addChild(BSPrinterRootElementPage::message(_('Error'), $message)); $page->paint(); exit; @@ -256,13 +256,13 @@ class BSPrinterRootElementPage extends BSPrinterRootElement */ public function paint() { - $language = BSPrinter::GetLanguageInformation(); + $language = BSPrinter::get_language_information(); echo "\n"; echo "\n"; - echo "\n\t" . sprintf(_('%1$s - %2$s - %3$s'), BSApp::GetApplication(), BSPrinter::GetRealm(), $this->title) . ""; + echo "\n\t" . sprintf(_('%1$s - %2$s - %3$s'), BSApp::get_application(), BSPrinter::get_realm(), $this->title) . ""; echo "\n\t"; - echo "\n\t"; + echo "\n\t"; echo "\n\n\n"; if (BSApp::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION'))) @@ -277,7 +277,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement echo BSApp::GetType('PrinterNavigation')->constructFooterHtml(); } - $copyright = "\n
\n

\n\t" . BSApp::GetApplication() . ' ' . BSApp::GetAppVersion() . ", ©2002 - " . gmdate('Y') . " Blue Static\n

"; + $copyright = "\n
\n

\n\t" . BSApp::get_application() . ' ' . BSApp::get_app_version() . ", ©2002 - " . gmdate('Y') . " Blue Static\n

"; if (!defined('ISSO_PRINTER_HIDE_SETUP')) { @@ -285,7 +285,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement echo "\n\n\n"; - if (BSApp::GetDebug()) + if (BSApp::get_debug()) { if (defined('SVN') AND preg_match('#^\$Id:?#', constant('SVN'))) { @@ -294,10 +294,10 @@ class BSPrinterRootElementPage extends BSPrinterRootElement if (defined('ISSO_MT_START')) { - echo "\n
Executed in " . round(BSFunctions::FetchMicrotimeDiff(ISSO_MT_START), 10) . ' seconds
'; + echo "\n
Executed in " . round(BSFunctions::fetch_microtime_diff(ISSO_MT_START), 10) . ' seconds
'; } - echo "\n
" . BSApp::GetDebugList() . "
\n"; + echo "\n
" . BSApp::get_debug_list() . "
\n"; if (BSApp::GetType('Db')) { diff --git a/PrinterTableElement.php b/PrinterTableElement.php index adffe90..0f09eed 100644 --- a/PrinterTableElement.php +++ b/PrinterTableElement.php @@ -89,7 +89,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BSPrinterTableElement Table row element */ - public static function RowLabel($label, $value) + public static function row_label($label, $value) { $tr = new BSPrinterTableElement(); @@ -110,7 +110,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BPrinterTableElement Table row element */ - public static function RowText($label, $name, $value = null, $password = false) + public static function row_text($label, $name, $value = null, $password = false) { $tr = new BSPrinterTableElement(); @@ -130,7 +130,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BSPrinterTableElement Table row element */ - public static function RowSubmit(Array $children = null, $save = ':submit:', $reset = ':reset:') + public static function row_submit(Array $children = null, $save = ':submit:', $reset = ':reset:') { $build = ''; if (sizeof($children) > 0) @@ -175,7 +175,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BSPrinterTableElement Table row */ - public static function RowList($label, $name, Array $options) + public static function row_list($label, $name, Array $options) { $build = ''; foreach ($options AS $option) @@ -186,7 +186,7 @@ class BSPrinterTableElement extends BSPrinterElement } else { - throw new Exception('Only BSPrinterBaseElement\'s of type "option" are allowed in BSPrinterTableElement::RowList()'); + throw new Exception('Only BSPrinterBaseElement\'s of type "option" are allowed in BSPrinterTableElement::row_list()'); } } @@ -208,7 +208,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BSPrinterTableElement Table row */ - public static function RowCheckbox($label, $name, Array $boxes) + public static function row_checkbox($label, $name, Array $boxes) { $build = ''; foreach ($boxes AS $boxLabel => $box) @@ -223,7 +223,7 @@ class BSPrinterTableElement extends BSPrinterElement } else { - throw new Exception('Only BSPrinterBaseElement\'s of type "checkbox" are allowed in BSPrinterTableElement::RowCheckbox()'); + throw new Exception('Only BSPrinterBaseElement\'s of type "checkbox" are allowed in BSPrinterTableElement::row_checkbox()'); } } @@ -245,7 +245,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BSPrinterTableElement Upload form */ - public static function RowUpload($label, $name) + public static function row_upload($label, $name) { $tr = new BSPrinterTableElement(); @@ -265,7 +265,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BSPrinterTableElement Yes-No row */ - public static function RowYesNo($label, $name, $yes) + public static function row_yes_no($label, $name, $yes) { $elm = new BSPrinterBaseElement('radio', $name, 1); $elm->setActive($yes); @@ -293,7 +293,7 @@ class BSPrinterTableElement extends BSPrinterElement * * @return BSPrinterTableElement Table row */ - public static function RowTextarea($label, $name, $value = null) + public static function row_textarea($label, $name, $value = null) { $tr = new BSPrinterTableElement(); diff --git a/Template.php b/Template.php index 4b2da85..d364c47 100644 --- a/Template.php +++ b/Template.php @@ -107,7 +107,7 @@ class BSTemplate */ public function setTemplateDirectory($dir) { - $this->templateDir = BSFunctions::FetchSourcePath($dir); + $this->templateDir = BSFunctions::fetch_source_path($dir); } // ################################################################### @@ -162,7 +162,7 @@ class BSTemplate $dbCache = array(); if ($this->dbCacheTable) { - $db =& BSApp::Registry()->getType('Db'); + $db =& BSApp::registry()->getType('Db'); $cache = $db->query("SELECT * FROM {$this->dbCacheTable} WHERE filename IN ('" . implode("', '", $namearray) . "')"); while ($tpl = $cache->fetchArray()) { @@ -219,7 +219,7 @@ class BSTemplate else { $this->uncached[$name] = (isset($this->uncached[$name]) ? $this->uncached[$name] + 1 : 0); - BSApp::Debug("Manually loading template '$name'"); + BSApp::debug("Manually loading template '$name'"); $template = $this->_loadTemplate($name); $template = $this->_parseTemplate($template); } @@ -248,10 +248,10 @@ class BSTemplate } $debugBlock = ''; - if (BSApp::GetDebug()) + if (BSApp::get_debug()) { - $debugBlock .= "\n
Executed in " . round(BSFunctions::FetchMicrotimeDiff('0 ' . $_SERVER['REQUEST_TIME']), 10) . ' seconds
'; - $debugBlock .= "\n
" . BSApp::GetDebugList() . "
"; + $debugBlock .= "\n
Executed in " . round(BSFunctions::fetch_microtime_diff('0 ' . $_SERVER['REQUEST_TIME']), 10) . ' seconds
'; + $debugBlock .= "\n
" . BSApp::get_debug_list() . "
"; if (sizeof($this->uncached) > 0) { @@ -262,9 +262,9 @@ class BSTemplate $debugBlock .= "
Uncached Templates:" . implode(', ', $tpls) . " )
\n"; } - if (BSApp::Registry()->getType('Db')) + if (BSApp::registry()->getType('Db')) { - $queries = BSApp::Registry()->getType('Db')->getHistory(); + $queries = BSApp::registry()->getType('Db')->getHistory(); $debugBlock .= "
\n" . '' . "\n\t" . ''; @@ -454,9 +454,9 @@ class BSTemplate if ($template[$backPos] == '"') { // startPosition + length(startTag) + length(=\") - $varMap[intval($varNum)] = BSFunctions::Substring($template, $capturePos + 3, $backPos - 1); + $varMap[intval($varNum)] = BSFunctions::substring($template, $capturePos + 3, $backPos - 1); // remove our old substitution from the capture - $capture = BSFunctions::Substring($template, $backPos + 1, $i); + $capture = BSFunctions::substring($template, $backPos + 1, $i); break; } $backPos--; @@ -478,7 +478,7 @@ class BSTemplate else if ($template[$i] == '>' AND $template[$i - 1] == '"') { // the final variable substitution - $varMap[intval($varNum)] = BSFunctions::Substring($template, $capturePos + 3, $i - 2); + $varMap[intval($varNum)] = BSFunctions::substring($template, $capturePos + 3, $i - 2); $varEnds = $i; break; } @@ -495,7 +495,7 @@ class BSTemplate } // this is the string that gets variable replacement - $str = BSFunctions::Substring($template, $varEnds + 1, $end); + $str = BSFunctions::substring($template, $varEnds + 1, $end); // create the complete varmap -- 2.43.5
Query Debug