-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from MrMarioMichel/setup-and-play
Setup and play
- Loading branch information
Showing
40 changed files
with
1,794 additions
and
176 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,52 @@ | ||
<?php | ||
|
||
// Include the DirectoryLister class | ||
require_once('resources/DirectoryLister.php'); | ||
|
||
// Initialize the DirectoryLister object | ||
$lister = new DirectoryLister(); | ||
|
||
// Restrict access to current directory | ||
ini_set('open_basedir', getcwd()); | ||
|
||
// Return file hash | ||
if (isset($_GET['hash'])) { | ||
|
||
// Get file hash array and JSON encode it | ||
$hashes = $lister->getFileHash($_GET['hash']); | ||
$data = json_encode($hashes); | ||
|
||
// Return the data | ||
die($data); | ||
|
||
} | ||
|
||
if (isset($_GET['zip'])) { | ||
|
||
$dirArray = $lister->zipDirectory($_GET['zip']); | ||
|
||
} else { | ||
|
||
// Initialize the directory array | ||
if (isset($_GET['dir'])) { | ||
$dirArray = $lister->listDirectory($_GET['dir']); | ||
} else { | ||
$dirArray = $lister->listDirectory('.'); | ||
} | ||
|
||
// Define theme path | ||
if (!defined('THEMEPATH')) { | ||
define('THEMEPATH', $lister->getThemePath()); | ||
} | ||
|
||
// Set path to theme index | ||
$themeIndex = $lister->getThemePath(true) . '/index.php'; | ||
|
||
// Initialize the theme | ||
if (file_exists($themeIndex)) { | ||
include($themeIndex); | ||
} else { | ||
die('ERROR: Failed to initialize theme'); | ||
} | ||
|
||
} |
Oops, something went wrong.