From 9f1b73809325f3ff99fc22b660295dcde7d11999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Cesar=20Laura=20Avenda=C3=B1o?= Date: Thu, 26 May 2022 14:56:23 +0000 Subject: [PATCH] PMCORE-3844 --- config/deprecatedFiles.lst | 2 + .../HTMLPurifier/ChildDef/Custom.php | 2 +- .../HTMLPurifier/HTMLPurifier/Config.php | 6 +- .../HTMLPurifier/Printer/HTMLDefinition.php | 4 +- .../HTMLPurifier/TagTransform/Font.php | 2 +- thirdparty/creole/Creole.php | 8 +- .../creole/drivers/oracle/OCI8Connection.php | 2 - .../creole/drivers/pgsql/PgSQLConnection.php | 10 +- .../creole/drivers/pgsql/PgSQLResultSet.php | 2 +- .../creole/util/sql/SQLStatementExtractor.php | 2 +- thirdparty/pake/pakeApp.class.php | 2 +- thirdparty/pake/pakeFunction.php | 1 - thirdparty/pake/pakeGetopt.class.php | 2 +- thirdparty/pake/pakeYaml.class.php | 21 ++- thirdparty/pear/DB.php | 6 +- thirdparty/pear/DB/common.php | 4 +- thirdparty/pear/DB/mysqli.php | 10 +- thirdparty/pear/DB/oci8.php | 4 +- thirdparty/pear/DB/odbc.php | 2 +- thirdparty/pear/DB/pgsql.php | 8 +- thirdparty/pear/Log/composite.php | 2 +- thirdparty/pear/Log/console.php | 2 +- thirdparty/pear/Log/daemon.php | 2 +- thirdparty/pear/Log/display.php | 2 +- thirdparty/pear/Log/error_log.php | 2 +- thirdparty/pear/Log/file.php | 2 +- thirdparty/pear/Log/firebug.php | 2 +- thirdparty/pear/Log/mail.php | 2 +- thirdparty/pear/Log/mcal.php | 2 +- thirdparty/pear/Log/mdb2.php | 2 +- thirdparty/pear/Log/null.php | 2 +- thirdparty/pear/Log/observer.php | 8 +- thirdparty/pear/Log/sql.php | 2 +- thirdparty/pear/Log/syslog.php | 2 +- thirdparty/pear/Log/win.php | 2 +- thirdparty/pear/OS/Guess.php | 10 +- thirdparty/pear/PEAR/Autoloader.php | 8 +- thirdparty/pear/PEAR/Builder.php | 6 +- thirdparty/pear/PEAR/Command.php | 10 +- thirdparty/pear/PEAR/Command/Auth.php | 2 +- thirdparty/pear/PEAR/Command/Build.php | 4 +- thirdparty/pear/PEAR/Command/Common.php | 10 +- thirdparty/pear/PEAR/Command/Config.php | 2 +- thirdparty/pear/PEAR/Command/Install.php | 8 +- thirdparty/pear/PEAR/Command/Mirror.php | 4 +- thirdparty/pear/PEAR/Command/Package.php | 10 +- thirdparty/pear/PEAR/Command/Registry.php | 10 +- thirdparty/pear/PEAR/Common.php | 20 ++- thirdparty/pear/PEAR/Config.php | 4 +- thirdparty/pear/PEAR/Dependency.php | 2 +- thirdparty/pear/PEAR/Frontend/CLI.php | 4 +- thirdparty/pear/PEAR/Installer.php | 20 +-- thirdparty/pear/PEAR/Packager.php | 6 +- thirdparty/pear/PEAR/Registry.php | 13 +- thirdparty/pear/PEAR/Remote.php | 138 +----------------- thirdparty/pear/PearSystem.php | 2 +- thirdparty/phing/Phing.php | 5 +- thirdparty/phing/lib/Capsule.php | 13 +- thirdparty/phing/lib/Zip.php | 56 +++---- thirdparty/phing/mappers/RegexpMapper.php | 2 +- thirdparty/phing/system/io/BufferedReader.php | 2 +- thirdparty/phing/system/io/FileReader.php | 23 ++- thirdparty/phing/system/io/FileSystem.php | 77 ++++++---- thirdparty/phing/system/io/UnixFileSystem.php | 16 +- .../phing/system/io/Win32FileSystem.php | 46 +++--- thirdparty/phing/system/util/Properties.php | 2 +- .../phing/tasks/ext/pearpackage/Fileset.php | 2 +- thirdparty/phing/tasks/system/CvsPassTask.php | 4 +- .../phing/tasks/system/PropertyTask.php | 2 +- thirdparty/phing/types/Path.php | 4 +- thirdparty/phing/util/FileUtils.php | 10 +- thirdparty/phing/util/PathTokenizer.php | 2 +- thirdparty/phing/util/StringHelper.php | 4 +- .../engine/builder/DataModelBuilder.php | 2 +- .../sql/sqlite/SqliteDataSQLBuilder.php | 47 ------ .../database/transform/XmlToAppData.php | 2 +- .../propel/engine/platform/SqlitePlatform.php | 92 ------------ .../phing/AbstractPropelDataModelTask.php | 2 +- .../propel/validator/MatchValidator.php | 2 +- .../propel/validator/NotMatchValidator.php | 2 +- workflow/engine/controllers/appProxy.php | 2 +- .../engine/src/ProcessMaker/Util/helpers.php | 2 +- 82 files changed, 300 insertions(+), 552 deletions(-) delete mode 100644 thirdparty/propel-generator/classes/propel/engine/builder/sql/sqlite/SqliteDataSQLBuilder.php delete mode 100644 thirdparty/propel-generator/classes/propel/engine/platform/SqlitePlatform.php diff --git a/config/deprecatedFiles.lst b/config/deprecatedFiles.lst index 410327d80..84f8dbe47 100644 --- a/config/deprecatedFiles.lst +++ b/config/deprecatedFiles.lst @@ -178,4 +178,6 @@ thirdparty/pear/package-PEAR.xml thirdparty/pear/README thirdparty/pear/template.spec thirdparty/pear/UDDI.php +thirdparty/propel-generator/classes/propel/engine/builder/sql/sqlite/SqliteDataSQLBuilder.php +thirdparty/propel-generator/classes/propel/engine/platform/SqlitePlatform.php thirdparty/tcpdf \ No newline at end of file diff --git a/thirdparty/HTMLPurifier/HTMLPurifier/ChildDef/Custom.php b/thirdparty/HTMLPurifier/HTMLPurifier/ChildDef/Custom.php index 128132e96..f515888a1 100644 --- a/thirdparty/HTMLPurifier/HTMLPurifier/ChildDef/Custom.php +++ b/thirdparty/HTMLPurifier/HTMLPurifier/ChildDef/Custom.php @@ -45,7 +45,7 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef protected function _compileRegex() { $raw = str_replace(' ', '', $this->dtd_regex); - if ($raw{0} != '(') { + if ($raw[0] != '(') { $raw = "($raw)"; } $el = '[#a-zA-Z0-9_.-]+'; diff --git a/thirdparty/HTMLPurifier/HTMLPurifier/Config.php b/thirdparty/HTMLPurifier/HTMLPurifier/Config.php index 7ada59b94..4bf8fa19e 100644 --- a/thirdparty/HTMLPurifier/HTMLPurifier/Config.php +++ b/thirdparty/HTMLPurifier/HTMLPurifier/Config.php @@ -784,17 +784,17 @@ class HTMLPurifier_Config * @param array $array $_GET or $_POST array to import * @param string|bool $index Index/name that the config variables are in * @param array|bool $allowed List of allowed namespaces/directives - * @param bool $mq_fix Boolean whether or not to enable magic quotes fix + * @param bool $mq_fix Boolean whether or not to enable magic quotes fix (DEPRECATED, now is always in false) * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy * * @return array */ - public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) + public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = false, $schema = null) { if ($index !== false) { $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); } - $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); + $mq = $mq_fix; $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); $ret = array(); diff --git a/thirdparty/HTMLPurifier/HTMLPurifier/Printer/HTMLDefinition.php b/thirdparty/HTMLPurifier/HTMLPurifier/Printer/HTMLDefinition.php index 5f2f2f8a7..ae8639176 100644 --- a/thirdparty/HTMLPurifier/HTMLPurifier/Printer/HTMLDefinition.php +++ b/thirdparty/HTMLPurifier/HTMLPurifier/Printer/HTMLDefinition.php @@ -43,8 +43,8 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer $ret .= $this->element('caption', 'Doctype'); $ret .= $this->row('Name', $doctype->name); $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); - $ret .= $this->row('Default Modules', implode($doctype->modules, ', ')); - $ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', ')); + $ret .= $this->row('Default Modules', implode(', ', $doctype->modules)); + $ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules)); $ret .= $this->end('table'); return $ret; } diff --git a/thirdparty/HTMLPurifier/HTMLPurifier/TagTransform/Font.php b/thirdparty/HTMLPurifier/HTMLPurifier/TagTransform/Font.php index 7853d90bc..768c9b153 100644 --- a/thirdparty/HTMLPurifier/HTMLPurifier/TagTransform/Font.php +++ b/thirdparty/HTMLPurifier/HTMLPurifier/TagTransform/Font.php @@ -75,7 +75,7 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform if (isset($attr['size'])) { // normalize large numbers if ($attr['size'] !== '') { - if ($attr['size']{0} == '+' || $attr['size']{0} == '-') { + if ($attr['size'][0] == '+' || $attr['size'][0] == '-') { $size = (int)$attr['size']; if ($size < -2) { $attr['size'] = '-2'; diff --git a/thirdparty/creole/Creole.php b/thirdparty/creole/Creole.php index c3ffd7ea2..ede7189a1 100644 --- a/thirdparty/creole/Creole.php +++ b/thirdparty/creole/Creole.php @@ -22,13 +22,7 @@ include_once 'creole/SQLException.php'; include_once 'creole/Connection.php'; -// static: -// track errors is used by drivers to get better error messages -// make sure it's set. - -@ini_set('track_errors', true); - - use ProcessMaker\Core\System; +use ProcessMaker\Core\System; /** * This is the class that manages the database drivers. diff --git a/thirdparty/creole/drivers/oracle/OCI8Connection.php b/thirdparty/creole/drivers/oracle/OCI8Connection.php index 5a6a34ef9..39f05e562 100644 --- a/thirdparty/creole/drivers/oracle/OCI8Connection.php +++ b/thirdparty/creole/drivers/oracle/OCI8Connection.php @@ -76,8 +76,6 @@ class OCI8Connection extends ConnectionCommon implements Connection ? 'oci_pconnect' : 'oci_connect'; $encoding = !empty($dsninfo['encoding']) ? $dsninfo['encoding'] : null; - - @ini_set( 'track_errors', true ); if ( $hostspec && $port ) { diff --git a/thirdparty/creole/drivers/pgsql/PgSQLConnection.php b/thirdparty/creole/drivers/pgsql/PgSQLConnection.php index a6095295b..4a7a8130a 100644 --- a/thirdparty/creole/drivers/pgsql/PgSQLConnection.php +++ b/thirdparty/creole/drivers/pgsql/PgSQLConnection.php @@ -53,9 +53,7 @@ class PgSQLConnection extends ConnectionCommon implements Connection { * @return void */ function connect($dsninfo, $flags = 0) - { - global $php_errormsg; - + { if (!extension_loaded('pgsql')) { throw new SQLException('pgsql extension not loaded'); } @@ -100,9 +98,13 @@ class PgSQLConnection extends ConnectionCommon implements Connection { } if (!$conn) { + // Set message error + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Connection error.'; + // hide the password from connstr $cleanconnstr = preg_replace('/password=\'.*?\'($|\s)/', 'password=\'*********\'', $connstr); - throw new SQLException('Could not connect', $php_errormsg, $cleanconnstr); + throw new SQLException('Could not connect', $errorMessage, $cleanconnstr); } $this->dblink = $conn; diff --git a/thirdparty/creole/drivers/pgsql/PgSQLResultSet.php b/thirdparty/creole/drivers/pgsql/PgSQLResultSet.php index 77c400f4f..3ef66968e 100644 --- a/thirdparty/creole/drivers/pgsql/PgSQLResultSet.php +++ b/thirdparty/creole/drivers/pgsql/PgSQLResultSet.php @@ -137,7 +137,7 @@ class PgSQLResultSet extends ResultSetCommon implements ResultSet { $res[] = $this->strToArray(implode(',', $subarr[$in_subarr])); $in_subarr--; } - } elseif ($tok{0} === '{') { // we're inside a new sub-array + } elseif ($tok[0] === '{') { // we're inside a new sub-array if ('}' !== substr($tok, -1, 1)) { $in_subarr++; // if sub-array has more than one element diff --git a/thirdparty/creole/util/sql/SQLStatementExtractor.php b/thirdparty/creole/util/sql/SQLStatementExtractor.php index f4c79a4e8..ca14b51ee 100644 --- a/thirdparty/creole/util/sql/SQLStatementExtractor.php +++ b/thirdparty/creole/util/sql/SQLStatementExtractor.php @@ -143,7 +143,7 @@ class SQLStatementExtractor { trigger_error("substring(), Endindex out of bounds must be $startpos $value, + 'value' => $value, + 0 => $key, + 'key' => $key, + ]; + next($array); + return $each; + } } diff --git a/thirdparty/pear/DB.php b/thirdparty/pear/DB.php index 1f128b17a..a270a6939 100644 --- a/thirdparty/pear/DB.php +++ b/thirdparty/pear/DB.php @@ -742,7 +742,7 @@ class DB_Error extends PEAR_Error * * @see PEAR_Error */ - function DB_Error($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, + function __construct($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null) { if (is_int($code)) { @@ -794,7 +794,7 @@ class DB_result * @param resource $result result resource id * @param array $options assoc array with optional result options */ - function DB_result(&$dbh, $result, $options = array()) + function __construct(&$dbh, $result, $options = array()) { $this->dbh = &$dbh; $this->result = $result; @@ -1093,7 +1093,7 @@ class DB_row * * @param resource row data as array */ - function DB_row(&$arr) + function __construct(&$arr) { foreach ($arr as $key => $value) { $this->$key = &$arr[$key]; diff --git a/thirdparty/pear/DB/common.php b/thirdparty/pear/DB/common.php index 2f9cfb5a2..0fb681fe0 100644 --- a/thirdparty/pear/DB/common.php +++ b/thirdparty/pear/DB/common.php @@ -146,7 +146,7 @@ class DB_common extends PEAR /** * Constructor */ - function DB_common() + function __construct() { $this->PEAR('DB_Error'); } @@ -167,7 +167,7 @@ class DB_common extends PEAR function quoteString($string) { $string = $this->quote($string); - if ($string{0} == "'") { + if ($string[0] == "'") { return substr($string, 1, -1); } return $string; diff --git a/thirdparty/pear/DB/mysqli.php b/thirdparty/pear/DB/mysqli.php index 7bd138855..0edaed4eb 100644 --- a/thirdparty/pear/DB/mysqli.php +++ b/thirdparty/pear/DB/mysqli.php @@ -115,7 +115,7 @@ class DB_mysqli extends DB_common * * @access public */ - function DB_mysqli() + function __construct() { $this->DB_common(); $this->phptype = 'mysqli'; @@ -168,7 +168,6 @@ class DB_mysqli extends DB_common $this->dsn = $dsninfo; $conn = false; - @ini_set('track_errors', true); if ($this->getOption('ssl') === true) { $init = mysqli_init(); @@ -201,17 +200,16 @@ class DB_mysqli extends DB_common ); } - @ini_restore('track_errors'); - if (!$conn) { + $lastError = error_get_last(); if (($err = @mysqli_connect_error()) != '') { return $this->raiseError(DB_ERROR_CONNECT_FAILED, null, null, null, $err); - } elseif (empty($php_errormsg)) { + } elseif (empty($lastError['message'])) { return $this->raiseError(DB_ERROR_CONNECT_FAILED); } else { return $this->raiseError(DB_ERROR_CONNECT_FAILED, null, null, - null, $php_errormsg); + null, $lastError['message']); } } diff --git a/thirdparty/pear/DB/oci8.php b/thirdparty/pear/DB/oci8.php index ad3fb69ae..be37e3e09 100644 --- a/thirdparty/pear/DB/oci8.php +++ b/thirdparty/pear/DB/oci8.php @@ -65,7 +65,7 @@ class DB_oci8 extends DB_common // }}} // {{{ constructor - function DB_oci8() + function __construct() { $this->DB_common(); $this->phptype = 'oci8'; @@ -501,7 +501,7 @@ class DB_oci8 extends DB_common if ($this->manip_query[(int)$stmt]) { $tmp = DB_OK; } else { - $tmp =& new DB_result($this, $stmt); + $tmp = new DB_result($this, $stmt); } return $tmp; } diff --git a/thirdparty/pear/DB/odbc.php b/thirdparty/pear/DB/odbc.php index 0f0532769..7ddf9100b 100644 --- a/thirdparty/pear/DB/odbc.php +++ b/thirdparty/pear/DB/odbc.php @@ -50,7 +50,7 @@ class DB_odbc extends DB_common // }}} // {{{ constructor - function DB_odbc() + function __construct() { $this->DB_common(); $this->phptype = 'odbc'; diff --git a/thirdparty/pear/DB/pgsql.php b/thirdparty/pear/DB/pgsql.php index 0a95eb132..a4e5bb4cb 100644 --- a/thirdparty/pear/DB/pgsql.php +++ b/thirdparty/pear/DB/pgsql.php @@ -51,7 +51,7 @@ class DB_pgsql extends DB_common // }}} // {{{ constructor - function DB_pgsql() + function __construct() { $this->DB_common(); $this->phptype = 'pgsql'; @@ -127,13 +127,13 @@ class DB_pgsql extends DB_common if ($ini) { $conn = @$connect_function($connstr); } else { - ini_set('track_errors', 1); $conn = @$connect_function($connstr); - ini_set('track_errors', $ini); } if ($conn == false) { + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Connection error.'; return $this->raiseError(DB_ERROR_CONNECT_FAILED, null, - null, null, strip_tags($php_errormsg)); + null, null, strip_tags($errorMessage)); } $this->connection = $conn; return DB_OK; diff --git a/thirdparty/pear/Log/composite.php b/thirdparty/pear/Log/composite.php index 98a1d814c..59534c416 100644 --- a/thirdparty/pear/Log/composite.php +++ b/thirdparty/pear/Log/composite.php @@ -42,7 +42,7 @@ class Log_composite extends Log * * @access public */ - function Log_composite($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { $this->_ident = $ident; diff --git a/thirdparty/pear/Log/console.php b/thirdparty/pear/Log/console.php index 1975ddbf0..c8f4e13d8 100644 --- a/thirdparty/pear/Log/console.php +++ b/thirdparty/pear/Log/console.php @@ -64,7 +64,7 @@ class Log_console extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_console($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/daemon.php b/thirdparty/pear/Log/daemon.php index 29afedded..8ea1f7704 100644 --- a/thirdparty/pear/Log/daemon.php +++ b/thirdparty/pear/Log/daemon.php @@ -66,7 +66,7 @@ class Log_daemon extends Log * @param int $maxLevel Maximum level at which to log. * @access public */ - function Log_daemon($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { /* Ensure we have a valid integer value for $name. */ diff --git a/thirdparty/pear/Log/display.php b/thirdparty/pear/Log/display.php index 1c8dad981..d95e1a74a 100644 --- a/thirdparty/pear/Log/display.php +++ b/thirdparty/pear/Log/display.php @@ -51,7 +51,7 @@ class Log_display extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_display($name = '', $ident = '', $conf = array(), + function __construct($name = '', $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/error_log.php b/thirdparty/pear/Log/error_log.php index 4209b3774..2a4d98c54 100644 --- a/thirdparty/pear/Log/error_log.php +++ b/thirdparty/pear/Log/error_log.php @@ -49,7 +49,7 @@ class Log_error_log extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_error_log($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/file.php b/thirdparty/pear/Log/file.php index 3aee250df..5d69083b1 100644 --- a/thirdparty/pear/Log/file.php +++ b/thirdparty/pear/Log/file.php @@ -95,7 +95,7 @@ class Log_file extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_file($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/firebug.php b/thirdparty/pear/Log/firebug.php index 1a9ced657..ef30b3744 100644 --- a/thirdparty/pear/Log/firebug.php +++ b/thirdparty/pear/Log/firebug.php @@ -78,7 +78,7 @@ class Log_firebug extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_firebug($name = '', $ident = 'PHP', $conf = array(), + function __construct($name = '', $ident = 'PHP', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/mail.php b/thirdparty/pear/Log/mail.php index bb2ac0fce..e31bc88ca 100644 --- a/thirdparty/pear/Log/mail.php +++ b/thirdparty/pear/Log/mail.php @@ -100,7 +100,7 @@ class Log_mail extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_mail($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/mcal.php b/thirdparty/pear/Log/mcal.php index 8d53d09e1..e0eb2a2d6 100644 --- a/thirdparty/pear/Log/mcal.php +++ b/thirdparty/pear/Log/mcal.php @@ -71,7 +71,7 @@ class Log_mcal extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_mcal($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/mdb2.php b/thirdparty/pear/Log/mdb2.php index 36a76f6a9..2ec7822d1 100644 --- a/thirdparty/pear/Log/mdb2.php +++ b/thirdparty/pear/Log/mdb2.php @@ -112,7 +112,7 @@ class Log_mdb2 extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_mdb2($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/null.php b/thirdparty/pear/Log/null.php index c479c0072..df72cdc51 100644 --- a/thirdparty/pear/Log/null.php +++ b/thirdparty/pear/Log/null.php @@ -27,7 +27,7 @@ class Log_null extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_null($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if(!class_exists('G')){ diff --git a/thirdparty/pear/Log/observer.php b/thirdparty/pear/Log/observer.php index 7cbe26369..ad3224332 100644 --- a/thirdparty/pear/Log/observer.php +++ b/thirdparty/pear/Log/observer.php @@ -47,7 +47,7 @@ class Log_observer * * @access public */ - function Log_observer($priority = PEAR_LOG_INFO) + function __construct($priority = PEAR_LOG_INFO) { $this->_id = $this->encryptOld(microtime()); $this->_priority = $priority; @@ -78,7 +78,7 @@ class Log_observer * instance. */ if (class_exists($class)) { - $object = &new $class($priority, $conf); + $object = new $class($priority, $conf); return $object; } @@ -102,9 +102,9 @@ class Log_observer if (class_exists($class)) { /* Support both new-style and old-style construction. */ if ($newstyle) { - $object = &new $class($priority, $conf); + $object = new $class($priority, $conf); } else { - $object = &new $class($priority); + $object = new $class($priority); } return $object; } diff --git a/thirdparty/pear/Log/sql.php b/thirdparty/pear/Log/sql.php index 9c6777ab2..74c5ff406 100644 --- a/thirdparty/pear/Log/sql.php +++ b/thirdparty/pear/Log/sql.php @@ -117,7 +117,7 @@ class Log_sql extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_sql($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { $this->_id = $this->encryptOld(microtime()); diff --git a/thirdparty/pear/Log/syslog.php b/thirdparty/pear/Log/syslog.php index 93ce84efc..92e5c2bc0 100644 --- a/thirdparty/pear/Log/syslog.php +++ b/thirdparty/pear/Log/syslog.php @@ -46,7 +46,7 @@ class Log_syslog extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_syslog($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { /* Ensure we have a valid integer value for $name. */ diff --git a/thirdparty/pear/Log/win.php b/thirdparty/pear/Log/win.php index 1f7d1ae62..1887b6b7c 100644 --- a/thirdparty/pear/Log/win.php +++ b/thirdparty/pear/Log/win.php @@ -69,7 +69,7 @@ class Log_win extends Log * @param int $level Log messages up to and including this level. * @access public */ - function Log_win($name, $ident = '', $conf = array(), + function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { $this->_id = $this->encryptOld(microtime()); diff --git a/thirdparty/pear/OS/Guess.php b/thirdparty/pear/OS/Guess.php index 356741959..f862b6d69 100644 --- a/thirdparty/pear/OS/Guess.php +++ b/thirdparty/pear/OS/Guess.php @@ -83,7 +83,7 @@ class OS_Guess var $release; var $extra; - function OS_Guess($uname = null) + function __construct($uname = null) { list($this->sysname, $this->release, @@ -136,10 +136,10 @@ class OS_Guess case 'Linux': $extra = $this->_detectGlibcVersion(); // use only the first two digits from the kernel version - $release = ereg_replace('^([[:digit:]]+\.[[:digit:]]+).*', '\1', $parts[2]); + $release = preg_replace('/^([[:digit:]]+\.[[:digit:]]+).*/', '\1', $parts[2]); break; default: - $release = ereg_replace('-.*', '', $parts[2]); + $release = preg_replace('/-.*/', '', $parts[2]); break; } @@ -167,7 +167,7 @@ class OS_Guess $cpp = popen("/usr/bin/cpp $tmpfile", "r"); $major = $minor = 0; while ($line = fgets($cpp, 1024)) { - if ($line{0} == '#') { + if ($line[0] == '#') { continue; } if (list($major, $minor) = explode(' ', trim($line))) { @@ -178,7 +178,7 @@ class OS_Guess unlink($tmpfile); if (!($major && $minor) && file_exists('/lib/libc.so.6')) { // Let's try reading the libc.so.6 symlink - if (ereg('^libc-([.*])\.so$', basename(readlink('/lib/libc.so.6')), $matches)) { + if (preg_match('/^libc-([.*])\.so$/', basename(readlink('/lib/libc.so.6')), $matches)) { list($major, $minor) = explode('.', $matches); } } diff --git a/thirdparty/pear/PEAR/Autoloader.php b/thirdparty/pear/PEAR/Autoloader.php index 117e49fed..6da513475 100644 --- a/thirdparty/pear/PEAR/Autoloader.php +++ b/thirdparty/pear/PEAR/Autoloader.php @@ -121,11 +121,11 @@ class PEAR_Autoloader extends PEAR $include_file = preg_replace('/[^a-z0-9]/i', '_', $classname); include_once $include_file; } - $obj =& new $classname; + $obj = new $classname; $methods = get_class_methods($classname); foreach ($methods as $method) { // don't import priviate methods and constructors - if ($method{0} != '_' && $method != $classname) { + if ($method[0] != '_' && $method != $classname) { $this->_method_map[$method] = $obj; } } @@ -145,7 +145,7 @@ class PEAR_Autoloader extends PEAR $ok = false; $classname = strtolower($classname); reset($this->_method_map); - while (list($method, $obj) = each($this->_method_map)) { + foreach ($this->_method_map as $method => $obj) { if (is_object($obj) && get_class($obj) == $classname) { unset($this->_method_map[$method]); $ok = true; @@ -168,7 +168,7 @@ class PEAR_Autoloader extends PEAR * @return mixed The return value from the aggregated method, or a PEAR * error if the called method was unknown. */ - function __call($method, $args, &$retval) + function __call($method, $args) { if (empty($this->_method_map[$method]) && isset($this->_autoload_map[$method])) { $this->addAggregateObject($this->_autoload_map[$method]); diff --git a/thirdparty/pear/PEAR/Builder.php b/thirdparty/pear/PEAR/Builder.php index d404ea9a7..d61c6834c 100644 --- a/thirdparty/pear/PEAR/Builder.php +++ b/thirdparty/pear/PEAR/Builder.php @@ -50,7 +50,7 @@ class PEAR_Builder extends PEAR_Common * * @access public */ - function PEAR_Builder(&$ui) + function __construct(&$ui) { parent::PEAR_Common(); $this->setFrontendObject($ui); @@ -123,7 +123,7 @@ class PEAR_Builder extends PEAR_Common $dsp = $filter->validateInput($dsp,"path"); // msdev doesn't tell us the output directory :/ // open the dsp, find /out and use that directory - $dsptext = join(file($dsp),''); + $dsptext = implode('', file($dsp)); // this regex depends on the build platform and type having been // correctly identified above. @@ -280,7 +280,7 @@ class PEAR_Builder extends PEAR_Common } $built_files = array(); while ($ent = readdir($dp)) { - if ($ent{0} == '.' || substr($ent, -3) == '.la') { + if ($ent[0] == '.' || substr($ent, -3) == '.la') { continue; } // harvest! diff --git a/thirdparty/pear/PEAR/Command.php b/thirdparty/pear/PEAR/Command.php index ba78c9136..f08afb872 100644 --- a/thirdparty/pear/PEAR/Command.php +++ b/thirdparty/pear/PEAR/Command.php @@ -119,7 +119,7 @@ class PEAR_Command return PEAR::raiseError("unknown command `$command'"); } $ui = PEAR_Command::getFrontendObject(); - $obj = &new $class($ui, $config); + $obj = new $class($ui, $config); return $obj; } @@ -131,7 +131,7 @@ class PEAR_Command function &getFrontendObject() { if (empty($GLOBALS['_PEAR_Command_uiobject'])) { - $GLOBALS['_PEAR_Command_uiobject'] = &new $GLOBALS['_PEAR_Command_uiclass']; + $GLOBALS['_PEAR_Command_uiobject'] = new $GLOBALS['_PEAR_Command_uiclass']; } return $GLOBALS['_PEAR_Command_uiobject']; } @@ -152,7 +152,7 @@ class PEAR_Command $file = str_replace('_', '/', $uiclass) . '.php'; @include_once $file; if (class_exists(strtolower($uiclass))) { - $obj = &new $uiclass; + $obj = new $uiclass; // quick test to see if this class implements a few of the most // important frontend methods if (method_exists($obj, 'userConfirm')) { @@ -209,7 +209,7 @@ class PEAR_Command $GLOBALS['_PEAR_Command_commandlist'] = array(); } while ($entry = readdir($dp)) { - if ($entry{0} == '.' || substr($entry, -4) != '.php' || $entry == 'Common.php') { + if ($entry[0] == '.' || substr($entry, -4) != '.php' || $entry == 'Common.php') { continue; } $class = "PEAR_Command_".substr($entry, 0, -4); @@ -217,7 +217,7 @@ class PEAR_Command include_once $file; // List of commands if (empty($GLOBALS['_PEAR_Command_objects'][$class])) { - $GLOBALS['_PEAR_Command_objects'][$class] = &new $class($ui, $config); + $GLOBALS['_PEAR_Command_objects'][$class] = new $class($ui, $config); } $implements = $GLOBALS['_PEAR_Command_objects'][$class]->getCommands(); foreach ($implements as $command => $desc) { diff --git a/thirdparty/pear/PEAR/Command/Auth.php b/thirdparty/pear/PEAR/Command/Auth.php index ae25f9b3a..e2c83021c 100644 --- a/thirdparty/pear/PEAR/Command/Auth.php +++ b/thirdparty/pear/PEAR/Command/Auth.php @@ -66,7 +66,7 @@ password from your user configuration.', * * @access public */ - function PEAR_Command_Auth(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR_Command_Common($ui, $config); } diff --git a/thirdparty/pear/PEAR/Command/Build.php b/thirdparty/pear/PEAR/Command/Build.php index 07dea6036..5d99dfbf1 100644 --- a/thirdparty/pear/PEAR/Command/Build.php +++ b/thirdparty/pear/PEAR/Command/Build.php @@ -51,7 +51,7 @@ Builds one or more extensions contained in a package.' * * @access public */ - function PEAR_Command_Build(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR_Command_Common($ui, $config); } @@ -65,7 +65,7 @@ Builds one or more extensions contained in a package.' if (sizeof($params) < 1) { $params[0] = 'package.xml'; } - $builder = &new PEAR_Builder($this->ui); + $builder = new PEAR_Builder($this->ui); $this->verbose = $this->config->get('verbose'); $err = $builder->build($params[0], array(&$this, 'buildCallback')); if (PEAR::isError($err)) { diff --git a/thirdparty/pear/PEAR/Command/Common.php b/thirdparty/pear/PEAR/Command/Common.php index 430ad0356..410ea1c1e 100644 --- a/thirdparty/pear/PEAR/Command/Common.php +++ b/thirdparty/pear/PEAR/Command/Common.php @@ -13,7 +13,7 @@ // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ -// | Author: Stig Sæther Bakken | +// | Author: Stig S�ther Bakken | // +----------------------------------------------------------------------+ // // $Id: Common.php,v 1.22 2003/03/18 12:06:07 ssb Exp $ @@ -68,7 +68,7 @@ class PEAR_Command_Common extends PEAR * * @access public */ - function PEAR_Command_Common(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR(); $this->config = &$config; @@ -131,10 +131,10 @@ class PEAR_Command_Common extends PEAR return; } reset($this->commands[$command]); - while (list($option, $info) = each($this->commands[$command]['options'])) { + foreach ($this->commands[$command]['options'] as $option => $info) { $larg = $sarg = ''; if (isset($info['arg'])) { - if ($info['arg']{0} == '(') { + if ($info['arg'][0] == '(') { $larg = '=='; $sarg = '::'; $arg = substr($info['arg'], 1, -1); @@ -195,7 +195,7 @@ class PEAR_Command_Common extends PEAR $help = "Options:\n"; foreach ($this->commands[$command]['options'] as $k => $v) { if (isset($v['arg'])) { - if ($v['arg']{0} == '(') { + if ($v['arg'][0] == '(') { $arg = substr($v['arg'], 1, -1); $sapp = " [$arg]"; $lapp = "[=$arg]"; diff --git a/thirdparty/pear/PEAR/Command/Config.php b/thirdparty/pear/PEAR/Command/Config.php index fdbaed270..3832d0f4a 100644 --- a/thirdparty/pear/PEAR/Command/Config.php +++ b/thirdparty/pear/PEAR/Command/Config.php @@ -91,7 +91,7 @@ displays help for all configuration parameters. * * @access public */ - function PEAR_Command_Config(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR_Command_Common($ui, $config); } diff --git a/thirdparty/pear/PEAR/Command/Install.php b/thirdparty/pear/PEAR/Command/Install.php index e4581aaba..1ea0e6c26 100644 --- a/thirdparty/pear/PEAR/Command/Install.php +++ b/thirdparty/pear/PEAR/Command/Install.php @@ -13,7 +13,7 @@ // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ -// | Author: Stig Sæther Bakken | +// | Author: Stig S�ther Bakken | // +----------------------------------------------------------------------+ // // $Id: Install.php,v 1.42 2003/03/18 12:06:07 ssb Exp $ @@ -207,7 +207,7 @@ specified at once. * * @access public */ - function PEAR_Command_Install(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR_Command_Common($ui, $config); } @@ -219,7 +219,7 @@ specified at once. function doInstall($command, $options, $params) { if (empty($this->installer)) { - $this->installer = &new PEAR_Installer($this->ui); + $this->installer = new PEAR_Installer($this->ui); } if ($command == 'upgrade') { $options[$command] = true; @@ -279,7 +279,7 @@ specified at once. function doUninstall($command, $options, $params) { if (empty($this->installer)) { - $this->installer = &new PEAR_Installer($this->ui); + $this->installer = new PEAR_Installer($this->ui); } if (sizeof($params) < 1) { return $this->raiseError("Please supply the package(s) you want to uninstall"); diff --git a/thirdparty/pear/PEAR/Command/Mirror.php b/thirdparty/pear/PEAR/Command/Mirror.php index 226ed0892..778f585ea 100644 --- a/thirdparty/pear/PEAR/Command/Mirror.php +++ b/thirdparty/pear/PEAR/Command/Mirror.php @@ -55,7 +55,7 @@ class PEAR_Command_Mirror extends PEAR_Command_Common * @param object PEAR_Frontend a reference to an frontend * @param object PEAR_Config a reference to the configuration data */ - function PEAR_Command_Mirror(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR_Command_Common($ui, $config); } @@ -77,7 +77,7 @@ class PEAR_Command_Mirror extends PEAR_Command_Common function doDownloadAll($command, $options, $params) { $this->config->set("php_dir", "."); - $remote = &new PEAR_Remote($this->config); + $remote = new PEAR_Remote($this->config); $remoteInfo = $remote->call("package.listAll"); if(PEAR::isError($remoteInfo)) { return $remoteInfo; diff --git a/thirdparty/pear/PEAR/Command/Package.php b/thirdparty/pear/PEAR/Command/Package.php index 55f68829e..28bcab4f3 100644 --- a/thirdparty/pear/PEAR/Command/Package.php +++ b/thirdparty/pear/PEAR/Command/Package.php @@ -209,7 +209,7 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm * * @access public */ - function PEAR_Command_Package(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR_Command_Common($ui, $config); } @@ -243,7 +243,7 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm $this->output = ''; include_once 'PEAR/Packager.php'; $pkginfofile = isset($params[0]) ? $params[0] : 'package.xml'; - $packager =& new PEAR_Packager($this->config->get('php_dir'), + $packager = new PEAR_Packager($this->config->get('php_dir'), $this->config->get('ext_dir'), $this->config->get('doc_dir')); $packager->debug = $this->config->get('verbose'); @@ -322,7 +322,7 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm $obj->validatePackageInfo($info, $err, $warn); if (!$this->_displayValidationResults($err, $warn, true)) { $this->ui->outputData($this->output, $command); - break; + return; } $version = $info['version']; $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $version); @@ -635,7 +635,7 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm if (!$fp) { return $this->raiseError("could not open RPM spec file template $spec_template: $php_errormsg"); } - $spec_contents = preg_replace('/@([a-z0-9_-]+)@/e', '$info["\1"]', fread($fp, filesize($spec_template))); + $spec_contents = preg_replace_callback('/@([a-z0-9_-]+)@/', function($matches) use ($info) {return $info[$matches[1]];}, fread($fp, filesize($spec_template))); fclose($fp); $spec_file = "$info[rpm_package]-$info[version].spec"; $wp = fopen($spec_file, "w"); @@ -652,4 +652,4 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm // }}} } -?> +?> \ No newline at end of file diff --git a/thirdparty/pear/PEAR/Command/Registry.php b/thirdparty/pear/PEAR/Command/Registry.php index a4b9e76a6..379a99be2 100644 --- a/thirdparty/pear/PEAR/Command/Registry.php +++ b/thirdparty/pear/PEAR/Command/Registry.php @@ -70,7 +70,7 @@ installed package.' * * @access public */ - function PEAR_Command_Registry(&$ui, &$config) + function __construct(&$ui, &$config) { parent::PEAR_Command_Common($ui, $config); } @@ -108,7 +108,7 @@ installed package.' } else { if (file_exists($params[0]) && !is_dir($params[0])) { include_once "PEAR/Common.php"; - $obj = &new PEAR_Common; + $obj = new PEAR_Common; $info = $obj->infoFromAny($params[0]); $headings = array('Package File', 'Install Path'); $installed = false; @@ -181,7 +181,7 @@ installed package.' function doShellTest($command, $options, $params) { $this->pushErrorHandling(PEAR_ERROR_RETURN); - $reg = &new PEAR_Registry($this->config->get('php_dir')); + $reg = new PEAR_Registry($this->config->get('php_dir')); // "pear shell-test Foo" if (sizeof($params) == 1) { if (!$reg->packageExists($params[0])) { @@ -217,10 +217,10 @@ installed package.' "the package you want information"); } if (@is_file($params[0])) { - $obj = &new PEAR_Common(); + $obj = new PEAR_Common(); $info = $obj->infoFromAny($params[0]); } else { - $reg = &new PEAR_Registry($this->config->get('php_dir')); + $reg = new PEAR_Registry($this->config->get('php_dir')); $info = $reg->packageInfo($params[0]); } if (PEAR::isError($info)) { diff --git a/thirdparty/pear/PEAR/Common.php b/thirdparty/pear/PEAR/Common.php index 519ef4b26..8fbb04766 100644 --- a/thirdparty/pear/PEAR/Common.php +++ b/thirdparty/pear/PEAR/Common.php @@ -133,7 +133,7 @@ class PEAR_Common extends PEAR * * @access public */ - function PEAR_Common() + function __construct() { parent::PEAR(); $this->config = &PEAR_Config::singleton(); @@ -503,7 +503,7 @@ class PEAR_Common extends PEAR switch ($this->prev_element) { case 'package': // XXX should we check the package name here? - $this->pkginfo['package'] = ereg_replace('[^a-zA-Z0-9._]', '_', $data); + $this->pkginfo['package'] = preg_replace('/[^a-zA-Z0-9._]/', '_', $data); break; case 'maintainer': $this->current_maintainer['name'] = $data; @@ -527,7 +527,7 @@ class PEAR_Common extends PEAR $this->current_maintainer['role'] = $data; break; case 'version': - $data = ereg_replace ('[^a-zA-Z0-9._\-]', '_', $data); + $data = preg_replace ('/[^a-zA-Z0-9._\-]/', '_', $data); if ($this->in_changelog) { $this->current_release['version'] = $data; } else { @@ -680,7 +680,7 @@ class PEAR_Common extends PEAR if ($name == 'package.xml') { $xml = $name; break; - } elseif (ereg('package.xml$', $name, $match)) { + } elseif (preg_match('/package.xml$/', $name, $match)) { $xml = $match[0]; break; } @@ -1187,7 +1187,7 @@ class PEAR_Common extends PEAR foreach ($methods as $method) { $function = "$class::$method"; $key = "function;$function"; - if ($method{0} == '_' || !strcasecmp($method, $class) || + if ($method[0] == '_' || !strcasecmp($method, $class) || isset($this->pkginfo['provides'][$key])) { continue; } @@ -1197,7 +1197,7 @@ class PEAR_Common extends PEAR } foreach ($srcinfo['declared_functions'] as $function) { $key = "function;$function"; - if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) { + if ($function[0] == '_' || isset($this->pkginfo['provides'][$key])) { continue; } $this->pkginfo['provides'][$key] = @@ -1661,7 +1661,9 @@ class PEAR_Common extends PEAR if (!$wp = @fopen($dest_file, 'wb')) { fclose($fp); if ($callback) { - call_user_func($callback, 'writefailed', array($dest_file, $php_errormsg)); + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error writing the file.'; + call_user_func($callback, 'writefailed', array($dest_file, $errorMessage)); } return PEAR::raiseError("could not open $dest_file for writing"); } @@ -1682,7 +1684,9 @@ class PEAR_Common extends PEAR if (!@fwrite($wp, $data)) { fclose($fp); if ($callback) { - call_user_func($callback, 'writefailed', array($dest_file, $php_errormsg)); + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error writing the file.'; + call_user_func($callback, 'writefailed', array($dest_file, $errorMessage)); } return PEAR::raiseError("$dest_file: write failed ($php_errormsg)"); } diff --git a/thirdparty/pear/PEAR/Config.php b/thirdparty/pear/PEAR/Config.php index 2832bae01..f776bf466 100644 --- a/thirdparty/pear/PEAR/Config.php +++ b/thirdparty/pear/PEAR/Config.php @@ -388,7 +388,7 @@ class PEAR_Config extends PEAR * * @see PEAR_Config::singleton */ - function PEAR_Config($user_file = '', $system_file = '') + function __construct($user_file = '', $system_file = '') { $this->PEAR(); $sl = DIRECTORY_SEPARATOR; @@ -445,7 +445,7 @@ class PEAR_Config extends PEAR return $GLOBALS['_PEAR_Config_instance']; } $GLOBALS['_PEAR_Config_instance'] = - &new PEAR_Config($user_file, $system_file); + new PEAR_Config($user_file, $system_file); return $GLOBALS['_PEAR_Config_instance']; } diff --git a/thirdparty/pear/PEAR/Dependency.php b/thirdparty/pear/PEAR/Dependency.php index b4ae1599f..e7ae02f8f 100644 --- a/thirdparty/pear/PEAR/Dependency.php +++ b/thirdparty/pear/PEAR/Dependency.php @@ -45,7 +45,7 @@ class PEAR_Dependency * @param object Registry object * @return void */ - function PEAR_Dependency(&$registry) + function __construct(&$registry) { $this->registry = &$registry; } diff --git a/thirdparty/pear/PEAR/Frontend/CLI.php b/thirdparty/pear/PEAR/Frontend/CLI.php index 59249ddb2..89b39567f 100644 --- a/thirdparty/pear/PEAR/Frontend/CLI.php +++ b/thirdparty/pear/PEAR/Frontend/CLI.php @@ -13,7 +13,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken | + | Author: Stig S�ther Bakken | +----------------------------------------------------------------------+ $Id: CLI.php,v 1.31 2003/04/03 23:12:40 ssb Exp $ @@ -43,7 +43,7 @@ class PEAR_Frontend_CLI extends PEAR // {{{ constructor - function PEAR_Frontend_CLI() + function __construct() { parent::PEAR(); $term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1 diff --git a/thirdparty/pear/PEAR/Installer.php b/thirdparty/pear/PEAR/Installer.php index a2aca03f9..6c44bfb13 100644 --- a/thirdparty/pear/PEAR/Installer.php +++ b/thirdparty/pear/PEAR/Installer.php @@ -109,12 +109,12 @@ class PEAR_Installer extends PEAR_Common * * @access public */ - function PEAR_Installer(&$ui) + function __construct(&$ui) { parent::PEAR_Common(); $this->setFrontendObject($ui); $this->debug = $this->config->get('verbose'); - $this->registry = &new PEAR_Registry($this->config->get('php_dir')); + $this->registry = new PEAR_Registry($this->config->get('php_dir')); } // }}} @@ -500,7 +500,7 @@ class PEAR_Installer extends PEAR_Common $options['installroot'] = substr($options['installroot'], 0, -1); } $php_dir = $this->_prependPath($php_dir, $options['installroot']); - $this->registry = &new PEAR_Registry($php_dir); + $this->registry = new PEAR_Registry($php_dir); $this->installroot = $options['installroot']; } else { $registry = &$this->registry; @@ -578,7 +578,7 @@ class PEAR_Installer extends PEAR_Common $dp = opendir($tmpdir); do { $pkgdir = readdir($dp); - } while ($pkgdir{0} == '.'); + } while ($pkgdir[0] == '.'); $descfile = $tmpdir . DIRECTORY_SEPARATOR . $pkgdir . DIRECTORY_SEPARATOR . 'package.xml'; $flag_old_format = true; @@ -681,8 +681,8 @@ class PEAR_Installer extends PEAR_Common } // don't want strange characters - $pkgname = ereg_replace ('[^a-zA-Z0-9._]', '_', $pkginfo['package']); - $pkgversion = ereg_replace ('[^a-zA-Z0-9._\-]', '_', $pkginfo['version']); + $pkgname = preg_replace ('/[^a-zA-Z0-9._]/', '_', $pkginfo['package']); + $pkgversion = preg_replace ('/[^a-zA-Z0-9._\-]/', '_', $pkginfo['version']); $tmp_path = dirname($descfile); if (substr($pkgfile, -4) != '.xml') { $tmp_path .= DIRECTORY_SEPARATOR . $pkgname . '-' . $pkgversion; @@ -714,7 +714,7 @@ class PEAR_Installer extends PEAR_Common if ($this->source_files > 0 && empty($options['nobuild'])) { $this->log(1, "$this->source_files source files, building"); - $bob = &new PEAR_Builder($this->ui); + $bob = new PEAR_Builder($this->ui); $bob->debug = $this->debug; $built = $bob->build($descfile, array(&$this, '_buildCallback')); if (PEAR::isError($built)) { @@ -778,7 +778,7 @@ class PEAR_Installer extends PEAR_Common } else { $this->installroot = ''; } - $this->registry = &new PEAR_Registry($php_dir); + $this->registry = new PEAR_Registry($php_dir); // Delete the files if (PEAR::isError($err = $this->_deletePackageFiles($package))) { @@ -799,7 +799,7 @@ class PEAR_Installer extends PEAR_Common function checkDeps(&$pkginfo) { - $depchecker = &new PEAR_Dependency($this->registry); + $depchecker = new PEAR_Dependency($this->registry); $error = $errors = ''; $failed_deps = array(); if (is_array($pkginfo['release_deps'])) { @@ -811,7 +811,7 @@ class PEAR_Installer extends PEAR_Common } $n = count($failed_deps); if ($n > 0) { - $depinstaller =& new PEAR_Installer($this->ui); + $depinstaller = new PEAR_Installer($this->ui); $to_install = array(); for ($i = 0; $i < $n; $i++) { if (isset($failed_deps[$i]['type'])) { diff --git a/thirdparty/pear/PEAR/Packager.php b/thirdparty/pear/PEAR/Packager.php index 5e29dbcf4..0adb7bc68 100644 --- a/thirdparty/pear/PEAR/Packager.php +++ b/thirdparty/pear/PEAR/Packager.php @@ -34,7 +34,7 @@ class PEAR_Packager extends PEAR_Common { // {{{ constructor - function PEAR_Packager() + function __construct() { parent::PEAR_Common(); } @@ -131,7 +131,7 @@ class PEAR_Packager extends PEAR_Common // TAR the Package ------------------------------------------- $ext = $compress ? '.tgz' : '.tar'; $dest_package = $oldcwd . DIRECTORY_SEPARATOR . $pkgver . $ext; - $tar =& new Archive_Tar($dest_package, $compress); + $tar = new Archive_Tar($dest_package, $compress); $tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors // ----- Creates with the package.xml file $ok = $tar->createModify($newpkgfile, '', $tmpdir); @@ -171,7 +171,7 @@ if (!function_exists('md5_file')) { return $md5; } - public function encryptOld($string) + function encryptOld($string) { return md5($string); } diff --git a/thirdparty/pear/PEAR/Registry.php b/thirdparty/pear/PEAR/Registry.php index 49ca4edb9..8943cb0ce 100644 --- a/thirdparty/pear/PEAR/Registry.php +++ b/thirdparty/pear/PEAR/Registry.php @@ -89,7 +89,7 @@ class PEAR_Registry extends PEAR * * @access public */ - function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR) + function __construct($pear_install_dir = PEAR_INSTALL_DIR) { parent::PEAR(); $ds = DIRECTORY_SEPARATOR; @@ -236,7 +236,9 @@ class PEAR_Registry extends PEAR { $fp = @fopen($this->filemap, 'r'); if (!$fp) { - return $this->raiseError('PEAR_Registry: could not open filemap', PEAR_REGISTRY_ERROR_FILE, null, null, $php_errormsg); + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error opening filemap.'; + return $this->raiseError('PEAR_Registry: could not open filemap', PEAR_REGISTRY_ERROR_FILE, null, null, $errorMessage); } $fsize = filesize($this->filemap); $data = fread($fp, $fsize); @@ -286,8 +288,9 @@ class PEAR_Registry extends PEAR $this->lock_fp = @fopen($this->lockfile, $open_mode); if (!is_resource($this->lock_fp)) { + $lastError = error_get_last(); return $this->raiseError("could not create lock file" . - (isset($php_errormsg) ? ": " . $php_errormsg : "")); + (isset($lastError['message']) ? ": " . $lastError['message'] : "")); } if (!(int)flock($this->lock_fp, $mode)) { switch ($mode) { @@ -357,7 +360,7 @@ class PEAR_Registry extends PEAR return $pkglist; } while ($ent = readdir($dp)) { - if ($ent{0} == '.' || substr($ent, -4) != '.reg') { + if ($ent[0] == '.' || substr($ent, -4) != '.reg') { continue; } $pkglist[] = substr($ent, 0, -4); @@ -507,7 +510,7 @@ class PEAR_Registry extends PEAR if (is_array($path)) { static $notempty; if (empty($notempty)) { - $notempty = create_function('$a','return !empty($a);'); + $notempty = function($a){return !empty($a);}; } $pkgs = array(); foreach ($path as $name => $attrs) { diff --git a/thirdparty/pear/PEAR/Remote.php b/thirdparty/pear/PEAR/Remote.php index 915cf9fb3..9e348a27d 100644 --- a/thirdparty/pear/PEAR/Remote.php +++ b/thirdparty/pear/PEAR/Remote.php @@ -40,7 +40,7 @@ class PEAR_Remote extends PEAR // {{{ PEAR_Remote(config_object) - function PEAR_Remote(&$config) + function __construct(&$config) { $this->PEAR(); $this->config = &$config; @@ -111,14 +111,7 @@ class PEAR_Remote extends PEAR if ($this->cache !== null && $this->cache['age'] < $cachettl) { return $this->cache['content']; }; - - if (extension_loaded("xmlrpc")) { - $result = call_user_func_array(array(&$this, 'call_epi'), $args); - if (!PEAR::isError($result)) { - $this->saveCache($_args, $result); - }; - return $result; - } + if (!@include_once("XML/RPC.php")) { return $this->raiseError("For this remote PEAR operation you need to install the XML_RPC package"); } @@ -167,133 +160,6 @@ class PEAR_Remote extends PEAR // }}} - // {{{ call_epi(method, [args...]) - - function call_epi($method) - { - do { - if (extension_loaded("xmlrpc")) { - break; - } - if (OS_WINDOWS) { - $ext = 'dll'; - } elseif (PHP_OS == 'HP-UX') { - $ext = 'sl'; - } elseif (PHP_OS == 'AIX') { - $ext = 'a'; - } else { - $ext = 'so'; - } - $ext = OS_WINDOWS ? 'dll' : 'so'; - @dl("xmlrpc-epi.$ext"); - if (extension_loaded("xmlrpc")) { - break; - } - @dl("xmlrpc.$ext"); - if (extension_loaded("xmlrpc")) { - break; - } - return $this->raiseError("unable to load xmlrpc extension"); - } while (false); - $params = func_get_args(); - array_shift($params); - $method = str_replace("_", ".", $method); - $request = xmlrpc_encode_request($method, $params); - $server_host = $this->config->get("master_server"); - if (empty($server_host)) { - return $this->raiseError("PEAR_Remote::call: no master_server configured"); - } - $server_port = 80; - $fp = @fsockopen($server_host, $server_port); - if (!$fp) { - return $this->raiseError("PEAR_Remote::call: fsockopen(`$server_host', $server_port) failed"); - } - $len = strlen($request); - $req_headers = "Host: $server_host:$server_port\r\n" . - "Content-type: text/xml\r\n" . - "Content-length: $len\r\n"; - $username = $this->config->get('username'); - $password = $this->config->get('password'); - if ($username && $password) { - $req_headers .= "Cookie: PEAR_USER=$username; PEAR_PW=$password\r\n"; - $tmp = base64_encode("$username:$password"); - $req_headers .= "Authorization: Basic $tmp\r\n"; - } - if ($this->cache !== null) { - $maxAge = '?maxAge='.$this->cache['lastChange']; - } else { - $maxAge = ''; - }; - - if ($this->config->get('verbose') > 3) { - print "XMLRPC REQUEST HEADERS:\n"; - var_dump($req_headers); - print "XMLRPC REQUEST BODY:\n"; - var_dump($request); - } - - fwrite($fp, ("POST /xmlrpc.php$maxAge HTTP/1.0\r\n$req_headers\r\n$request")); - $response = ''; - $line1 = fgets($fp, 2048); - if (!preg_match('!^HTTP/[0-9\.]+ (\d+) (.*)!', $line1, $matches)) { - return $this->raiseError("PEAR_Remote: invalid HTTP response from XML-RPC server"); - } - switch ($matches[1]) { - case "200": // OK - break; - case "304": // Not Modified - return $this->cache['content']; - case "401": // Unauthorized - if ($username && $password) { - return $this->raiseError("PEAR_Remote: authorization failed", 401); - } else { - return $this->raiseError("PEAR_Remote: authorization required, please log in first", 401); - } - default: - return $this->raiseError("PEAR_Remote: unexpected HTTP response", (int)$matches[1], null, null, "$matches[1] $matches[2]"); - } - while (trim(fgets($fp, 2048)) != ''); // skip rest of headers - while ($chunk = fread($fp, 10240)) { - $response .= $chunk; - } - fclose($fp); - if ($this->config->get('verbose') > 3) { - print "XMLRPC RESPONSE:\n"; - var_dump($response); - } - $ret = xmlrpc_decode($response); - if (is_array($ret) && isset($ret['__PEAR_TYPE__'])) { - if ($ret['__PEAR_TYPE__'] == 'error') { - if (isset($ret['__PEAR_CLASS__'])) { - $class = $ret['__PEAR_CLASS__']; - } else { - $class = "PEAR_Error"; - } - if ($ret['code'] === '') $ret['code'] = null; - if ($ret['message'] === '') $ret['message'] = null; - if ($ret['userinfo'] === '') $ret['userinfo'] = null; - if (strtolower($class) == 'db_error') { - $ret = $this->raiseError(PEAR::errorMessage($ret['code']), - $ret['code'], null, null, - $ret['userinfo']); - } else { - $ret = $this->raiseError($ret['message'], $ret['code'], - null, null, $ret['userinfo']); - } - } - } elseif (is_array($ret) && sizeof($ret) == 1 && is_array($ret[0]) && - !empty($ret[0]['faultString']) && - !empty($ret[0]['faultCode'])) { - extract($ret[0]); - $faultString = "XML-RPC Server Fault: " . - str_replace("\n", " ", $faultString); - return $this->raiseError($faultString, $faultCode); - } - return $ret; - } - - // }}} - // {{{ _encode // a slightly extended version of XML_RPC_encode diff --git a/thirdparty/pear/PearSystem.php b/thirdparty/pear/PearSystem.php index 943fdf80b..556787399 100644 --- a/thirdparty/pear/PearSystem.php +++ b/thirdparty/pear/PearSystem.php @@ -228,7 +228,7 @@ class PearSystem } elseif($opt[0] == 'm') { // if the mode is clearly an octal number (starts with 0) // convert it to decimal - if (strlen($opt[1]) && $opt[1]{0} == '0') { + if (strlen($opt[1]) && $opt[1][0] == '0') { $opt[1] = octdec($opt[1]); } else { // convert to int diff --git a/thirdparty/phing/Phing.php b/thirdparty/phing/Phing.php index a44c4cfd8..1fee319f8 100644 --- a/thirdparty/phing/Phing.php +++ b/thirdparty/phing/Phing.php @@ -924,7 +924,7 @@ class Phing { // This is a bit of a hack, but works better than previous solution of assuming // data_dir is on the include_path. $data_dir = '@DATA-DIR@'; - if ($data_dir{0} != '@') { // if we're using PEAR then the @ DATA-DIR @ token will have been substituted. + if ($data_dir[0] != '@') { // if we're using PEAR then the @ DATA-DIR @ token will have been substituted. $data_path = $data_dir . DIRECTORY_SEPARATOR . $path; if (file_exists($data_path)) { return $data_path; @@ -1106,11 +1106,8 @@ class Phing { private static function setIni() { error_reporting(E_ALL); set_time_limit(0); - ini_set('magic_quotes_gpc', 'off'); ini_set('short_open_tag', 'off'); ini_set('default_charset', 'iso-8859-1'); - ini_set('register_globals', 'off'); - ini_set('allow_call_time_pass_reference', 'on'); } /** diff --git a/thirdparty/phing/lib/Capsule.php b/thirdparty/phing/lib/Capsule.php index 166bfb2ca..9a459548c 100644 --- a/thirdparty/phing/lib/Capsule.php +++ b/thirdparty/phing/lib/Capsule.php @@ -139,16 +139,15 @@ class Capsule { $iniSet($inclDir, $path); } } - - @ini_set('track_errors', true); + include $__template; - @ini_restore('track_errors'); // restore the include path ini_set('include_path', $__old_inc_path); - if (!empty($php_errormsg)) { - throw new Exception("Unable to parse template " . $__template . ": " . $php_errormsg); + $lastError = error_get_last(); + if (!empty($lastError['message'])) { + throw new Exception("Unable to parse template " . $__template . ": " . $lastError['message']); } } @@ -200,9 +199,9 @@ class Capsule { * @return string "Best guess" path for this file. */ protected function resolvePath($file, $basepath) { - if ( !($file{0} == DIRECTORY_SEPARATOR || $file{0} == '/') + if ( !($file[0] == DIRECTORY_SEPARATOR || $file[0] == '/') // also account for C:\ style path - && !($file{1} == ':' && ($file{2} == DIRECTORY_SEPARATOR || $file{2} == '/'))) { + && !($file[1] == ':' && ($file[2] == DIRECTORY_SEPARATOR || $file[2] == '/'))) { if ($basepath != null) { $file = $basepath . DIRECTORY_SEPARATOR . $file; } diff --git a/thirdparty/phing/lib/Zip.php b/thirdparty/phing/lib/Zip.php index 041e1a97c..543a4539b 100644 --- a/thirdparty/phing/lib/Zip.php +++ b/thirdparty/phing/lib/Zip.php @@ -68,7 +68,6 @@ define( 'ARCHIVE_ZIP_PARAM_EXTRACT_AS_STRING', 'extract_as_string' ); define( 'ARCHIVE_ZIP_PARAM_NO_COMPRESSION', 'no_compression' ); define( 'ARCHIVE_ZIP_PARAM_BY_NAME', 'by_name' ); define( 'ARCHIVE_ZIP_PARAM_BY_INDEX', 'by_index' ); -define( 'ARCHIVE_ZIP_PARAM_BY_EREG', 'by_ereg' ); define( 'ARCHIVE_ZIP_PARAM_BY_PREG', 'by_preg' ); define( 'ARCHIVE_ZIP_PARAM_PRE_EXTRACT', 'callback_pre_extract' ); @@ -349,7 +348,7 @@ class Archive_Zip /** * This method extract the files and folders which are in the zip archive. * It can extract all the archive or a part of the archive by using filter - * feature (extract by name, by index, by ereg, by preg). The extraction + * feature (extract by name, by index, by preg). The extraction * can occur in the current path or an other path. * All the advanced features are activated by the use of variable * parameters. @@ -369,8 +368,6 @@ class Archive_Zip * or an array of file/dir names to extract from the archive. * 'by_index' : A string with range of indexes separated by ',', * (sample "1,3-5,12"). - * 'by_ereg' : A regular expression (ereg) that must match the extracted - * filename. * 'by_preg' : A regular expression (preg) that must match the extracted * filename. * 'callback_pre_extract' : A callback function that will be called before @@ -407,7 +404,6 @@ class Archive_Zip 'set_chmod' => 0, 'by_name' => '', 'by_index' => '', - 'by_ereg' => '', 'by_preg' => '') ) != 1) { return 0; } @@ -436,8 +432,6 @@ class Archive_Zip * or an array of file/dir names to delete from the archive. * 'by_index' : A string with range of indexes separated by ',', * (sample "1,3-5,12"). - * 'by_ereg' : A regular expression (ereg) that must match the extracted - * filename. * 'by_preg' : A regular expression (preg) that must match the extracted * filename. * @@ -459,7 +453,6 @@ class Archive_Zip if ($this->_check_parameters($p_params, array ('by_name' => '', 'by_index' => '', - 'by_ereg' => '', 'by_preg' => '') ) != 1) { return 0; } @@ -467,7 +460,6 @@ class Archive_Zip // ----- Check that at least one rule is set if ( ($p_params['by_name'] == '') && ($p_params['by_index'] == '') - && ($p_params['by_ereg'] == '') && ($p_params['by_preg'] == '')) { $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAMETER, 'At least one filtering rule must' @@ -663,7 +655,7 @@ class Archive_Zip // ----- Extract error constants from all const. for (reset($v_const_list); - list($v_key, $v_value) = each($v_const_list);) { + list($v_key, $v_value) = self::each($v_const_list);) { if (substr($v_key, 0, strlen('ARCHIVE_ZIP_ERR_')) =='ARCHIVE_ZIP_ERR_') { $v_error_list[$v_key] = $v_value; @@ -1843,15 +1835,6 @@ class Archive_Zip } } - // ----- Look for extract by ereg rule - else if ( (isset($p_params[ARCHIVE_ZIP_PARAM_BY_EREG])) - && ($p_params[ARCHIVE_ZIP_PARAM_BY_EREG] != "")) { - - if (ereg($p_params[ARCHIVE_ZIP_PARAM_BY_EREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - // ----- Look for extract by preg rule else if ( (isset($p_params[ARCHIVE_ZIP_PARAM_BY_PREG])) && ($p_params[ARCHIVE_ZIP_PARAM_BY_PREG] != "")) { @@ -2726,16 +2709,6 @@ class Archive_Zip } } - // ----- Look for extract by ereg rule - else if ( (isset($p_params[ARCHIVE_ZIP_PARAM_BY_EREG])) - && ($p_params[ARCHIVE_ZIP_PARAM_BY_EREG] != "")) { - - if (ereg($p_params[ARCHIVE_ZIP_PARAM_BY_EREG], - $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - // ----- Look for extract by preg rule else if ( (isset($p_params[ARCHIVE_ZIP_PARAM_BY_PREG])) && ($p_params[ARCHIVE_ZIP_PARAM_BY_PREG] != "")) { @@ -3230,7 +3203,7 @@ class Archive_Zip } // ----- Check that all the params are valid - for (reset($p_params); list($v_key, $v_value) = each($p_params); ) { + for (reset($p_params); list($v_key, $v_value) = self::each($p_params); ) { if (!isset($p_default[$v_key])) { $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAMETER, 'Unsupported parameter with key \''.$v_key.'\''); @@ -3240,17 +3213,17 @@ class Archive_Zip } // ----- Set the default values - for (reset($p_default); list($v_key, $v_value) = each($p_default); ) { + for (reset($p_default); list($v_key, $v_value) = self::each($p_default); ) { if (!isset($p_params[$v_key])) { $p_params[$v_key] = $p_default[$v_key]; } } - // ----- Check specific parameters $v_callback_list = array ('callback_pre_add','callback_post_add', 'callback_pre_extract','callback_post_extract'); for ($i=0; $i_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAM_VALUE, @@ -3596,6 +3569,25 @@ class Archive_Zip return G::encryptCrc32($string); } + /** + * Legacy "each" function, because was removed in PHP v8.x + * + * @param $array + * @return array|bool + */ + private static function each($array) { + $key = key($array); + $value = current($array); + $each = is_null($key) ? false : [ + 1 => $value, + 'value' => $value, + 0 => $key, + 'key' => $key, + ]; + next($array); + return $each; + } + } // End of class diff --git a/thirdparty/phing/mappers/RegexpMapper.php b/thirdparty/phing/mappers/RegexpMapper.php index dfb775473..534d1bb0d 100644 --- a/thirdparty/phing/mappers/RegexpMapper.php +++ b/thirdparty/phing/mappers/RegexpMapper.php @@ -90,7 +90,7 @@ class RegexpMapper implements FileNameMapper { $groups = (array) $this->reg->getGroups(); // replace \1 with value of $groups[1] and return the modified "to" string - return preg_replace('/\\\([\d]+)/e', "\$groups[$1]", $this->to); + return preg_replace_callback('/\\\([\d]+)/', function($matches)use($groups){return $matches[$groups[$matches[1]]];}, $this->to); } } diff --git a/thirdparty/phing/system/io/BufferedReader.php b/thirdparty/phing/system/io/BufferedReader.php index d4ec0fd71..cfccaa2ac 100644 --- a/thirdparty/phing/system/io/BufferedReader.php +++ b/thirdparty/phing/system/io/BufferedReader.php @@ -142,7 +142,7 @@ class BufferedReader extends Reader { // Get next buffered char ... // handle case where buffer is read-in, but is empty. The next readChar() will return -1 EOF, // so we just return empty string (char) at this point. (Probably could also return -1 ...?) - $ch = ($this->buffer !== "") ? $this->buffer{$this->bufferPos} : ''; + $ch = ($this->buffer !== "") ? $this->buffer[$this->bufferPos] : ''; $this->bufferPos++; if ( $this->bufferPos >= strlen($this->buffer) ) { $this->buffer = null; diff --git a/thirdparty/phing/system/io/FileReader.php b/thirdparty/phing/system/io/FileReader.php index 65edf8d07..5a2d64d72 100644 --- a/thirdparty/phing/system/io/FileReader.php +++ b/thirdparty/phing/system/io/FileReader.php @@ -105,7 +105,9 @@ class FileReader extends Reader { if (false === @fclose($this->fd)) { // FAILED. - $msg = "Cannot fclose " . $this->file->__toString() . " $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error closing the file.'; + $msg = "Cannot fclose " . $this->file->__toString() . " $errorMessage"; throw new IOException($msg); } else { $this->fd = null; @@ -114,23 +116,16 @@ class FileReader extends Reader { } function open() { - global $php_errormsg; - if ($this->fd === null) { $this->fd = @fopen($this->file->getAbsolutePath(), "rb"); } if ($this->fd === false) { // fopen FAILED. - // Add error from php to end of log message. $php_errormsg. - $msg = "Cannot fopen ".$this->file->getAbsolutePath().". $php_errormsg"; - throw new IOException($msg); - } - - if (false) { - // Locks don't seem to work on windows??? HELP!!!!!!!!! - // if (FALSE === @flock($fp, LOCK_EX)) { // FAILED. - $msg = "Cannot acquire flock on $file. $php_errormsg"; + // Add error from php to end of log message. + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error opening the file.'; + $msg = "Cannot fopen ".$this->file->getAbsolutePath().". $errorMessage"; throw new IOException($msg); } @@ -161,7 +156,9 @@ class FileReader extends Reader { $fileSize = $this->file->length(); if ($fileSize === false) { - $msg = "Cannot get filesize of " . $this->file->__toString() . " $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error reading the file.'; + $msg = "Cannot get filesize of " . $this->file->__toString() . " $errorMessage"; throw new IOException($msg); } $rBuffer = fread($this->fd, $fileSize); diff --git a/thirdparty/phing/system/io/FileSystem.php b/thirdparty/phing/system/io/FileSystem.php index af6fb0abe..78cc7efc7 100644 --- a/thirdparty/phing/system/io/FileSystem.php +++ b/thirdparty/phing/system/io/FileSystem.php @@ -206,7 +206,9 @@ abstract class FileSystem { $mtime = @filemtime($strPath); if (false === $mtime) { // FAILED. Log and return err. - $msg = "FileSystem::Filemtime() FAILED. Cannot can not get modified time of $strPath. $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error getting file time.'; + $msg = "FileSystem::Filemtime() FAILED. Cannot can not get modified time of $strPath. $errorMessage"; throw new Exception($msg); } else { return (int) $mtime; @@ -224,7 +226,9 @@ abstract class FileSystem { if ($fs !== false) { return $fs; } else { - $msg = "FileSystem::Read() FAILED. Cannot get filesize of $strPath. $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error getting file size.'; + $msg = "FileSystem::Read() FAILED. Cannot get filesize of $strPath. $errorMessage"; throw new Exception($msg); } } @@ -320,7 +324,9 @@ abstract class FileSystem { $src = $f1->getAbsolutePath(); $dest = $f2->getAbsolutePath(); if (false === @rename($src, $dest)) { - $msg = "Rename FAILED. Cannot rename $src to $dest. $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error renaming the file.'; + $msg = "Rename FAILED. Cannot rename $src to $dest. $errorMessage"; throw new Exception($msg); } } @@ -336,7 +342,9 @@ abstract class FileSystem { $path = $f->getPath(); $success = @touch($path, $time); if (!$success) { - throw new Exception("Could not create directory due to: $php_errormsg"); + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error setting last modified time.'; + throw new Exception("Could not create directory due to: $errorMessage"); } } @@ -377,13 +385,14 @@ abstract class FileSystem { * @throws Exception if file cannot be copied. */ function copy(PhingFile $src, PhingFile $dest) { - global $php_errormsg; $srcPath = $src->getAbsolutePath(); $destPath = $dest->getAbsolutePath(); if (false === @copy($srcPath, $destPath)) { // Copy FAILED. Log and return err. - // Add error from php to end of log message. $php_errormsg. - $msg = "FileSystem::copy() FAILED. Cannot copy $srcPath to $destPath. $php_errormsg"; + // Add error from php to end of log message. + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error copying the file.'; + $msg = "FileSystem::copy() FAILED. Cannot copy $srcPath to $destPath. $errorMessage"; throw new Exception($msg); } @@ -409,7 +418,9 @@ abstract class FileSystem { function chmod($pathname, $mode) { $str_mode = decoct($mode); // Show octal in messages. if (false === @chmod($pathname, $mode)) {// FAILED. - $msg = "FileSystem::chmod() FAILED. Cannot chmod $pathname. Mode $str_mode. $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error changing the permission.'; + $msg = "FileSystem::chmod() FAILED. Cannot chmod $pathname. Mode $str_mode. $errorMessage"; throw new Exception($msg); } } @@ -454,9 +465,10 @@ abstract class FileSystem { * @throws Exception - if an error is encountered. */ function unlink($file) { - global $php_errormsg; if (false === @unlink($file)) { - $msg = "FileSystem::unlink() FAILED. Cannot unlink '$file'. $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error deleting the file.'; + $msg = "FileSystem::unlink() FAILED. Cannot unlink '$file'. $errorMessage"; throw new Exception($msg); } } @@ -476,8 +488,10 @@ abstract class FileSystem { // the build. Use this error instead of checking for Windows as the OS. if (false === @symlink($target, $link)) { - // Add error from php to end of log message. $php_errormsg. - $msg = "FileSystem::Symlink() FAILED. Cannot symlink '$target' to '$link'. $php_errormsg"; + // Add error from php to end of log message. + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error creating symlink.'; + $msg = "FileSystem::Symlink() FAILED. Cannot symlink '$target' to '$link'. $errorMessage"; throw new Exception($msg); } @@ -491,8 +505,6 @@ abstract class FileSystem { * @return void */ function touch($file, $time = null) { - global $php_errormsg; - if (null === $time) { $error = @touch($file); } else { @@ -500,8 +512,10 @@ abstract class FileSystem { } if (false === $error) { // FAILED. - // Add error from php to end of log message. $php_errormsg. - $msg = "FileSystem::touch() FAILED. Cannot touch '$file'. $php_errormsg"; + // Add error from php to end of log message. + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error touching the file.'; + $msg = "FileSystem::touch() FAILED. Cannot touch '$file'. $errorMessage"; throw new Exception($msg); } } @@ -516,14 +530,14 @@ abstract class FileSystem { * @return void */ function rmdir($dir, $children = false) { - global $php_errormsg; - // If children=FALSE only delete dir if empty. if (false === $children) { if (false === @rmdir($dir)) { // FAILED. - // Add error from php to end of log message. $php_errormsg. - $msg = "FileSystem::rmdir() FAILED. Cannot rmdir $dir. $php_errormsg"; + // Add error from php to end of log message. + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error deleting directory.'; + $msg = "FileSystem::rmdir() FAILED. Cannot rmdir $dir. $errorMessage"; throw new Exception($msg); } @@ -532,8 +546,9 @@ abstract class FileSystem { $handle = @opendir($dir); if (false === $handle) { // Error. - - $msg = "FileSystem::rmdir() FAILED. Cannot opendir() $dir. $php_errormsg"; + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error opening directory.'; + $msg = "FileSystem::rmdir() FAILED. Cannot opendir() $dir. $errorMessage"; throw new Exception($msg); } else { // Read from handle. @@ -584,8 +599,10 @@ abstract class FileSystem { @closedir($handle); if (false === @rmdir($dir)) { // FAILED. - // Add error from php to end of log message. $php_errormsg. - $msg = "FileSystem::rmdir() FAILED. Cannot rmdir $dir. $php_errormsg"; + // Add error from php to end of log message. + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error removing directory.'; + $msg = "FileSystem::rmdir() FAILED. Cannot rmdir $dir. $errorMessage"; throw new Exception($msg); } @@ -603,8 +620,6 @@ abstract class FileSystem { * @throws Exception if there is an error performing operation. */ function umask($mode) { - global $php_errormsg; - // CONSIDERME: // Throw a warning if mode is 0. PHP converts illegal octal numbers to // 0 so 0 might not be what the user intended. @@ -612,8 +627,10 @@ abstract class FileSystem { $str_mode = decoct($mode); // Show octal in messages. if (false === @umask($mode)) { // FAILED. - // Add error from php to end of log message. $php_errormsg. - $msg = "FileSystem::Umask() FAILED. Value $mode. $php_errormsg"; + // Add error from php to end of log message. + $lastError = error_get_last(); + $errorMessage = $lastError['message'] ?? 'Error setting unmask.'; + $msg = "FileSystem::Umask() FAILED. Value $mode. $errorMessage"; throw new Exception($msg); } } @@ -637,11 +654,11 @@ abstract class FileSystem { $mtime2 = filemtime($file2); if ($mtime1 === false) { // FAILED. Log and return err. - // Add error from php to end of log message. $php_errormsg. + // Add error from php to end of log message. $msg = "FileSystem::compareMTimes() FAILED. Cannot can not get modified time of $file1."; throw new Exception($msg); } elseif ($mtime2 === false) { // FAILED. Log and return err. - // Add error from php to end of log message. $php_errormsg. + // Add error from php to end of log message. $msg = "FileSystem::compareMTimes() FAILED. Cannot can not get modified time of $file2."; throw new Exception($msg); } else { // Worked. Log and return compare. diff --git a/thirdparty/phing/system/io/UnixFileSystem.php b/thirdparty/phing/system/io/UnixFileSystem.php index 85f467d0e..610841c16 100644 --- a/thirdparty/phing/system/io/UnixFileSystem.php +++ b/thirdparty/phing/system/io/UnixFileSystem.php @@ -75,8 +75,8 @@ class UnixFileSystem extends FileSystem { // Resolve home directories. We assume /home is where all home // directories reside, b/c there is no other way to do this with // PHP AFAIK. - if ($strPathname{0} === "~") { - if ($strPathname{1} === "/") { // like ~/foo => /home/user/foo + if ($strPathname[0] === "~") { + if ($strPathname[1] === "/") { // like ~/foo => /home/user/foo $strPathname = "/home/" . get_current_user() . substr($strPathname, 1); } else { // like ~foo => /home/foo $pos = strpos($strPathname, "/"); @@ -88,7 +88,7 @@ class UnixFileSystem extends FileSystem { $n = strlen($strPathname); $prevChar = 0; for ($i=0; $i < $n; $i++) { - $c = $strPathname{$i}; + $c = $strPathname[$i]; if (($prevChar === '/') && ($c === '/')) { return self::normalizer($strPathname, $n, $i - 1); } @@ -109,7 +109,7 @@ class UnixFileSystem extends FileSystem { return $pathname; } $n = (int) $len; - while (($n > 0) && ($pathname{$n-1} === '/')) { + while (($n > 0) && ($pathname[$n-1] === '/')) { $n--; } if ($n === 0) { @@ -122,7 +122,7 @@ class UnixFileSystem extends FileSystem { } $prevChar = 0; for ($i = $offset; $i < $n; $i++) { - $c = $pathname{$i}; + $c = $pathname[$i]; if (($prevChar === '/') && ($c === '/')) { continue; } @@ -140,7 +140,7 @@ class UnixFileSystem extends FileSystem { if (strlen($pathname === 0)) { return 0; } - return (($pathname{0} === '/') ? 1 : 0); + return (($pathname[0] === '/') ? 1 : 0); } /** @@ -154,7 +154,7 @@ class UnixFileSystem extends FileSystem { return $parent; } - if ($child{0} === '/') { + if ($child[0] === '/') { if ($parent === '/') { return $child; } @@ -194,7 +194,7 @@ class UnixFileSystem extends FileSystem { function getBooleanAttributes(&$f = null) { //$rv = getBooleanAttributes0($f); $name = $f->getName(); - $hidden = (strlen($name) > 0) && ($name{0} == '.'); + $hidden = (strlen($name) > 0) && ($name[0] == '.'); return ($hidden ? $this->BA_HIDDEN : 0); } diff --git a/thirdparty/phing/system/io/Win32FileSystem.php b/thirdparty/phing/system/io/Win32FileSystem.php index 936b94e93..38f4b51c7 100644 --- a/thirdparty/phing/system/io/Win32FileSystem.php +++ b/thirdparty/phing/system/io/Win32FileSystem.php @@ -48,7 +48,7 @@ class Win32FileSystem extends FileSystem { } function slashify($p) { - if ((strlen($p) > 0) && ($p{0} != $this->slash)) { + if ((strlen($p) > 0) && ($p[0] != $this->slash)) { return $this->slash.$p; } else { @@ -81,13 +81,13 @@ class Win32FileSystem extends FileSystem { */ function normalizePrefix($strPath, $len, $sb) { $src = 0; - while (($src < $len) && $this->isSlash($strPath{$src})) { + while (($src < $len) && $this->isSlash($strPath[$src])) { $src++; } $c = ""; if (($len - $src >= 2) - && $this->isLetter($c = $strPath{$src}) - && $strPath{$src + 1} === ':') { + && $this->isLetter($c = $strPath[$src]) + && $strPath[$src + 1] === ':') { /* Remove leading slashes if followed by drive specifier. * This hack is necessary to support file URLs containing drive * specifiers (e.g., "file://c:/path"). As a side effect, @@ -99,8 +99,8 @@ class Win32FileSystem extends FileSystem { else { $src = 0; if (($len >= 2) - && $this->isSlash($strPath{0}) - && $this->isSlash($strPath{1})) { + && $this->isSlash($strPath[0]) + && $this->isSlash($strPath[1])) { /* UNC pathname: Retain first slash; leave src pointed at * second slash so that further slashes will be collapsed * into the second slash. The result will be a pathname @@ -138,15 +138,15 @@ class Win32FileSystem extends FileSystem { // Remove redundant slashes from the remainder of the path, forcing all // slashes into the preferred slash while ($src < $len) { - $c = $strPath{$src++}; + $c = $strPath[$src++]; if ($this->isSlash($c)) { - while (($src < $len) && $this->isSlash($strPath{$src})) { + while (($src < $len) && $this->isSlash($strPath[$src])) { $src++; } if ($src === $len) { /* Check for trailing separator */ $sn = (int) strlen($sb); - if (($sn == 2) && ($sb{1} === ':')) { + if (($sn == 2) && ($sb[1] === ':')) { // "z:\\" $sb .= $slash; break; @@ -156,7 +156,7 @@ class Win32FileSystem extends FileSystem { $sb .= $slash; break; } - if (($sn === 1) && ($this->isSlash($sb{0}))) { + if (($sn === 1) && ($this->isSlash($sb[0]))) { /* "\\\\" is not collapsed to "\\" because "\\\\" marks the beginning of a UNC pathname. Even though it is not, by itself, a valid UNC pathname, we leave it as @@ -194,7 +194,7 @@ class Win32FileSystem extends FileSystem { $altSlash = $this->altSlash; $prev = 0; for ($i = 0; $i < $n; $i++) { - $c = $strPath{$i}; + $c = $strPath[$i]; if ($c === $altSlash) { return $this->normalizer($strPath, $n, ($prev === $slash) ? $i - 1 : $i); } @@ -219,8 +219,8 @@ class Win32FileSystem extends FileSystem { if ($n === 0) { return 0; } - $c0 = $path{0}; - $c1 = ($n > 1) ? $path{1} : + $c0 = $path[0]; + $c1 = ($n > 1) ? $path[1] : 0; if ($c0 === $slash) { if ($c1 === $slash) { @@ -230,7 +230,7 @@ class Win32FileSystem extends FileSystem { } if ($this->isLetter($c0) && ($c1 === ':')) { - if (($n > 2) && ($path{2}) === $slash) { + if (($n > 2) && ($path[2]) === $slash) { return 3; // Absolute local pathname "z:\\foo" */ } return 2; // Directory-relative "z:foo" @@ -253,8 +253,8 @@ class Win32FileSystem extends FileSystem { } $c = $child; - if (($cn > 1) && ($c{0} === $slash)) { - if ($c{1} === $slash) { + if (($cn > 1) && ($c[0] === $slash)) { + if ($c[1] === $slash) { // drop prefix when child is a UNC pathname $c = substr($c, 2); } @@ -265,7 +265,7 @@ class Win32FileSystem extends FileSystem { } $p = $parent; - if ($p{$pn - 1} === $slash) { + if ($p[$pn - 1] === $slash) { $p = substr($p, 0, $pn - 1); } return $p.$this->slashify($c); @@ -277,7 +277,7 @@ class Win32FileSystem extends FileSystem { function fromURIPath($strPath) { $p = (string) $strPath; - if ((strlen($p) > 2) && ($p{2} === ':')) { + if ((strlen($p) > 2) && ($p[2] === ':')) { // "/c:/foo" --> "c:/foo" $p = substr($p,1); @@ -299,12 +299,12 @@ class Win32FileSystem extends FileSystem { function isAbsolute(PhingFile $f) { $pl = (int) $f->getPrefixLength(); $p = (string) $f->getPath(); - return ((($pl === 2) && ($p{0} === $this->slash)) || ($pl === 3) || ($pl === 1 && $p{0} === $this->slash)); + return ((($pl === 2) && ($p[0] === $this->slash)) || ($pl === 3) || ($pl === 1 && $p[0] === $this->slash)); } /** private */ function _driveIndex($d) { - $d = (string) $d{0}; + $d = (string) $d[0]; if ((ord($d) >= ord('a')) && (ord($d) <= ord('z'))) { return ord($d) - ord('a'); } @@ -316,7 +316,7 @@ class Win32FileSystem extends FileSystem { /** private */ function _getDriveDirectory($drive) { - $drive = (string) $drive{0}; + $drive = (string) $drive[0]; $i = (int) $this->_driveIndex($drive); if ($i < 0) { return null; @@ -348,7 +348,7 @@ class Win32FileSystem extends FileSystem { $path = $f->getPath(); $pl = (int) $f->getPrefixLength(); - if (($pl === 2) && ($path{0} === $this->slash)) { + if (($pl === 2) && ($path[0] === $this->slash)) { return path; // UNC } @@ -375,7 +375,7 @@ class Win32FileSystem extends FileSystem { if (($ud !== null) && StringHelper::startsWith($ud, $path)) { return (string) ($up . $this->slashify(substr($path,2))); } - $drive = (string) $path{0}; + $drive = (string) $path[0]; $dir = (string) $this->_getDriveDirectory($drive); $np = (string) ""; diff --git a/thirdparty/phing/system/util/Properties.php b/thirdparty/phing/system/util/Properties.php index 1bbaf8648..4527a66c9 100644 --- a/thirdparty/phing/system/util/Properties.php +++ b/thirdparty/phing/system/util/Properties.php @@ -81,7 +81,7 @@ class Properties { if($line == "") continue; - if ($line{0} == '#' or $line{0} == ';') { + if ($line[0] == '#' or $line[0] == ';') { // it's a comment, so continue to next line continue; } else { diff --git a/thirdparty/phing/tasks/ext/pearpackage/Fileset.php b/thirdparty/phing/tasks/ext/pearpackage/Fileset.php index 51556d789..a0428d772 100644 --- a/thirdparty/phing/tasks/ext/pearpackage/Fileset.php +++ b/thirdparty/phing/tasks/ext/pearpackage/Fileset.php @@ -194,7 +194,7 @@ class PEAR_PackageFileManager_Fileset { */ function setDir($dir, $contents) { - while(list($one,$two) = each($contents)) { + foreach ($contents as $one => $two) { if (isset($dir[$one])) { $dir[$one] = $this->setDir($dir[$one], $contents[$one]); } else { diff --git a/thirdparty/phing/tasks/system/CvsPassTask.php b/thirdparty/phing/tasks/system/CvsPassTask.php index 966fb8049..3dca7a79e 100644 --- a/thirdparty/phing/tasks/system/CvsPassTask.php +++ b/thirdparty/phing/tasks/system/CvsPassTask.php @@ -138,10 +138,10 @@ class CVSPassTask extends TaskPhing { /** * "Encode" the password. */ - private final function mangle($password){ + private function mangle($password){ $buf = ""; for ($i = 0, $plen = strlen($password); $i < $plen; $i++) { - $buf .= chr(self::$shifts[ord($password{$i})]); + $buf .= chr(self::$shifts[ord($password[$i])]); } return $buf; } diff --git a/thirdparty/phing/tasks/system/PropertyTask.php b/thirdparty/phing/tasks/system/PropertyTask.php index 8cc71170f..c1a769588 100644 --- a/thirdparty/phing/tasks/system/PropertyTask.php +++ b/thirdparty/phing/tasks/system/PropertyTask.php @@ -412,7 +412,7 @@ class PropertyTask extends TaskPhing { if ($pos === (strlen($value) - 1)) { array_push($fragments, '$'); $prev = $pos + 1; - } elseif ($value{$pos+1} !== '{' ) { + } elseif ($value[$pos+1] !== '{' ) { // the string positions were changed to value-1 to correct // a fatal error coming from function substring() diff --git a/thirdparty/phing/types/Path.php b/thirdparty/phing/types/Path.php index 502b3a1e3..c26b5f5f7 100644 --- a/thirdparty/phing/types/Path.php +++ b/thirdparty/phing/types/Path.php @@ -355,8 +355,8 @@ class Path extends DataType { * replacements. */ protected static function translateFileSep(&$buffer, $pos) { - if ($buffer{$pos} == '/' || $buffer{$pos} == '\\') { - $buffer{$pos} = DIRECTORY_SEPARATOR; + if ($buffer[$pos] == '/' || $buffer[$pos] == '\\') { + $buffer[$pos] = DIRECTORY_SEPARATOR; return true; } return false; diff --git a/thirdparty/phing/util/FileUtils.php b/thirdparty/phing/util/FileUtils.php index 2618831e7..f9af9aa5b 100644 --- a/thirdparty/phing/util/FileUtils.php +++ b/thirdparty/phing/util/FileUtils.php @@ -131,11 +131,11 @@ class FileUtils { // deal with absolute files if (StringHelper::startsWith($fs->getSeparator(), $filename) || - (strlen($filename) >= 2 && Character::isLetter($filename{0}) && $filename{1} === ':')) { + (strlen($filename) >= 2 && Character::isLetter($filename[0]) && $filename[1] === ':')) { return new PhingFile($this->normalize($filename)); } - if (strlen($filename) >= 2 && Character::isLetter($filename{0}) && $filename{1} === ':') { + if (strlen($filename) >= 2 && Character::isLetter($filename[0]) && $filename[1] === ':') { return new PhingFile($this->normalize($filename)); } @@ -182,7 +182,7 @@ class FileUtils { // make sure we are dealing with an absolute path if (!StringHelper::startsWith(DIRECTORY_SEPARATOR, $path) - && !(strlen($path) >= 2 && Character::isLetter($path{0}) && $path{1} === ':')) { + && !(strlen($path) >= 2 && Character::isLetter($path[0]) && $path[1] === ':')) { throw new IOException("$path is not an absolute path"); } @@ -191,7 +191,7 @@ class FileUtils { // Eliminate consecutive slashes after the drive spec - if (strlen($path) >= 2 && Character::isLetter($path{0}) && $path{1} === ':') { + if (strlen($path) >= 2 && Character::isLetter($path[0]) && $path[1] === ':') { $dosWithDrive = true; $ca = str_replace('/', '\\', $path); @@ -221,7 +221,7 @@ class FileUtils { if (strlen($path) == 1) { $root = DIRECTORY_SEPARATOR; $path = ""; - } else if ($path{1} == DIRECTORY_SEPARATOR) { + } else if ($path[1] == DIRECTORY_SEPARATOR) { // UNC drive $root = DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR; $path = substr($path, 2); diff --git a/thirdparty/phing/util/PathTokenizer.php b/thirdparty/phing/util/PathTokenizer.php index 1e24c98d9..4f0f3e3de 100644 --- a/thirdparty/phing/util/PathTokenizer.php +++ b/thirdparty/phing/util/PathTokenizer.php @@ -179,7 +179,7 @@ class PathTokenizer { - if (strlen($token) === 1 && Character::isLetter($token{0}) + if (strlen($token) === 1 && Character::isLetter($token[0]) && $this->dosStyleFilesystem diff --git a/thirdparty/phing/util/StringHelper.php b/thirdparty/phing/util/StringHelper.php index f64fac670..d23a8fcf5 100644 --- a/thirdparty/phing/util/StringHelper.php +++ b/thirdparty/phing/util/StringHelper.php @@ -60,7 +60,7 @@ class StringHelper { $ret=array(); $len=strlen($str); for ($i=0; $i < $len; $i++) { - $ret[] = $str{$i}; + $ret[] = $str[$i]; } return $ret; } @@ -177,7 +177,7 @@ class StringHelper { trigger_error("substring(), Endindex out of bounds must be $startpos. - */ - -require_once 'propel/engine/builder/sql/DataSQLBuilder.php'; - -/** - * SQLite class for building data dump SQL. - * - * @author Hans Lellelid - * @package propel.engine.builder.sql.sqlite - */ -class SqliteDataSQLBuilder extends DataSQLBuilder { - - /** - * Returns string processed by sqlite_udf_encode_binary() to ensure that binary contents will be handled correctly by sqlite. - * @param mixed $blob Blob or string - * @return string encoded text - */ - protected function getBlobSql($blob) - { - // they took magic __toString() out of PHP5.0.0; this sucks - if (is_object($blob)) { - $blob = $blob->__toString(); - } - return "'" . sqlite_udf_encode_binary($blob) . "'"; - } - -} diff --git a/thirdparty/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php b/thirdparty/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php index 8c6b112f4..1f6c88b74 100644 --- a/thirdparty/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php +++ b/thirdparty/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php @@ -178,7 +178,7 @@ class XmlToAppData extends AbstractHandler $this->isForReferenceOnly = ($isForRefOnly !== null ? (strtolower($isForRefOnly) === "true") : true); // defaults to TRUE } - if ($xmlFile{0} != '/') { + if ($xmlFile[0] != '/') { $f = new PhingFile($this->currentXmlFile); $xf = new PhingFile($f->getParent(), $xmlFile); $xmlFile = $xf->getPath(); diff --git a/thirdparty/propel-generator/classes/propel/engine/platform/SqlitePlatform.php b/thirdparty/propel-generator/classes/propel/engine/platform/SqlitePlatform.php deleted file mode 100644 index db1477de5..000000000 --- a/thirdparty/propel-generator/classes/propel/engine/platform/SqlitePlatform.php +++ /dev/null @@ -1,92 +0,0 @@ -. - */ - -require_once 'propel/engine/platform/DefaultPlatform.php'; - -/** - * SQLite Platform implementation. - * - * @author Hans Lellelid - * @version $Revision: 536 $ - * @package propel.engine.platform - */ -class SqlitePlatform extends DefaultPlatform { - - /** - * Initializes db specific domain mapping. - */ - protected function initialize() - { - parent::initialize(); - $this->setSchemaDomainMapping(new Domain(PropelTypes::NUMERIC, "DECIMAL")); - $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, "MEDIUMTEXT")); - $this->setSchemaDomainMapping(new Domain(PropelTypes::DATE, "DATETIME")); - $this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, "BLOB")); - $this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, "MEDIUMBLOB")); - $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, "LONGBLOB")); - $this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, "LONGBLOB")); - $this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, "LONGTEXT")); - } - - /** - * @see Platform#getAutoIncrement() - * @link http://www.sqlite.org/autoinc.html - */ - public function getAutoIncrement() - { - - return "PRIMARY KEY"; - } - - /** - * @see Platform#getMaxColumnNameLength() - */ - public function getMaxColumnNameLength() - { - return 1024; - } - - /** - * @see Platform#hasSize(String) - */ - public function hasSize($sqlType) { - return !("MEDIUMTEXT" == $sqlType || "LONGTEXT" == $sqlType - || "BLOB" == $sqlType || "MEDIUMBLOB" == $sqlType - || "LONGBLOB" == $sqlType); - } - - /** - * Escape the string for RDBMS. - * @param string $text - * @return string - */ - public function escapeText($text) { - return sqlite_escape_string($text); - } - - /** - * @see Platform::quoteIdentifier() - */ - public function quoteIdentifier($text) - { - return '[' . $text . ']'; - } -} diff --git a/thirdparty/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php b/thirdparty/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php index 37d90e4a6..ca1912548 100644 --- a/thirdparty/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php +++ b/thirdparty/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php @@ -369,7 +369,7 @@ abstract class AbstractPropelDataModelTask extends TaskPhing { // This is a slight hack to workaround camel case inconsistencies for the DDL classes. // Basically, we want to turn ?.?.?.sqliteDDLBuilder into ?.?.?.SqliteDDLBuilder $lastdotpos = strrpos($classpath, '.'); - if ($lastdotpos) $classpath{$lastdotpos+1} = strtoupper($classpath{$lastdotpos+1}); + if ($lastdotpos) $classpath[$lastdotpos+1] = strtoupper($classpath[$lastdotpos+1]); else ucfirst($classpath); if (empty($classpath)) { diff --git a/thirdparty/propel/validator/MatchValidator.php b/thirdparty/propel/validator/MatchValidator.php index 810cccb45..05b1fbfff 100644 --- a/thirdparty/propel/validator/MatchValidator.php +++ b/thirdparty/propel/validator/MatchValidator.php @@ -61,7 +61,7 @@ class MatchValidator implements BasicValidator private function prepareRegexp($exp) { // remove surrounding '/' marks so that they don't get escaped in next step - if ($exp{0} !== '/' || $exp{strlen($exp)-1} !== '/' ) { + if ($exp[0] !== '/' || $exp[strlen($exp)-1] !== '/' ) { $exp = '/' . $exp . '/'; } diff --git a/thirdparty/propel/validator/NotMatchValidator.php b/thirdparty/propel/validator/NotMatchValidator.php index 352da65af..ad9137066 100644 --- a/thirdparty/propel/validator/NotMatchValidator.php +++ b/thirdparty/propel/validator/NotMatchValidator.php @@ -59,7 +59,7 @@ class NotMatchValidator implements BasicValidator private function prepareRegexp($exp) { // remove surrounding '/' marks so that they don't get escaped in next step - if ($exp{0} !== '/' || $exp{strlen($exp)-1} !== '/' ) { + if ($exp[0] !== '/' || $exp[strlen($exp)-1] !== '/' ) { $exp = '/' . $exp . '/'; } diff --git a/workflow/engine/controllers/appProxy.php b/workflow/engine/controllers/appProxy.php index 2b3d8e237..339364ff3 100644 --- a/workflow/engine/controllers/appProxy.php +++ b/workflow/engine/controllers/appProxy.php @@ -199,7 +199,7 @@ class AppProxy extends HttpProxyController @ob_flush(); @flush(); @ob_end_flush(); - ob_implicit_flush(1); + ob_implicit_flush(true); } /** diff --git a/workflow/engine/src/ProcessMaker/Util/helpers.php b/workflow/engine/src/ProcessMaker/Util/helpers.php index febc8a2f3..4f0db0051 100644 --- a/workflow/engine/src/ProcessMaker/Util/helpers.php +++ b/workflow/engine/src/ProcessMaker/Util/helpers.php @@ -25,7 +25,7 @@ function postNote($httpData) @ob_flush(); @flush(); @ob_end_flush(); - ob_implicit_flush(1); + ob_implicit_flush(true); //send notification in background $noteRecipientsList = array();