Convert custom function names to camelCase

This commit is contained in:
Marcus Hill
2023-01-26 21:58:27 +00:00
parent bdc71d3163
commit 10362f86ef
18 changed files with 45 additions and 46 deletions

View File

@@ -63,12 +63,11 @@ function removeDirectory($path) {
rmdir($path);
}
function get_user_agent() {
function getUserAgent() {
return $_SERVER['HTTP_USER_AGENT'];
}
function get_ip() {
function getIp() {
if (defined("CONST_GET_IP_METHOD")) {
if (CONST_GET_IP_METHOD == "HTTP_X_FORWARDED_FOR") {
$ip = getenv('HTTP_X_FORWARDED_FOR');
@@ -86,7 +85,7 @@ function get_ip() {
return $ip;
}
function get_web_browser($user_browser) {
function getWebBrowser($user_browser) {
$browser = "Unknown Browser";
$browser_array = array(
'/msie/i' => "<i class='fab fa-fw fa-internet-explorer text-secondary'></i> Internet Explorer",
@@ -131,7 +130,7 @@ function get_os($user_os) {
return $os_platform;
}
function get_device() {
function GetDevice() {
$tablet_browser = 0;
$mobile_browser = 0;
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*(mobi|opera mini)))/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
@@ -143,7 +142,7 @@ function get_device() {
if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) || ((isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])))) {
$mobile_browser++;
}
$mobile_ua = strtolower(substr(get_user_agent(), 0, 4));
$mobile_ua = strtolower(substr(getUserAgent(), 0, 4));
$mobile_agents = array(
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
@@ -157,7 +156,7 @@ function get_device() {
if (in_array($mobile_ua,$mobile_agents)) {
$mobile_browser++;
}
if (strpos(strtolower(get_user_agent()),'opera mini') > 0) {
if (strpos(strtolower(getUserAgent()),'opera mini') > 0) {
$mobile_browser++;
//Check for tablets on Opera Mini alternative headers
$stock_ua = strtolower(isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])?$_SERVER['HTTP_X_OPERAMINI_PHONE_UA']:(isset($_SERVER['HTTP_DEVICE_STOCK_UA'])?$_SERVER['HTTP_DEVICE_STOCK_UA']:''));
@@ -217,7 +216,7 @@ function formatPhoneNumber($phoneNumber) {
return $phoneNumber;
}
function mkdir_missing($dir) {
function mkdirMissing($dir) {
if (!is_dir($dir)) {
mkdir($dir);
}
@@ -435,7 +434,7 @@ function getSSL($name) {
return $certificate;
}
function strto_AZaz09($string) {
function strtoAZaz09($string) {
$string = ucwords(strtolower($string));
// Replace spaces with _