PMCORE-3844
This commit is contained in:
committed by
Mauricio Veliz
parent
7bb67a97bd
commit
9f1b738093
@@ -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
|
||||
@@ -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_.-]+';
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
8
thirdparty/creole/Creole.php
vendored
8
thirdparty/creole/Creole.php
vendored
@@ -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.
|
||||
|
||||
@@ -77,8 +77,6 @@ class OCI8Connection extends ConnectionCommon implements Connection
|
||||
: 'oci_connect';
|
||||
$encoding = !empty($dsninfo['encoding']) ? $dsninfo['encoding'] : null;
|
||||
|
||||
@ini_set( 'track_errors', true );
|
||||
|
||||
if ( $hostspec && $port )
|
||||
{
|
||||
$hostspec .= ':' . $port;
|
||||
|
||||
@@ -54,8 +54,6 @@ class PgSQLConnection extends ConnectionCommon implements Connection {
|
||||
*/
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -143,7 +143,7 @@ class SQLStatementExtractor {
|
||||
trigger_error("substring(), Endindex out of bounds must be $startpos<n<".($len-1), E_USER_ERROR);
|
||||
}
|
||||
if ($startpos === $endpos) {
|
||||
return (string) $string{$startpos};
|
||||
return (string) $string[$startpos];
|
||||
} else {
|
||||
$len = $endpos-$startpos;
|
||||
}
|
||||
|
||||
2
thirdparty/pake/pakeApp.class.php
vendored
2
thirdparty/pake/pakeApp.class.php
vendored
@@ -386,7 +386,7 @@ class pakeApp
|
||||
$files = preg_replace('/^'.preg_quote(realpath($target_dir), '/').'/', '', $files);
|
||||
|
||||
// remove leading /
|
||||
$files = array_map(create_function('$f', 'return 0 === strpos($f, DIRECTORY_SEPARATOR) ? substr($f, 1) : $f;'), $files);
|
||||
$files = array_map(function($f){return 0 === strpos($f, DIRECTORY_SEPARATOR) ? substr($f, 1) : $f;}, $files);
|
||||
}
|
||||
|
||||
return $files;
|
||||
|
||||
1
thirdparty/pake/pakeFunction.php
vendored
1
thirdparty/pake/pakeFunction.php
vendored
@@ -409,7 +409,6 @@ if (false !== strpos(PHP_SAPI, 'cgi'))
|
||||
|
||||
// PHP ini settings
|
||||
set_time_limit(0);
|
||||
ini_set('track_errors', true);
|
||||
ini_set('html_errors', false);
|
||||
|
||||
// define stream constants
|
||||
|
||||
2
thirdparty/pake/pakeGetopt.class.php
vendored
2
thirdparty/pake/pakeGetopt.class.php
vendored
@@ -72,7 +72,7 @@ class pakeGetopt
|
||||
if (is_string($args))
|
||||
{
|
||||
// hack to split arguments with spaces : --test="with some spaces"
|
||||
$args = preg_replace('/(\'|")(.+?)\\1/e', "str_replace(' ', '=PLACEHOLDER=', '\\2')", $args);
|
||||
$args = preg_replace_callback('/(\'|")(.+?)\\1/', function($matches){return str_replace(' ', '=PLACEHOLDER=', $matches['2']);}, $args);
|
||||
$args = preg_split('/\s+/', $args);
|
||||
$args = str_replace('=PLACEHOLDER=', ' ', $args);
|
||||
}
|
||||
|
||||
21
thirdparty/pake/pakeYaml.class.php
vendored
21
thirdparty/pake/pakeYaml.class.php
vendored
@@ -874,7 +874,7 @@
|
||||
$ret = array();
|
||||
|
||||
foreach($keys as $key) {
|
||||
list($unused,$val) = each($vals);
|
||||
list($unused,$val) = self::each($vals);
|
||||
// This is the good part! If a key already exists, but it's part of a
|
||||
// sequence (an int), just keep addin numbers until we find a fresh one.
|
||||
if (isset($ret[$key]) and is_int($key)) {
|
||||
@@ -887,4 +887,23 @@
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
6
thirdparty/pear/DB.php
vendored
6
thirdparty/pear/DB.php
vendored
@@ -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];
|
||||
|
||||
4
thirdparty/pear/DB/common.php
vendored
4
thirdparty/pear/DB/common.php
vendored
@@ -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;
|
||||
|
||||
10
thirdparty/pear/DB/mysqli.php
vendored
10
thirdparty/pear/DB/mysqli.php
vendored
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
thirdparty/pear/DB/oci8.php
vendored
4
thirdparty/pear/DB/oci8.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
2
thirdparty/pear/DB/odbc.php
vendored
2
thirdparty/pear/DB/odbc.php
vendored
@@ -50,7 +50,7 @@ class DB_odbc extends DB_common
|
||||
// }}}
|
||||
// {{{ constructor
|
||||
|
||||
function DB_odbc()
|
||||
function __construct()
|
||||
{
|
||||
$this->DB_common();
|
||||
$this->phptype = 'odbc';
|
||||
|
||||
8
thirdparty/pear/DB/pgsql.php
vendored
8
thirdparty/pear/DB/pgsql.php
vendored
@@ -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;
|
||||
|
||||
2
thirdparty/pear/Log/composite.php
vendored
2
thirdparty/pear/Log/composite.php
vendored
@@ -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;
|
||||
|
||||
2
thirdparty/pear/Log/console.php
vendored
2
thirdparty/pear/Log/console.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/daemon.php
vendored
2
thirdparty/pear/Log/daemon.php
vendored
@@ -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. */
|
||||
|
||||
2
thirdparty/pear/Log/display.php
vendored
2
thirdparty/pear/Log/display.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/error_log.php
vendored
2
thirdparty/pear/Log/error_log.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/file.php
vendored
2
thirdparty/pear/Log/file.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/firebug.php
vendored
2
thirdparty/pear/Log/firebug.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/mail.php
vendored
2
thirdparty/pear/Log/mail.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/mcal.php
vendored
2
thirdparty/pear/Log/mcal.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/mdb2.php
vendored
2
thirdparty/pear/Log/mdb2.php
vendored
@@ -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')){
|
||||
|
||||
2
thirdparty/pear/Log/null.php
vendored
2
thirdparty/pear/Log/null.php
vendored
@@ -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')){
|
||||
|
||||
8
thirdparty/pear/Log/observer.php
vendored
8
thirdparty/pear/Log/observer.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
2
thirdparty/pear/Log/sql.php
vendored
2
thirdparty/pear/Log/sql.php
vendored
@@ -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());
|
||||
|
||||
2
thirdparty/pear/Log/syslog.php
vendored
2
thirdparty/pear/Log/syslog.php
vendored
@@ -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. */
|
||||
|
||||
2
thirdparty/pear/Log/win.php
vendored
2
thirdparty/pear/Log/win.php
vendored
@@ -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());
|
||||
|
||||
10
thirdparty/pear/OS/Guess.php
vendored
10
thirdparty/pear/OS/Guess.php
vendored
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
8
thirdparty/pear/PEAR/Autoloader.php
vendored
8
thirdparty/pear/PEAR/Autoloader.php
vendored
@@ -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]);
|
||||
|
||||
6
thirdparty/pear/PEAR/Builder.php
vendored
6
thirdparty/pear/PEAR/Builder.php
vendored
@@ -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!
|
||||
|
||||
10
thirdparty/pear/PEAR/Command.php
vendored
10
thirdparty/pear/PEAR/Command.php
vendored
@@ -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) {
|
||||
|
||||
2
thirdparty/pear/PEAR/Command/Auth.php
vendored
2
thirdparty/pear/PEAR/Command/Auth.php
vendored
@@ -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);
|
||||
}
|
||||
|
||||
4
thirdparty/pear/PEAR/Command/Build.php
vendored
4
thirdparty/pear/PEAR/Command/Build.php
vendored
@@ -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)) {
|
||||
|
||||
10
thirdparty/pear/PEAR/Command/Common.php
vendored
10
thirdparty/pear/PEAR/Command/Common.php
vendored
@@ -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 <ssb@php.net> |
|
||||
// | Author: Stig S<>ther Bakken <ssb@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $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]";
|
||||
|
||||
2
thirdparty/pear/PEAR/Command/Config.php
vendored
2
thirdparty/pear/PEAR/Command/Config.php
vendored
@@ -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);
|
||||
}
|
||||
|
||||
8
thirdparty/pear/PEAR/Command/Install.php
vendored
8
thirdparty/pear/PEAR/Command/Install.php
vendored
@@ -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 <ssb@php.net> |
|
||||
// | Author: Stig S<>ther Bakken <ssb@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $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");
|
||||
|
||||
4
thirdparty/pear/PEAR/Command/Mirror.php
vendored
4
thirdparty/pear/PEAR/Command/Mirror.php
vendored
@@ -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;
|
||||
|
||||
8
thirdparty/pear/PEAR/Command/Package.php
vendored
8
thirdparty/pear/PEAR/Command/Package.php
vendored
@@ -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");
|
||||
|
||||
10
thirdparty/pear/PEAR/Command/Registry.php
vendored
10
thirdparty/pear/PEAR/Command/Registry.php
vendored
@@ -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)) {
|
||||
|
||||
20
thirdparty/pear/PEAR/Common.php
vendored
20
thirdparty/pear/PEAR/Common.php
vendored
@@ -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)");
|
||||
}
|
||||
|
||||
4
thirdparty/pear/PEAR/Config.php
vendored
4
thirdparty/pear/PEAR/Config.php
vendored
@@ -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'];
|
||||
}
|
||||
|
||||
|
||||
2
thirdparty/pear/PEAR/Dependency.php
vendored
2
thirdparty/pear/PEAR/Dependency.php
vendored
@@ -45,7 +45,7 @@ class PEAR_Dependency
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
*/
|
||||
function PEAR_Dependency(&$registry)
|
||||
function __construct(&$registry)
|
||||
{
|
||||
$this->registry = &$registry;
|
||||
}
|
||||
|
||||
4
thirdparty/pear/PEAR/Frontend/CLI.php
vendored
4
thirdparty/pear/PEAR/Frontend/CLI.php
vendored
@@ -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 <ssb@php.net> |
|
||||
| Author: Stig S<>ther Bakken <ssb@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$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
|
||||
|
||||
20
thirdparty/pear/PEAR/Installer.php
vendored
20
thirdparty/pear/PEAR/Installer.php
vendored
@@ -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'])) {
|
||||
|
||||
6
thirdparty/pear/PEAR/Packager.php
vendored
6
thirdparty/pear/PEAR/Packager.php
vendored
@@ -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);
|
||||
}
|
||||
|
||||
13
thirdparty/pear/PEAR/Registry.php
vendored
13
thirdparty/pear/PEAR/Registry.php
vendored
@@ -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) {
|
||||
|
||||
136
thirdparty/pear/PEAR/Remote.php
vendored
136
thirdparty/pear/PEAR/Remote.php
vendored
@@ -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;
|
||||
@@ -112,13 +112,6 @@ class PEAR_Remote extends PEAR
|
||||
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
|
||||
|
||||
2
thirdparty/pear/PearSystem.php
vendored
2
thirdparty/pear/PearSystem.php
vendored
@@ -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
|
||||
|
||||
5
thirdparty/phing/Phing.php
vendored
5
thirdparty/phing/Phing.php
vendored
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
11
thirdparty/phing/lib/Capsule.php
vendored
11
thirdparty/phing/lib/Capsule.php
vendored
@@ -140,15 +140,14 @@ class Capsule {
|
||||
}
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
56
thirdparty/phing/lib/Zip.php
vendored
56
thirdparty/phing/lib/Zip.php
vendored
@@ -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<sizeof($v_callback_list); $i++) {
|
||||
$v_key=$v_callback_list[$i];
|
||||
|
||||
if ( (isset($p_params[$v_key])) && ($p_params[$v_key] != '')) {
|
||||
if (!function_exists($p_params[$v_key])) {
|
||||
$this->_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
|
||||
|
||||
|
||||
2
thirdparty/phing/mappers/RegexpMapper.php
vendored
2
thirdparty/phing/mappers/RegexpMapper.php
vendored
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
23
thirdparty/phing/system/io/FileReader.php
vendored
23
thirdparty/phing/system/io/FileReader.php
vendored
@@ -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);
|
||||
|
||||
77
thirdparty/phing/system/io/FileSystem.php
vendored
77
thirdparty/phing/system/io/FileSystem.php
vendored
@@ -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.
|
||||
|
||||
16
thirdparty/phing/system/io/UnixFileSystem.php
vendored
16
thirdparty/phing/system/io/UnixFileSystem.php
vendored
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
46
thirdparty/phing/system/io/Win32FileSystem.php
vendored
46
thirdparty/phing/system/io/Win32FileSystem.php
vendored
@@ -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) "";
|
||||
|
||||
2
thirdparty/phing/system/util/Properties.php
vendored
2
thirdparty/phing/system/util/Properties.php
vendored
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
4
thirdparty/phing/types/Path.php
vendored
4
thirdparty/phing/types/Path.php
vendored
@@ -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;
|
||||
|
||||
10
thirdparty/phing/util/FileUtils.php
vendored
10
thirdparty/phing/util/FileUtils.php
vendored
@@ -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);
|
||||
|
||||
2
thirdparty/phing/util/PathTokenizer.php
vendored
2
thirdparty/phing/util/PathTokenizer.php
vendored
@@ -179,7 +179,7 @@ class PathTokenizer {
|
||||
|
||||
|
||||
|
||||
if (strlen($token) === 1 && Character::isLetter($token{0})
|
||||
if (strlen($token) === 1 && Character::isLetter($token[0])
|
||||
|
||||
&& $this->dosStyleFilesystem
|
||||
|
||||
|
||||
4
thirdparty/phing/util/StringHelper.php
vendored
4
thirdparty/phing/util/StringHelper.php
vendored
@@ -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<n<".($len-1), E_USER_ERROR);
|
||||
}
|
||||
if ($startpos === $endpos) {
|
||||
return (string) $string{$startpos};
|
||||
return (string) $string[$startpos];
|
||||
} else {
|
||||
$len = $endpos-$startpos;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ abstract class DataModelBuilder {
|
||||
// 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);
|
||||
|
||||
return Phing::import($classpath);
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: SqliteDataSQLBuilder.php 3752 2007-04-11 09:11:18Z fabien $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/engine/builder/sql/DataSQLBuilder.php';
|
||||
|
||||
/**
|
||||
* SQLite class for building data dump SQL.
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org>
|
||||
* @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) . "'";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* $Id: SqlitePlatform.php 3752 2007-04-11 09:11:18Z fabien $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/engine/platform/DefaultPlatform.php';
|
||||
|
||||
/**
|
||||
* SQLite Platform implementation.
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org>
|
||||
* @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 . ']';
|
||||
}
|
||||
}
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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 . '/';
|
||||
}
|
||||
|
||||
|
||||
@@ -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 . '/';
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ class AppProxy extends HttpProxyController
|
||||
@ob_flush();
|
||||
@flush();
|
||||
@ob_end_flush();
|
||||
ob_implicit_flush(1);
|
||||
ob_implicit_flush(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user