예제 #1
0
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);
}
// 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');
}
예제 #2
0
}
// Include the DirectoryLister class
require_once $relpa . 'tools/DirectoryLister/resources/DirectoryLister.php';
// Initialize the DirectoryLister object
$lister = new DirectoryLister();
// 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);
}
// Initialize the directory array
if (isset($_GET['dir'])) {
    $dirArray = $lister->listDirectory($_GET['dir']);
} else {
    $dirArray = $lister->listDirectory($relpa . 'libs/');
}
/* echo $relpa . 'lib/'; exit; */
// Define theme path
if (!defined('THEMEPATH')) {
    define('THEMEPATH', '/tools/DirectoryLister/resources/themes/bootstrap');
}
// Set path to theme index
$themeIndex = $relpa . 'tools/DirectoryLister/resources/themes/bootstrap/index.php';
// Initialize the theme
if (file_exists($themeIndex)) {
    include $themeIndex;
} else {
    die('ERROR: Failed to initialize theme');