Skip to content

Commit 8ccfb37

Browse files
committed
Merge branch '1.0' of https://github.com/Tactics/symfony1 into 1.0
2 parents 93d3394 + 1415d38 commit 8ccfb37

File tree

16 files changed

+165
-139
lines changed

16 files changed

+165
-139
lines changed

data/bin/symfony.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
// set magic_quotes_runtime to off
1717
ini_set('magic_quotes_runtime', 'Off');
1818

19+
// Set autoloader to remove __autoload() function which no longer works in php 8
20+
spl_autoload_register('legacyAutoload');
21+
1922
// force populating $argc and $argv in the case PHP does not automatically create them (fixes #2943)
2023
$argv = $_SERVER['argv'];
2124
$argc = $_SERVER['argc'];
@@ -106,7 +109,7 @@ static public function registerCallable($callable)
106109
}
107110
}
108111

109-
function __autoload($class)
112+
function legacyAutoload($class)
110113
{
111114
static $initialized = false;
112115

lib/vendor/pake/pakeGetopt.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function parse($args = null)
108108
$this->arguments = array_merge($this->arguments, array($arg), $this->args);
109109
break;
110110
}
111-
elseif (strlen($arg) > 1 && $arg{1} == '-')
111+
elseif (strlen($arg) > 1 && $arg[1] == '-')
112112
{
113113
$this->parse_long_option(substr($arg, 2));
114114
}

lib/vendor/phing/IntrospectionHelper.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ function __construct($class) {
222222

223223
$classname = null;
224224

225-
if (($hint = $params[0]->getClass()) !== null) {
225+
$hint = $params[0]->getType() && !$params[0]->getType()->isBuiltin()
226+
? new ReflectionClass($params[0]->getType()->getName())
227+
: null;
228+
229+
if ($hint !== null) {
226230
$classname = $hint->getName();
227231
}
228232

@@ -250,7 +254,11 @@ function __construct($class) {
250254

251255
$classname = null;
252256

253-
if (($hint = $params[0]->getClass()) !== null) {
257+
$hint = $params[0]->getType() && !$params[0]->getType()->isBuiltin()
258+
? new ReflectionClass($params[0]->getType()->getName())
259+
: null;
260+
261+
if ($hint !== null) {
254262
$classname = $hint->getName();
255263
}
256264

@@ -327,7 +335,11 @@ function setAttribute(Project $project, $element, $attributeName, &$value) {
327335

328336
$classname = null;
329337

330-
if (($hint = $params[0]->getClass()) !== null) {
338+
$hint = $params[0]->getType() && !$params[0]->getType()->isBuiltin()
339+
? new ReflectionClass($params[0]->getType()->getName())
340+
: null;
341+
342+
if ($hint !== null) {
331343
$classname = $hint->getName();
332344
}
333345

@@ -413,7 +425,11 @@ function createElement(Project $project, $element, $elementName) {
413425

414426
$classname = null;
415427

416-
if (($hint = $params[0]->getClass()) !== null) {
428+
$hint = $params[0]->getType() && !$params[0]->getType()->isBuiltin()
429+
? new ReflectionClass($params[0]->getType()->getName())
430+
: null;
431+
432+
if ($hint !== null) {
417433
$classname = $hint->getName();
418434
}
419435

lib/vendor/phing/listener/AnsiColorLogger.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
*
6363
* Format for AnsiColorLogger.*=
6464
* Attribute;Foreground;Background
65-
*
65+
*
6666
* Attribute is one of the following:
6767
* 0 -> Reset All Attributes (return to normal mode)
6868
* 1 -> Bright (Usually turns on BOLD)
@@ -91,7 +91,7 @@
9191
* 45 -> Magenta
9292
* 46 -> Cyan
9393
* 47 -> White
94-
*
94+
*
9595
* @author Hans Lellelid <[email protected]> (Phing)
9696
* @author Magesh Umasankar (Ant)
9797
* @package phing.listener
@@ -137,7 +137,7 @@ final class AnsiColorLogger extends DefaultLogger {
137137
private $debugColor;
138138

139139
private $colorsSet = false;
140-
140+
141141
/**
142142
* Construct new AnsiColorLogger
143143
* Perform initializations that cannot be done in var declarations.
@@ -150,13 +150,13 @@ public function __construct() {
150150
$this->verboseColor = self::PREFIX . self::ATTR_DIM . self::SEPARATOR . self::FG_GREEN . self::SUFFIX;
151151
$this->debugColor = self::PREFIX . self::ATTR_DIM . self::SEPARATOR . self::FG_BLUE . self::SUFFIX;
152152
}
153-
153+
154154
/**
155155
* Set the colors to use from a property file specified by the
156156
* special ant property ant.logger.defaults
157157
*/
158-
private final function setColors() {
159-
158+
private function setColors() {
159+
160160
$userColorFile = Phing::getProperty("phing.logger.defaults");
161161
$systemColorFile = new PhingFile(Phing::getResourcePath("phing/listener/defaults.properties"));
162162

@@ -169,8 +169,8 @@ private final function setColors() {
169169
$prop->load($userColorFile);
170170
} else {
171171
$prop->load($systemColorFile);
172-
}
173-
172+
}
173+
174174
$err = $prop->getProperty("AnsiColorLogger.ERROR_COLOR");
175175
$warn = $prop->getProperty("AnsiColorLogger.WARNING_COLOR");
176176
$info = $prop->getProperty("AnsiColorLogger.INFO_COLOR");
@@ -200,20 +200,20 @@ private final function setColors() {
200200
* @see DefaultLogger#printMessage
201201
*/
202202
protected final function printMessage($message, $priority) {
203-
203+
204204
if ($message !== null) {
205-
205+
206206
if (!$this->colorsSet) {
207207
$this->setColors();
208208
$this->colorsSet = true;
209209
}
210-
210+
211211
switch ($priority) {
212212
case PROJECT_MSG_ERR:
213213
$message = $this->errColor . $message . self::END_COLOR;
214214
break;
215215
case PROJECT_MSG_WARN:
216-
$message = $this->warnColor . $message . self::END_COLOR;
216+
$message = $this->warnColor . $message . self::END_COLOR;
217217
break;
218218
case PROJECT_MSG_INFO:
219219
$message = $this->infoColor . $message . self::END_COLOR;

lib/vendor/phing/system/io/BufferedReader.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ class BufferedReader extends Reader {
3535
private $bufferSize = 0;
3636
private $buffer = null;
3737
private $bufferPos = 0;
38-
38+
3939
/**
4040
* The Reader we are buffering for.
4141
*/
4242
private $in;
43-
43+
4444
/**
45-
*
45+
*
4646
* @param object $reader The reader (e.g. FileReader).
4747
* @param integer $buffsize The size of the buffer we should use for reading files.
4848
* A large buffer ensures that most files (all scripts?) are parsed in 1 buffer.
49-
*/
49+
*/
5050
function __construct(Reader $reader, $buffsize = 65536) {
5151
$this->in = $reader;
5252
$this->bufferSize = $buffsize;
@@ -57,53 +57,53 @@ function __construct(Reader $reader, $buffsize = 65536) {
5757
* @return mixed buffer or -1 if EOF.
5858
*/
5959
function read($len = null) {
60-
// ignore $len param, not sure how to hanlde it, since
60+
// ignore $len param, not sure how to hanlde it, since
6161
// this should only read bufferSize amount of data.
6262
if ($len !== null) {
6363
$this->currentPosition = ftell($this->fd);
6464
}
65-
65+
6666
if ( ($data = $this->in->read($this->bufferSize)) !== -1 ) {
67-
67+
6868
// not all files end with a newline character, so we also need to check EOF
6969
if (!$this->in->eof()) {
70-
70+
7171
$notValidPart = strrchr($data, "\n");
7272
$notValidPartSize = strlen($notValidPart);
73-
73+
7474
if ( $notValidPartSize > 1 ) {
7575
// Block doesn't finish on a EOL
7676
// Find the last EOL and forgot all following stuff
7777
$dataSize = strlen($data);
7878
$validSize = $dataSize - $notValidPartSize + 1;
79-
79+
8080
$data = substr($data, 0, $validSize);
81-
81+
8282
// Rewind to the begining of the forgotten stuff.
8383
$this->in->skip(-$notValidPartSize+1);
8484
}
85-
85+
8686
} // if !EOF
8787
}
8888
return $data;
8989
}
90-
90+
9191
function skip($n) {
9292
return $this->in->skip($n);
9393
}
94-
94+
9595
function reset() {
9696
return $this->in->reset();
9797
}
98-
98+
9999
function close() {
100100
return $this->in->close();
101101
}
102-
102+
103103
function open() {
104104
return $this->in->open();
105105
}
106-
106+
107107
/**
108108
* Read a line from input stream.
109109
*/
@@ -122,12 +122,12 @@ function readLine() {
122122

123123
return $line;
124124
}
125-
125+
126126
/**
127127
* Reads a single char from the reader.
128128
* @return string single char or -1 if EOF.
129129
*/
130-
function readChar() {
130+
function readChar() {
131131

132132
if ( $this->buffer === null ) {
133133
// Buffer is empty, fill it ...
@@ -138,11 +138,11 @@ function readChar() {
138138
$this->buffer = $read;
139139
return $this->readChar(); // recurse
140140
}
141-
} else {
141+
} else {
142142
// Get next buffered char ...
143143
// handle case where buffer is read-in, but is empty. The next readChar() will return -1 EOF,
144144
// so we just return empty string (char) at this point. (Probably could also return -1 ...?)
145-
$ch = ($this->buffer !== "") ? $this->buffer{$this->bufferPos} : '';
145+
$ch = ($this->buffer !== "") ? $this->buffer[$this->bufferPos] : '';
146146
$this->bufferPos++;
147147
if ( $this->bufferPos >= strlen($this->buffer) ) {
148148
$this->buffer = null;
@@ -152,19 +152,19 @@ function readChar() {
152152

153153
return $ch;
154154
}
155-
155+
156156
/**
157157
* Returns whether eof has been reached in stream.
158158
* This is important, because filters may want to know if the end of the file (and not just buffer)
159159
* has been reached.
160160
* @return boolean
161-
*/
161+
*/
162162
function eof() {
163163
return $this->in->eof();
164164
}
165165

166166
function getResource() {
167167
return $this->in->getResource();
168-
}
168+
}
169169
}
170170
?>

lib/vendor/phing/system/io/UnixFileSystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected function normalizer($pathname, $len, $offset) {
109109
return $pathname;
110110
}
111111
$n = (int) $len;
112-
while (($n > 0) && ($pathname{$n-1} === '/')) {
112+
while (($n > 0) && ($pathname[$n-1] === '/')) {
113113
$n--;
114114
}
115115
if ($n === 0) {
@@ -140,7 +140,7 @@ function prefixLength($pathname) {
140140
if (strlen($pathname === 0)) {
141141
return 0;
142142
}
143-
return (($pathname{0} === '/') ? 1 : 0);
143+
return (($pathname[0] === '/') ? 1 : 0);
144144
}
145145

146146
/**

0 commit comments

Comments
 (0)