File: package.php

package info (click to toggle)
php-jama 0~2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 276 kB
  • ctags: 849
  • sloc: php: 2,742; makefile: 5
file content (37 lines) | stat: -rwxr-xr-x 746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
include_once "includes/header.php";
include_once "includes/navbar.php";
?>
<p>
Source Listing:
</p>
<ul>
  <?php
  chdir("../");
  $files = glob("*.php");
  $files = array_merge($files, glob("util/*.php"));
  foreach ($files as $fileName) {
    ?>
  	<li><a href="package.php?view=<?php echo sha1($fileName);?>"><?php echo $fileName;?></a>&nbsp;-&nbsp;<?php echo date ("F d Y - g:i a", filemtime($fileName));?></li>
    <?php
  }
  ?>
</ul>
<?php
if( isset($_REQUEST['view']) ) {
	$hash = $_REQUEST['view'];
	$n = array_search($hash, array_map(sha1, $files));
	$fileName = $files[$n];
  ?>
  <hr />  
	Viewing: <?php echo $fileName;?>	
	<hr />
	<?php
	highlight_file($fileName);
	?>
	<hr />
<?php
}
include_once "includes/footer.php";	
?>