-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload live reports from test suite run a70593e
- Loading branch information
1 parent
3f0a18a
commit cd6baba
Showing
328 changed files
with
3,377 additions
and
3,250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<?php | ||
define('TIME_START', microtime(true)); | ||
const VERSION = 'v1.0.0-rc.4'; | ||
const RUNNING_IN_CONSOLE = PHP_SAPI === 'cli'; | ||
ob_start(); | ||
|
||
if (RUNNING_IN_CONSOLE) { | ||
file_put_contents('php://stdout', 'Generating directory listing... '); | ||
} | ||
|
||
// Only the script directory | ||
$path = getcwd(); | ||
|
||
$pathlabel = file_exists('.dl-pathlabel') ? file_get_contents('.dl-pathlabel') : $path ; | ||
|
||
// Full path (when running from server) | ||
//$path = trim(getcwd() . str_replace('/', DIRECTORY_SEPARATOR, $_SERVER['REQUEST_URI']), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; | ||
|
||
$img = [ | ||
'blank.gif' => 'data:image/gif;base64,R0lGODlhFAAWAKEAAP///8z//wAAAAAAACH+TlRoaXMgYXJ0IGlzIGluIHRoZSBwdWJsaWMgZG9tYWluLiBLZXZpbiBIdWdoZXMsIGtldmluaEBlaXQuY29tLCBTZXB0ZW1iZXIgMTk5NQAh+QQBAAABACwAAAAAFAAWAAACE4yPqcvtD6OctNqLs968+w+GSQEAOw==', | ||
'unknown.gif' => 'data:image/gif;base64,R0lGODlhFAAWAMQAAExMTN3d3bW1tZmZmWZmZv///8zMzHl5ee/v762trb29vWZmZoyMjKWlpdbW1ubm5vf391paWsPDw3Nzc4WFhVRUVP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUUABYALAAAAAAUABYAAAXdoKAoQp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.gif' => 'data:image/gif;base64,R0lGODlhFAAWAPYAABkLC7y8vHFxccwAAJkAAEVBQfVBQWYAAKejo97e3pkzM4yMjDUfH9MzM6hzc2EoKGZmZkIDA7YAANbW1uVRUebm5tcbG5ZQULUfH+94eMzMzE9PT5mZmfYoKP9aWrW1tTswMDgWFndra40AALoPD+F3dykcHI59fe/v73g4ON8LC+kjI8hJSZWPj4IAACMPD/g4OGNBQeNKSug8PGBTU00kJPBtbcXFxaeMjK2trXwBAZlmZrNERK4AADMAAIN8fP9UVMEJCU47O14AAJ50dMcYGI1hYfIpKfIaGv5LS+AREU4/P/8zM1dXV3IAAPRMTOUwMLR0dFEBAYg2NnRTU/9mZnt7e/QkJKQAAP1CQjsrK/V1dVEsLFUxMYeHh6kFBWYzM7IqKsQQEIyGhmFNTVJMTCgPD8AAANsXF0I1NXxtbekLC/89PekODvE6OllQUK6KisMICNQMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUUAHMALAAAAAAUABYAAAf/gHOCg4SFhoYcHDcVjCiHhhMFMWUtEwmMj4MoGlRhD0s5lo6Zmx9CKxhdlZeZc4xjKVckL6ujh4ycDUhfDAiWpAkaHBdHKgdlixWFlyi4H0YwShIhvgmanAuXljkOBtJSEIuCFTc7U1Y36dwlT2hnOmkfE67PFApNImpqURlV7RIutMgjB2cLEAM8WMg46MHDDDE9DoAIhYCIDX9Z2GjcCKXIFwIRwuXKmLGDSVQQsYxwQivAhBZgmJxUIadmD5UrAYgM9oOLhTUDJAjFOcSHCQEIXOLqGUcHgBdQn4KAkEhpM54AwC3wsjVpDqWsXE244cVMk68fXKYTZUusMEUaC+Jqw2ToKlu6hgIBADs=', | ||
]; | ||
|
||
function run() { | ||
global $path; | ||
foreach (glob($path . DIRECTORY_SEPARATOR .'*') as $file) { | ||
// ignore dotfiles | ||
if (substr(basename($file), 0, 1) === '.') { | ||
continue; | ||
} | ||
makeRow($file); | ||
} | ||
} | ||
|
||
function makeRow($file) { | ||
global $img; | ||
$filename = basename($file) . (is_dir($file) ? '/' : ''); | ||
$ext = pathinfo($file, PATHINFO_EXTENSION); | ||
$size = is_dir($file) ? ' - ' : formatFileSize(filesize($file)); | ||
$date = date('Y-m-d H:i', filemtime($file)); | ||
$time = date('c', filemtime($file)); | ||
|
||
$icon = $img['unknown.gif']; | ||
$alt = '[ ]'; | ||
if (is_dir($file)) { | ||
$icon = $img['folder.gif']; | ||
$alt = '[DIR]'; | ||
} | ||
if (is_file($file)) { | ||
// if image | ||
if (in_array($ext, ['gif', 'jpg', 'jpeg', 'png', 'bmp'])) { | ||
$icon = $img['image2.gif']; | ||
$alt = '[IMG]'; | ||
} | ||
// if video | ||
if (in_array($ext, ['mp3', 'wav', 'ogg', 'flac', 'aac', 'wma', 'm4a', 'mp4', 'avi', 'mkv', 'wmv', 'mpg', 'mpeg', 'mov', 'flv', '3gp', 'm4v'])) { | ||
$icon = $img['movie.gif']; | ||
$alt = '[VID]'; | ||
} | ||
// if text | ||
if (in_array($ext, ['txt', 'md', 'markdown', 'php', 'html', 'css', 'js', 'json', 'xml', 'ini', 'sql', 'log', 'htaccess', 'htpasswd', 'htgroup', 'htdigest', 'sh', 'bat', 'cmd', 'c', 'cpp', 'h', 'hpp', 'java', 'py', 'pl', 'rb', 'sh', 'sql', 'yml', 'yaml', 'json', 'toml', 'xml', 'csv', 'tsv', 'xls', 'xlsx', 'doc', 'docx', 'ppt', 'pptx', 'pdf', 'epub', 'mobi'])) { | ||
$icon = $img['text.gif']; | ||
$alt = '[TXT]'; | ||
} | ||
} | ||
$row = <<<HTML | ||
<tr> | ||
<td valign="top"><img src="$icon" alt="$alt"></td> | ||
<td><a href="$filename">$filename</a></td> | ||
<td align="right"><time datetime="$time">$date</time></td> | ||
<td align="right">$size</td> | ||
<td> </td> | ||
</tr> | ||
HTML; | ||
echo ' '. str_replace(PHP_EOL, '', $row) . PHP_EOL; | ||
} | ||
|
||
function formatFileSize($int) { | ||
if ($int < 1024) { | ||
return $int . ' B'; | ||
} elseif ($int < 1048576) { | ||
return round($int / 1024, 2) . ' kB'; | ||
} elseif ($int < 1073741824) { | ||
return round($int / 1048576, 2) . ' MB'; | ||
} else { | ||
return round($int / 1073741824, 2) . ' GB'; | ||
} | ||
} | ||
|
||
function getAddress() { | ||
$version = VERSION; | ||
$os = PHP_OS; | ||
$php = PHP_VERSION; | ||
$date = date('Y-m-d H:i:s T'); | ||
$time = date('c'); | ||
$processingTime = number_format((microtime(true) - TIME_START) * 1000, 2); | ||
return <<<HTML | ||
directory-listing.php/$version <small>($os) PHP/$php compiled at <time datetime="$time">$date</time> in {$processingTime}ms</small> | ||
HTML; | ||
} | ||
|
||
?> | ||
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'> | ||
<html lang="en"><head><title>Index of <?php echo(htmlspecialchars($pathlabel))?></title><meta name="robots" content="noindex"></head><body> | ||
<h1>Index of <?php echo(htmlspecialchars($pathlabel))?></h1> | ||
<table> | ||
<thead><tr><th valign="top"><img src="<?php echo $img['blank.gif'] ?>" alt="[ICO]"><th>Name</th><th>Last modified</th><th>Size</th><th>Description</th></tr><tr><th colspan="5"><hr></th></tr></thead> | ||
<tbody> | ||
<tr><td valign="top"><img src="<?php echo $img['back.gif'] ?>" alt="[PARENTDIR]"></td><td><a href="../">Parent Directory</a></td><td> </td><td align="right"> - </td><td> </td></tr> | ||
<?php run() ?> | ||
</tbody> | ||
<tfoot><tr><th colspan="5"><hr></th></tr></tfoot> | ||
</table> | ||
<address><?php echo getAddress() ?></address> | ||
</body></html> | ||
<?php | ||
file_put_contents('index.html', (RUNNING_IN_CONSOLE ? ob_get_clean() : ob_get_flush())); | ||
|
||
if (RUNNING_IN_CONSOLE) { | ||
file_put_contents('php://stdout', 'Done! Finished in ' . number_format((microtime(true) - TIME_START) * 1000, 2) .'ms.' . PHP_EOL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hydephp/develop/master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# CI/CD generated reports for [14bf7493cdf73a837b25b7c3843544ee7cfa0f45](https://github.com/hydephp/develop/commit/14bf7493cdf73a837b25b7c3843544ee7cfa0f45) | ||
# CI/CD generated reports for [a70593e81cb8ff8830b53d6c39d47c02f386ee1f](https://github.com/hydephp/develop/commit/a70593e81cb8ff8830b53d6c39d47c02f386ee1f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.