Update to make all class E_NOTICE safe, add page_content
- ALL classes are E_NOTICE safe as far as possible. There might be some minor things left over which will be cleaned up in further testing - Added declare(strict_types=1); on all pages for trying to make all calls strict - Added page_content sub content to edit_page, with this some inner page content with ACL can be set, eg for use with Ajax/JS calls with backend. Also alias can be set so the control ajax pages can back reference to the master page content setting. Currently only one back reference is allowed - Note that the PAGES array has no numeric indexes, but uses the cuid as index
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2000/06/01
|
||||
@@ -67,7 +67,7 @@ class Login extends \CoreLibs\DB\IO
|
||||
private $username; // login name
|
||||
private $password; // login password
|
||||
private $logout; // logout button
|
||||
private $login_error; // login error code, can be matched to the array login_error_msg, which holds the string
|
||||
private $login_error = 0; // login error code, can be matched to the array login_error_msg, which holds the string
|
||||
private $password_change = false; // if this is set to true, the user can change passwords
|
||||
private $password_change_ok = false; // password change was successful
|
||||
private $password_forgot = false; // can we reset password and mail to user with new password set screen
|
||||
@@ -426,18 +426,22 @@ class Login extends \CoreLibs\DB\IO
|
||||
$pages = array();
|
||||
$edit_page_ids = array();
|
||||
// set pages access
|
||||
$q = "SELECT ep.edit_page_id, filename, ep.name AS edit_page_name, ep.order_number AS edit_page_order, menu, ";
|
||||
$q .= "popup, popup_x, popup_y, online, ear.level, ear.type ";
|
||||
$q .= "FROM edit_page ep, edit_page_access epa, edit_access_right ear ";
|
||||
$q = "SELECT ep.edit_page_id, ep.cuid, epca.cuid AS content_alias_uid, ep.filename, ep.name AS edit_page_name, ep.order_number AS edit_page_order, ep.menu, ";
|
||||
$q .= "ep.popup, ep.popup_x, ep.popup_y, ep.online, ear.level, ear.type ";
|
||||
$q .= "FROM edit_page ep ";
|
||||
$q .= "LEFT JOIN edit_page epca ON (epca.edit_page_id = ep.content_alias_edit_page_id)";
|
||||
$q .= ", edit_page_access epa, edit_access_right ear ";
|
||||
$q .= "WHERE ep.edit_page_id = epa.edit_page_id AND ear.edit_access_right_id = epa.edit_access_right_id ";
|
||||
$q .= "AND epa.enabled = 1 AND epa.edit_group_id = ".$res["edit_group_id"]." ";
|
||||
$q .= "ORDER BY ep.order_number";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
// page id array for sub data readout
|
||||
$edit_page_ids[] = $res['edit_page_id'];
|
||||
$edit_page_ids[$res['edit_page_id']] = $res['cuid'];
|
||||
// create the array for pages
|
||||
array_push($pages, array (
|
||||
$pages[$res['cuid']] = array (
|
||||
'edit_page_id' => $res['edit_page_id'],
|
||||
'cuid' => $res['cuid'],
|
||||
'content_alias_uid' => $res['content_alias_uid'], // for reference of content data on a differen page
|
||||
'filename' => $res['filename'],
|
||||
'page_name' => $res['edit_page_name'],
|
||||
'order' => $res['edit_page_order'],
|
||||
@@ -450,7 +454,7 @@ class Login extends \CoreLibs\DB\IO
|
||||
'acl_type' => $res['type'],
|
||||
'query' => array (),
|
||||
'visible' => array ()
|
||||
));
|
||||
);
|
||||
// make reference filename -> level
|
||||
$pages_acl[$res['filename']] = $res['level'];
|
||||
} // for each page
|
||||
@@ -458,33 +462,42 @@ class Login extends \CoreLibs\DB\IO
|
||||
$_edit_page_id = 0;
|
||||
$q = "SELECT epvg.edit_page_id, name, flag ";
|
||||
$q .= "FROM edit_visible_group evp, edit_page_visible_group epvg ";
|
||||
$q .= "WHERE evp.edit_visible_group_id = epvg.edit_visible_group_id AND epvg.edit_page_id IN (".join(', ', $edit_page_ids).") ";
|
||||
$q .= "WHERE evp.edit_visible_group_id = epvg.edit_visible_group_id AND epvg.edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
|
||||
$q .= "ORDER BY epvg.edit_page_id";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
if ($res['edit_page_id'] != $_edit_page_id) {
|
||||
// search the pos in the array push
|
||||
$pos = $this->arraySearchRecursive($res['edit_page_id'], $pages, 'edit_page_id');
|
||||
$_edit_page_id = $res['edit_page_id'];
|
||||
}
|
||||
$pages[$pos[0]]['visible'][$res['name']] = $res['flag'];
|
||||
$pages[$edit_page_ids[$res['edit_page_id']]]['visible'][$res['name']] = $res['flag'];
|
||||
}
|
||||
// get the same for the query strings
|
||||
$_edit_page_id = 0;
|
||||
$q = "SELECT eqs.edit_page_id, name, value, dynamic FROM edit_query_string eqs ";
|
||||
$q .= "WHERE enabled = 1 AND edit_page_id IN (".join(', ', $edit_page_ids).") ORDER BY eqs.edit_page_id";
|
||||
$q .= "WHERE enabled = 1 AND edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
|
||||
$q .= "ORDER BY eqs.edit_page_id";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
if ($res['edit_page_id'] != $_edit_page_id) {
|
||||
// search the pos in the array push
|
||||
$pos = $this->arraySearchRecursive($res['edit_page_id'], $pages, 'edit_page_id');
|
||||
$_edit_page_id = $res['edit_page_id'];
|
||||
}
|
||||
$pages[$pos[0]]['query'][] = array (
|
||||
$pages[$edit_page_ids[$res['edit_page_id']]]['query'][] = array (
|
||||
'name' => $res['name'],
|
||||
'value' => $res['value'],
|
||||
'dynamic' => $res['dynamic']
|
||||
);
|
||||
}
|
||||
|
||||
// get the page content and add them to the page
|
||||
$_edit_page_id = 0;
|
||||
$q = "SELECT epc.edit_page_id, epc.name, epc.uid, epc.order_number, epc.online, ear.level, ear.type ";
|
||||
$q .= "FROM edit_page_content epc, edit_access_right ear ";
|
||||
$q .= "WHERE epc.edit_access_right_id = ear.edit_access_right_id AND ";
|
||||
$q .= "epc.edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
|
||||
$q .= "ORDER BY epc.order_number";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
$pages[$edit_page_ids[$res['edit_page_id']]]['content'][$res['uid']] = array (
|
||||
'name' => $res['name'],
|
||||
'uid' => $res['uid'],
|
||||
'online' => $res['online'],
|
||||
'order' => $res['order_number'],
|
||||
// access name and level
|
||||
'acl_type' => $res['type'],
|
||||
'acl_level' => $res['level']
|
||||
);
|
||||
}
|
||||
// write back the pages data to the output array
|
||||
$_SESSION['PAGES'] = $pages;
|
||||
$_SESSION['PAGES_ACL_LEVEL'] = $pages_acl;
|
||||
// load the edit_access user rights
|
||||
@@ -593,7 +606,8 @@ class Login extends \CoreLibs\DB\IO
|
||||
if ($this->logout || $this->login_error) {
|
||||
// unregister and destroy session vars
|
||||
unset($_SESSION['EUID']);
|
||||
unset($_SESSION['GROUP_LEVEL']);
|
||||
unset($_SESSION['GROUP_ACL_LEVEL']);
|
||||
unset($_SESSION['USER_ACL_LEVEL']);
|
||||
unset($_SESSION['PAGES']);
|
||||
unset($_SESSION['USER_NAME']);
|
||||
unset($_SESSION['UNIT']);
|
||||
@@ -658,6 +672,7 @@ class Login extends \CoreLibs\DB\IO
|
||||
$this->acl['base'] = $_SESSION['USER_ACL_LEVEL'];
|
||||
}
|
||||
}
|
||||
$_SESSION['BASE_ACL_LEVEL'] = $this->acl['base'];
|
||||
|
||||
// set the current page acl
|
||||
// start with default acl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2006/08/15
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2003/03/24
|
||||
@@ -169,7 +169,7 @@ class Basic
|
||||
public function __construct($debug_all = 0, $echo_all = 1, $print_all = 0)
|
||||
{
|
||||
// set per run UID for logging
|
||||
$this->running_uid = hash($this->hash_algo, uniqid(rand(), true));
|
||||
$this->running_uid = hash($this->hash_algo, uniqid((string)rand(), true));
|
||||
|
||||
// internal info var
|
||||
$this->class_info["basic"] = array (
|
||||
@@ -369,8 +369,6 @@ class Basic
|
||||
$this->session_id = session_id();
|
||||
}
|
||||
|
||||
// [!!! DEPRECATED !!!] init crypt settings
|
||||
$this->cryptInit();
|
||||
// new better password init
|
||||
$this->passwordInit();
|
||||
|
||||
@@ -452,7 +450,7 @@ class Basic
|
||||
$this->endtime = ((float)$micro + (float)$timestamp);
|
||||
$string .= $simple ? 'End: ' : "<b>Stopped at</b>: ";
|
||||
}
|
||||
$string .= date("Y-m-d H:i:s", $timestamp);
|
||||
$string .= date("Y-m-d H:i:s", (int)$timestamp);
|
||||
$string .= " ".$micro;
|
||||
if ($this->starttime && $this->endtime) {
|
||||
$running_time = $this->endtime - $this->starttime;
|
||||
@@ -480,7 +478,7 @@ class Basic
|
||||
public static function printTime($set_microtime = -1)
|
||||
{
|
||||
list($microtime, $timestamp) = explode(' ', microtime());
|
||||
$string = date("Y-m-d H:i:s", $timestamp);
|
||||
$string = date("Y-m-d H:i:s", (int)$timestamp);
|
||||
// if microtime flag is -1 no round, if 0, no microtime, if >= 1, round that size
|
||||
if ($set_microtime == -1) {
|
||||
$string .= substr($microtime, 1);
|
||||
@@ -494,8 +492,8 @@ class Basic
|
||||
|
||||
// METHOD: fdebug
|
||||
// PARAMS: $string: data to write to file
|
||||
// $enter: default on true, if set to false, no linebreak (\n) will be put at the end
|
||||
// RETURN: none
|
||||
// $enter: default on true, if set to false, no linebreak (\n) will be put at the end
|
||||
// RETURN: none
|
||||
// DESC : writes a string to a file immediatly, for fast debug output
|
||||
public function fdebug($string, $enter = 1)
|
||||
{
|
||||
@@ -695,7 +693,7 @@ class Basic
|
||||
$this->log_file_unique_id = $GLOBALS['LOG_FILE_UNIQUE_ID'];
|
||||
}
|
||||
if (!$this->log_file_unique_id) {
|
||||
$GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid(mt_rand(), true)), 0, 8);
|
||||
$GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid((string)mt_rand(), true)), 0, 8);
|
||||
}
|
||||
$rpl_string = '_'.$this->log_file_unique_id; // add 8 char unique string
|
||||
} else {
|
||||
@@ -792,9 +790,9 @@ class Basic
|
||||
// PARAMS: $array
|
||||
// RETURN: string html formatted
|
||||
// DESC : prints a html formatted (pre) array
|
||||
public static function printAr($array)
|
||||
public static function printAr(array $array)
|
||||
{
|
||||
return "<pre>".print_r($array, 1)."</pre>";
|
||||
return "<pre>".print_r($array, true)."</pre>";
|
||||
}
|
||||
|
||||
// METHOD: checked
|
||||
@@ -951,6 +949,8 @@ class Basic
|
||||
$host_name = 'NA';
|
||||
}
|
||||
$this->host_port = $port ? $port : 80;
|
||||
$this->host_name = $host_name;
|
||||
// also return for old type call
|
||||
return $host_name;
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ class Basic
|
||||
// RETURN: array with the elements where the needle can be found in the haystack array
|
||||
// DESC : searches key = value in an array / array
|
||||
// only returns the first one found
|
||||
public static function arraySearchRecursive($needle, $haystack, $key_lookin = "")
|
||||
public static function arraySearchRecursive($needle, $haystack, $key_lookin = '')
|
||||
{
|
||||
$path = null;
|
||||
if (!is_array($haystack)) {
|
||||
@@ -1360,9 +1360,9 @@ class Basic
|
||||
public static function timeStringFormat($timestamp, $show_micro = true)
|
||||
{
|
||||
// check if the timestamp has any h/m/s/ms inside, if yes skip
|
||||
if (!preg_match("/(h|m|s|ms)/", $timestamp)) {
|
||||
if (!preg_match("/(h|m|s|ms)/", (string)$timestamp)) {
|
||||
$ms = 0;
|
||||
list ($timestamp, $ms) = explode('.', round($timestamp, 4));
|
||||
list ($timestamp, $ms) = explode('.', (string)round($timestamp, 4));
|
||||
$timegroups = array (86400, 3600, 60, 1);
|
||||
$labels = array ('d', 'h', 'm', 's');
|
||||
$time_string = '';
|
||||
@@ -1584,14 +1584,14 @@ class Basic
|
||||
3 => 'png'
|
||||
);
|
||||
|
||||
if ($cache_source) {
|
||||
if (!empty($cache_source)) {
|
||||
$tmp_src = $cache_source;
|
||||
} else {
|
||||
$tmp_src = BASE.TMP;
|
||||
}
|
||||
// check if pic has a path, and override next sets
|
||||
if (strstr($pic, '/') === false) {
|
||||
if (!$path) {
|
||||
if (empty($path)) {
|
||||
$path = BASE;
|
||||
}
|
||||
$filename = $path.MEDIA.PICTURES.$pic;
|
||||
@@ -1847,6 +1847,7 @@ class Basic
|
||||
// there is no auto init for this at the moment
|
||||
private function cryptInit()
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// SET CRYPT SALT PREFIX:
|
||||
// the prefix string is defined by what the server can do
|
||||
// first we check if we can do blowfish, if not we try md5 and then des
|
||||
@@ -1892,6 +1893,7 @@ class Basic
|
||||
// DESC : creates a random string from alphanumeric characters: A-Z a-z 0-9 ./
|
||||
private function cryptSaltString($nSize = 22)
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// A-Z is 65,90
|
||||
// a-z is 97,122
|
||||
// 0-9 is 48,57
|
||||
@@ -1921,6 +1923,7 @@ class Basic
|
||||
// DESC : encrypts the string with blowfish and returns the full string + salt part that needs to be stored somewhere (eg DB)
|
||||
public function cryptString($string)
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// the crypt prefix is set in the init of the class
|
||||
// uses the random string method to create the salt
|
||||
return crypt($string, $this->cryptSaltPrefix.$this->cryptSaltString($this->cryptSaltSize).$this->cryptSaltSuffix);
|
||||
@@ -1934,6 +1937,7 @@ class Basic
|
||||
// DESC : compares the string with the crypted one, is counter method to cryptString
|
||||
public function verifyCryptString($string, $crypt)
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// the full crypted string needs to be passed on to the salt, so the init (for blowfish) and salt are passed on
|
||||
if (crypt($string, $crypt) == $crypt) {
|
||||
return true;
|
||||
@@ -2457,6 +2461,7 @@ class Basic
|
||||
public function checkConvert($string, $from_encoding, $to_encoding)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->checkConvertEncoding($string, $from_encoding, $to_encoding);
|
||||
}
|
||||
|
||||
@@ -2469,144 +2474,168 @@ class Basic
|
||||
public function running_time($simple = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->runningTime($simple);
|
||||
}
|
||||
|
||||
public static function print_time($set_microtime = -1)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::printTime($set_microtime);
|
||||
}
|
||||
|
||||
private function fdebug_fp($flag = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->fdebugFP($flag);
|
||||
}
|
||||
|
||||
public function debug_for($type, $flag)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->debugFor($type, $flag);
|
||||
}
|
||||
|
||||
public function get_caller_method($level = 2)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->getCallerMethod($level);
|
||||
}
|
||||
|
||||
public function merge_errors($error_msg = array ())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->mergeErrors($error_msg);
|
||||
}
|
||||
|
||||
public function print_error_msg($string = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->printErrorMsg($string);
|
||||
}
|
||||
|
||||
private function write_error_msg($level, $error_string)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->writeErrorMsg($level, $error_string);
|
||||
}
|
||||
|
||||
public function reset_error_msg($level = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->resetErrorMsg($level);
|
||||
}
|
||||
|
||||
public static function print_ar($array)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::printAr($array);
|
||||
}
|
||||
|
||||
public function magic_links($string, $target = "_blank")
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->magicLinks($string, $target);
|
||||
}
|
||||
|
||||
private function create_url($href, $atag, $_1, $_2, $_3, $name, $class)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->createUrl($href, $atag, $_1, $_2, $_3, $name, $class);
|
||||
}
|
||||
|
||||
private function create_email($mailto, $atag, $_1, $_2, $_3, $title, $class)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->createEmail($mailto, $atag, $_1, $_2, $_3, $title, $class);
|
||||
}
|
||||
|
||||
public function get_host_name()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->getHostName();
|
||||
}
|
||||
|
||||
public static function get_page_name($strip_ext = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::getPageName($strip_ext);
|
||||
}
|
||||
|
||||
public static function get_filename_ending($filename)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::getFilenameEnding($filename);
|
||||
}
|
||||
|
||||
public static function array_search_recursive($needle, $haystack, $key_lookin = "")
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::arraySearchRecursive($needle, $haystack, $key_lookin);
|
||||
}
|
||||
|
||||
public static function array_search_recursive_all($needle, $haystack, $key, $path = null)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::arraySearchRecursiveAll($needle, $haystack, $key, $path);
|
||||
}
|
||||
|
||||
public static function array_search_simple($array, $key, $value)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::arraySearchSimple($array, $key, $value);
|
||||
}
|
||||
|
||||
public static function _mb_mime_encode($string, $encoding)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::__mbMimeEncode($string, $encoding);
|
||||
}
|
||||
|
||||
public function _crc32b($string)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__crc32b($string);
|
||||
}
|
||||
|
||||
public function _sha1_short($string, $use_sha = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__sha1Short($string, $use_sha);
|
||||
}
|
||||
|
||||
public function _hash($string, $hash_type = 'adler32')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__hash($string, $hash_type);
|
||||
}
|
||||
|
||||
public static function in_array_any($needle, $haystack)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::inArrayAny($needle, $haystack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2002/12/17
|
||||
@@ -69,7 +69,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
// set primary key for given table_array
|
||||
if (is_array($this->table_array)) {
|
||||
foreach ($this->table_array as $key => $value) {
|
||||
if ($value['pk']) {
|
||||
if (isset($value['pk'])) {
|
||||
$this->pk_name = $key;
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
$q_where = '';
|
||||
foreach ($this->table_array as $column => $data_array) {
|
||||
// suchen nach bildern und lschen ...
|
||||
if ($this->table_array[$column]['file'] && file_exists($this->table_array[$column]['url'].$this->table_array[$column]['value'])) {
|
||||
if (!empty($this->table_array[$column]['file']) &&
|
||||
file_exists($this->table_array[$column]['url'].$this->table_array[$column]['value'])
|
||||
) {
|
||||
if (file_exists($this->table_array[$column]['path'].$this->table_array[$column]['value'])) {
|
||||
unlink($this->table_array[$column]['path'].$this->table_array[$column]['value']);
|
||||
}
|
||||
@@ -214,7 +216,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
}
|
||||
}
|
||||
// if we have a foreign key
|
||||
if ($this->table_array[$column]['fk']) {
|
||||
if (!empty($this->table_array[$column]['fk'])) {
|
||||
// create FK constraint checks
|
||||
if ($q_where) {
|
||||
$q_where .= ' AND ';
|
||||
@@ -263,7 +265,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
$q_select .= $column;
|
||||
|
||||
// check FK ...
|
||||
if ($this->table_array[$column]['fk'] && $this->table_array[$column]['value']) {
|
||||
if (isset($this->table_array[$column]['fk']) && isset($this->table_array[$column]['value'])) {
|
||||
if ($q_where) {
|
||||
$q_where .= ' AND ';
|
||||
}
|
||||
@@ -290,7 +292,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
if ($edit) {
|
||||
$this->table_array[$column]['value'] = $res[$column];
|
||||
// if password, also write to hidden
|
||||
if ($this->table_array[$column]['type'] == 'password') {
|
||||
if (isset($this->table_array[$column]['type']) &&
|
||||
$this->table_array[$column]['type'] == 'password'
|
||||
) {
|
||||
$this->table_array[$column]['HIDDEN_value'] = $res[$column];
|
||||
}
|
||||
} else {
|
||||
@@ -336,7 +340,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
foreach ($this->table_array as $column => $data_array) {
|
||||
/********************************* START FILE *************************************/
|
||||
// file upload
|
||||
if ($this->table_array[$column]['file']) {
|
||||
if (isset($this->table_array[$column]['file'])) {
|
||||
// falls was im tmp drinnen, sprich ein upload, datei kopieren, Dateinamen in db schreiben
|
||||
// falls datei schon am server (physischer pfad), dann einfach url in db schreiben (update)
|
||||
// falls in 'delete' 'ja' dann loeschen (und gibts eh nur beim update)
|
||||
@@ -384,9 +388,16 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
/********************************* END FILE **************************************/
|
||||
|
||||
// do not write 'pk' (primary key) or 'view' values
|
||||
if (!$this->table_array[$column]['pk'] && $this->table_array[$column]['type'] != 'view' && strlen($column) > 0) {
|
||||
if (!isset($this->table_array[$column]['pk']) &&
|
||||
isset($this->table_array[$column]['type']) &&
|
||||
$this->table_array[$column]['type'] != 'view' &&
|
||||
strlen($column) > 0
|
||||
) {
|
||||
// for password use hidden value if main is not set
|
||||
if ($this->table_array[$column]['type'] == 'password' && !$this->table_array[$column]['value']) {
|
||||
if (isset($this->table_array[$column]['type']) &&
|
||||
$this->table_array[$column]['type'] == 'password' &&
|
||||
empty($this->table_array[$column]['value'])
|
||||
) {
|
||||
$this->table_array[$column]['value'] = $this->table_array[$column]['HIDDEN_value'];
|
||||
}
|
||||
if (!$insert) {
|
||||
@@ -399,35 +410,47 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
if (strlen($q_data)) {
|
||||
$q_data .= ', ';
|
||||
}
|
||||
if ($q_vars) {
|
||||
if (strlen($q_vars)) {
|
||||
$q_vars .= ', ';
|
||||
}
|
||||
$q_vars .= $column;
|
||||
}
|
||||
// integer is different
|
||||
if ($this->table_array[$column]['int'] || $this->table_array[$column]['int_null']) {
|
||||
$this->debug('write_check', '[$column]['.$this->table_array[$column]['value'].'] Foo: '.isset($this->table_array[$column]['value']).' | '.$this->table_array[$column]['int_null']);
|
||||
if (!$this->table_array[$column]['value'] && $this->table_array[$column]['int_null']) {
|
||||
if (isset($this->table_array[$column]['int']) || isset($this->table_array[$column]['int_null'])) {
|
||||
$this->debug('write_check', '['.$column.']['.$this->table_array[$column]['value'].']['.$this->table_array[$column]['type'].'] VALUE SET: '.isset($this->table_array[$column]['value']).' | INT NULL: '.isset($this->table_array[$column]['int_null']));
|
||||
if (isset($this->table_array[$column]['value']) &&
|
||||
!$this->table_array[$column]['value'] &&
|
||||
isset($this->table_array[$column]['int_null'])
|
||||
) {
|
||||
$_value = 'NULL';
|
||||
} elseif (!isset($this->table_array[$column]['value'])) {
|
||||
} elseif (!isset($this->table_array[$column]['value']) ||
|
||||
(isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value'])
|
||||
) {
|
||||
$_value = 0;
|
||||
} else {
|
||||
$_value = $this->table_array[$column]['value'];
|
||||
}
|
||||
$q_data .= $_value;
|
||||
} elseif ($this->table_array[$column]['bool']) {
|
||||
} elseif (isset($this->table_array[$column]['bool'])) {
|
||||
// boolean storeage (reverse check on ifset)
|
||||
$q_data .= "'".$this->dbBoolean($this->table_array[$column]['value'], true)."'";
|
||||
} elseif ($this->table_array[$column]["interval"]) {
|
||||
} elseif (isset($this->table_array[$column]['interval'])) {
|
||||
// for interval we check if no value, then we set null
|
||||
if (!$this->table_array[$column]['value']) {
|
||||
if (!isset($this->table_array[$column]['value']) ||
|
||||
(isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value'])
|
||||
) {
|
||||
$_value = 'NULL';
|
||||
} elseif (isset($this->table_array[$column]['value'])) {
|
||||
$_value = $this->table_array[$column]['value'];
|
||||
}
|
||||
$q_data .= $_value;
|
||||
} else {
|
||||
// if the error check is json, we set field to null if NOT set
|
||||
// else normal string write
|
||||
if ($this->table_array[$column]['error_check'] == 'json' && !$this->table_array[$column]['value']) {
|
||||
if (isset($this->table_array[$column]['error_check']) &&
|
||||
$this->table_array[$column]['error_check'] == 'json' &&
|
||||
(!isset($this->table_array[$column]['value']) || (isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value']))
|
||||
) {
|
||||
$q_data .= 'NULL';
|
||||
} else {
|
||||
// normal string
|
||||
@@ -450,8 +473,8 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
// create select part & addition FK part
|
||||
foreach ($this->table_array as $column => $data_array) {
|
||||
// check FK ...
|
||||
if ($this->table_array[$column]['fk'] && $this->table_array[$column]['value']) {
|
||||
if ($q_where) {
|
||||
if (isset($this->table_array[$column]['fk']) && isset($this->table_array[$column]['value'])) {
|
||||
if (!empty($q_where)) {
|
||||
$q_where .= ' AND ';
|
||||
}
|
||||
$q_where .= $column .= ' = '.$this->table_array[$column]['value'];
|
||||
@@ -459,11 +482,11 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
}
|
||||
|
||||
// if no PK set, then get max ID from DB
|
||||
if (!$this->table_array[$this->pk_name]["value"]) {
|
||||
if (!$this->table_array[$this->pk_name]['value']) {
|
||||
// max id, falls INSERT
|
||||
$q = 'SELECT MAX('.$this->pk_name.') + 1 AS pk_id FROM '.$this->table_name;
|
||||
$res = $this->dbReturnRow($q);
|
||||
if (!$res['pk_id']) {
|
||||
if (!isset($res['pk_id'])) {
|
||||
$res['pk_id'] = 1;
|
||||
}
|
||||
$this->table_array[$this->pk_name]['value'] = $res['pk_id'];
|
||||
@@ -474,7 +497,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
$q .= $q_data;
|
||||
$q .= ' WHERE ';
|
||||
$q .= $this->pk_name.' = '.$this->table_array[$this->pk_name]['value'].' ';
|
||||
if ($q_where) {
|
||||
if (!empty($q_where)) {
|
||||
$q .= ' AND '.$q_where;
|
||||
}
|
||||
// set pk_id ... if it has changed or so
|
||||
@@ -486,8 +509,8 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
// write primary key too
|
||||
// if ($q_data)
|
||||
// $q .= ", ";
|
||||
// $q .= $this->pk_name." = ".$this->table_array[$this->pk_name]["value"]." ";
|
||||
// $this->pk_id = $this->table_array[$this->pk_name]["value"];
|
||||
// $q .= $this->pk_name." = ".$this->table_array[$this->pk_name]['value']." ";
|
||||
// $this->pk_id = $this->table_array[$this->pk_name]['value'];
|
||||
}
|
||||
// return success or not
|
||||
if (!$this->dbExec($q)) {
|
||||
@@ -512,48 +535,56 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
public function convert_data($text)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->convertData($text);
|
||||
}
|
||||
|
||||
public function convert_entities($text)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->convertEntities($text);
|
||||
}
|
||||
|
||||
public function db_dump_array($write = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbDumpArray($write);
|
||||
}
|
||||
|
||||
public function db_check_pk_set()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCheckPkSet();
|
||||
}
|
||||
|
||||
public function db_reset_array($reset_pk = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbResetArray($reset_pk);
|
||||
}
|
||||
|
||||
public function db_delete($table_array = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbDelete($table_array);
|
||||
}
|
||||
|
||||
public function db_read($edit = 0, $table_array = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbRead($edit, $table_array);
|
||||
}
|
||||
|
||||
public function db_write($addslashes = 0, $table_array = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbWrite($addslashes, $table_array);
|
||||
}
|
||||
} // end of class
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2000/11/23
|
||||
@@ -784,7 +784,7 @@ class IO extends \CoreLibs\Basic
|
||||
// we have returning, now we need to check if we get one or many returned
|
||||
// we'll need to loop this, if we have multiple insert_id returns
|
||||
while ($_insert_id = $this->db_functions->__dbFetchArray($this->cursor, PGSQL_ASSOC)) {
|
||||
// echo "*** RETURNING: ".print_r($_insert_id, 1)."<br>";
|
||||
// echo "*** RETURNING: ".print_r($_insert_id, true)."<br>";
|
||||
$this->insert_id[] = $_insert_id;
|
||||
}
|
||||
// if we have only one, revert from array to single
|
||||
@@ -1307,10 +1307,11 @@ class IO extends \CoreLibs\Basic
|
||||
|
||||
// METHOD: dbReturnArray
|
||||
// WAS : db_return_array
|
||||
// PARAMS: query -> the query to be executed, named_only -> if true, only name ref are returned
|
||||
// PARAMS: query -> the query to be executed
|
||||
// assoc_only -> if true, only name ref are returned
|
||||
// RETURN: array of hashes (row -> fields)
|
||||
// DESC : createds an array of hashes of the query (all data)
|
||||
public function dbReturnArray($query, $named_only = 0)
|
||||
public function dbReturnArray($query, $assoc_only = false)
|
||||
{
|
||||
if (!$query) {
|
||||
$this->error_id = 11;
|
||||
@@ -1324,14 +1325,9 @@ class IO extends \CoreLibs\Basic
|
||||
return false;
|
||||
}
|
||||
$cursor = $this->dbExec($query);
|
||||
while ($res = $this->dbFetchArray($cursor)) {
|
||||
while ($res = $this->dbFetchArray($cursor, $assoc_only)) {
|
||||
for ($i = 0; $i < $this->num_fields; $i ++) {
|
||||
// cereated mixed, first name
|
||||
$data[$this->field_names[$i]] = $res[$this->field_names[$i]];
|
||||
// then number
|
||||
if (!$named_only) {
|
||||
$data[$i] = $res[$this->field_names[$i]];
|
||||
}
|
||||
}
|
||||
$rows[] = $data;
|
||||
}
|
||||
@@ -1590,7 +1586,7 @@ class IO extends \CoreLibs\Basic
|
||||
public function dbCompareVersion($compare)
|
||||
{
|
||||
// compare has =, >, < prefix, and gets stripped, if the rest is not X.Y format then error
|
||||
preg_match("/^([<>=]{1,2})(\d{1,2})\.(\d{1,2})/", $compare, $matches);
|
||||
preg_match("/^([<>=]{1,})(\d{1,})\.(\d{1,})/", $compare, $matches);
|
||||
$compare = $matches[1];
|
||||
$to_master = $matches[2];
|
||||
$to_minor = $matches[3];
|
||||
@@ -1601,7 +1597,9 @@ class IO extends \CoreLibs\Basic
|
||||
}
|
||||
// db_version can return X.Y.Z
|
||||
// we only compare the first two
|
||||
list ($master, $minor, $_other) = explode('.', $this->dbVersion());
|
||||
preg_match("/^(\d{1,})\.(\d{1,})\.?(\d{1,})?/", $this->dbVersion(), $matches);
|
||||
$master = $matches[1];
|
||||
$minor = $matches[2];
|
||||
$version = $master.($minor < 10 ? '0' : '').$minor;
|
||||
$return = false;
|
||||
// compare
|
||||
@@ -1866,264 +1864,308 @@ class IO extends \CoreLibs\Basic
|
||||
private function _connect_to_db()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__connectToDB();
|
||||
}
|
||||
|
||||
private function _close_db()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__closeDB();
|
||||
}
|
||||
|
||||
private function _check_query_for_select($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__checkQueryForSelect($query);
|
||||
}
|
||||
|
||||
private function _check_query_for_insert($query, $pure = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__checkQueryForInsert($query, $pure);
|
||||
}
|
||||
|
||||
private function _print_array($array)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__printArray($array);
|
||||
}
|
||||
|
||||
private function _db_debug($debug_id, $error_string, $id = '', $type = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbDebug($debug_id, $error_string, $id, $type);
|
||||
}
|
||||
|
||||
public function _db_error($cursor = '', $msg = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbError($cursor, $msg);
|
||||
}
|
||||
|
||||
private function _db_convert_encoding($row)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbConvertEncoding($row);
|
||||
}
|
||||
|
||||
private function _db_debug_prepare($stm_name, $data = array())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbDebugPrepare($stm_name, $data);
|
||||
}
|
||||
|
||||
private function _db_return_table($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbReturnTable($query);
|
||||
}
|
||||
|
||||
private function _db_prepare_exec($query, $pk_name)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbPrepareExec($query, $pk_name);
|
||||
}
|
||||
|
||||
private function _db_post_exec()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbPostExec();
|
||||
}
|
||||
|
||||
public function db_set_debug($debug = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSetDebug($debug);
|
||||
}
|
||||
|
||||
public function db_reset_query_called($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbResetQueryCalled($query);
|
||||
}
|
||||
|
||||
public function db_get_query_called($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbGetQueryCalled($query);
|
||||
}
|
||||
|
||||
public function db_close()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbClose();
|
||||
}
|
||||
|
||||
public function db_set_schema($db_schema = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSetSchema($db_schema);
|
||||
}
|
||||
|
||||
public function db_get_schema()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbGetSchema();
|
||||
}
|
||||
|
||||
public function db_set_encoding($db_encoding = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSetEncoding($db_encoding);
|
||||
}
|
||||
|
||||
public function db_info($show = 1)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbInfo($show);
|
||||
}
|
||||
|
||||
public function db_dump_data($query = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbDumpData($query);
|
||||
}
|
||||
|
||||
public function db_return($query, $reset = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbReturn($query, $reset);
|
||||
}
|
||||
|
||||
public function db_cache_reset($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCacheReset($query);
|
||||
}
|
||||
|
||||
public function db_exec($query = 0, $pk_name = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbExec($query, $pk_name);
|
||||
}
|
||||
|
||||
public function db_exec_async($query, $pk_name = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbExecAsync($query, $pk_name);
|
||||
}
|
||||
|
||||
public function db_check_async()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCheckAsync();
|
||||
}
|
||||
|
||||
public function db_fetch_array($cursor = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbFetchArray($cursor);
|
||||
}
|
||||
|
||||
public function db_return_row($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbReturnRow($query);
|
||||
}
|
||||
|
||||
public function db_return_array($query, $named_only = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbReturnArray($query, $named_only);
|
||||
}
|
||||
|
||||
public function db_cursor_pos($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCursorPos($query);
|
||||
}
|
||||
|
||||
public function db_cursor_num_rows($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCursorNumRows($query);
|
||||
}
|
||||
|
||||
public function db_show_table_meta_data($table, $schema = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbShowTableMetaData($table, $schema);
|
||||
}
|
||||
|
||||
public function db_prepare($stm_name, $query, $pk_name = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbPrepare($stm_name, $query, $pk_name);
|
||||
}
|
||||
|
||||
public function db_execute($stm_name, $data = array())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbExecute($stm_name, $data);
|
||||
}
|
||||
|
||||
public function db_escape_string($string)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbEscapeString($string);
|
||||
}
|
||||
|
||||
public function db_escape_bytea($bytea)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbEscapeBytea($bytea);
|
||||
}
|
||||
|
||||
public function db_version()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbVersion();
|
||||
}
|
||||
|
||||
public function db_compare_version($compare)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCompareVersion($compare);
|
||||
}
|
||||
|
||||
public function db_boolean($string, $rev = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbBoolean($string, $rev);
|
||||
}
|
||||
|
||||
public function db_write_data($write_array, $not_write_array, $primary_key, $table, $data = array ())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbWriteData($write_array, $not_write_array, $primary_key, $table, $data);
|
||||
}
|
||||
|
||||
public function db_write_data_ext($write_array, $primary_key, $table, $not_write_array = array (), $not_write_update_array = array (), $data = array ())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbWriteDataExt($write_array, $primary_key, $table, $not_write_array, $not_write_update_array, $data);
|
||||
}
|
||||
|
||||
public function db_time_format($age, $show_micro = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbTimeFormat($age, $show_micro);
|
||||
}
|
||||
|
||||
public function db_array_parse($text)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbArrayParse($text);
|
||||
}
|
||||
|
||||
public function db_sql_escape($value, $kbn = "")
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSqlEscape($value, $kbn);
|
||||
}
|
||||
} // end if db class
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2003/04/09
|
||||
@@ -376,7 +376,7 @@ class PgSQL
|
||||
// DESC : wrapper for pg_escape_string
|
||||
public function __dbEscapeString($string)
|
||||
{
|
||||
return pg_escape_string($this->dbh, $string);
|
||||
return pg_escape_string($this->dbh, (string)$string);
|
||||
}
|
||||
|
||||
// METHOD: __dbEscapeBytea
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
Copyright (c) 2003, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2004/11/18
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* Class ProgressBar
|
||||
*
|
||||
@@ -481,7 +481,7 @@ class ProgressBar
|
||||
$js .= ' }'."\n";
|
||||
$js .= '}'."\n";
|
||||
|
||||
// print "DUMP LABEL: <br><pre>".print_r($this->label, 1)."</pre><br>";
|
||||
// print "DUMP LABEL: <br><pre>".print_r($this->label, true)."</pre><br>";
|
||||
foreach ($this->label as $name => $data) {
|
||||
// set what type of move we do
|
||||
$move_prefix = $data['type'] == 'button' ? 'margin' : 'padding';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2004/12/21
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2011/2/8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Autoloader;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user