Skip to content

Commit a6bbc9b

Browse files
committed
Actually works on php5.3 now!!!
1 parent ca537cb commit a6bbc9b

File tree

7 files changed

+27
-6
lines changed

7 files changed

+27
-6
lines changed

.github/examples/overview.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once __DIR__ . '/../../vendor/autoload.php';
3+
require_once __DIR__ . '/../../sage.phar';
44

55
$selectedTheme = isset($_GET['theme']) ? $_GET['theme'] : 'original';
66
$allowedThemes = array();

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ build:
1818
test:
1919
$(DOCKER) run php pest
2020

21+
php53:
22+
make build
23+
docker run -it --rm --name my-running-script -v "$$PWD":/usr/src/myapp -w /usr/src/myapp \
24+
orsolin/docker-php-5.3-apache php /usr/src/myapp//tests/temp_tests/php53test.php
25+
2126

2227
update-test-snapshots:
2328
$(DOCKER) run php pest -d --update-snapshots

Sage.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
if (defined('SAGE_DIR')) {
3232
return;
3333
}
34-
3534
define('SAGE_DIR', __DIR__ . '/');
3635

3736
require SAGE_DIR . 'inc/SageVariableData.php';
@@ -488,7 +487,7 @@ public static function dump($data = null)
488487
// displayed names might be wrong, at least don't throw an error
489488
$output .= call_user_func(
490489
array($decorator, 'decorate'),
491-
SageParser::process($argument, empty($names[$k]) ? '???' : $names[$k]),
490+
SageParser::process($argument, empty($names[$k]) ? '???' : $names[$k])
492491
);
493492
}
494493
}

decorators/SageDecoratorsPlain.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SageDecoratorsPlain
88
{
99
public static $firstRun = true;
1010
private static $_enableColors;
11-
private static $levelColors = [];
11+
private static $levelColors = array();
1212

1313
public static function decorate(SageVariableData $varData, $level = 0)
1414
{
@@ -285,7 +285,7 @@ public static function wrapEnd($callee, $miniTrace, $prevCaller)
285285
$lastLine . PHP_EOL
286286
. 'Call stack ' . SageHelper::ideLink($callee['file'], $callee['line'])
287287
. $traceDisplay,
288-
'header',
288+
'header'
289289
)
290290
. $lastChar;
291291
}

inc/SageHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static function shortenPath($file)
7979
}
8080
}
8181

82-
if (strpos($file, self::$projectRootDir) === 0) {
82+
if (self::$projectRootDir && strpos($file, self::$projectRootDir) === 0) {
8383
return substr($file, strlen(self::$projectRootDir));
8484
}
8585

sage.phar

27 Bytes
Binary file not shown.

tests/temp_tests/php53test.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
// THIS FILE IS NOT PART OF SAGE, IT IS ONLY USED FOR TEMPORARY TESTING
4+
5+
/* ****
6+
php -S localhost:9876 playground.php
7+
*** */
8+
9+
//require 'vendor/autoload.php';
10+
require_once __DIR__ . '/../../sage.phar';
11+
12+
Sage::$outputFile = __DIR__ . '/../../sage.html';
13+
14+
15+
require __DIR__ . '/../../.github/examples/overview.php';
16+
17+

0 commit comments

Comments
 (0)