Browse Source

remove folder_listing.php

master
cinnaboot 8 years ago
parent
commit
b97a117a88
  1. 80
      folder_listing.php

80
folder_listing.php

@ -1,80 +0,0 @@
<?php
/*
* This file is part of video_metadata.
*
* video_metadata is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* video_metadata is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with video_metadata. If not, see <https://www.gnu.org/licenses/>.
*/
const VIDEO_DIR = '../video/unwatched';
$contents = [];
$errors = [];
if (is_dir(VIDEO_DIR)) {
$handle = opendir(VIDEO_DIR);
if (!$handle) {
$errors[] = "error opening directory: " . VIDEO_DIR;
return;
}
while (false !== ($entry = readdir($handle))) {
if ($entry != '.' && $entry != '..')
$contents[] = $entry;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="static/default.css" />
</head>
<body>
<div id="info">
<pre>
VIDEO_DIR: "<?php echo VIDEO_DIR; ?>"
count: "<?php echo count($contents); ?>"
</pre>
</div>
<h3>errors</h3>
<div id="errors" class="debug">
<pre>
<?php
if (!empty($errors))
print_r($errors);
?>
</pre>
</div>
<div id="listing">
<?php
if (!empty($contents)) {
echo "<ul>";
foreach ($contents as $item)
echo "<li>$item</li>";
echo "</ul>";
}
?>
</div>
<h3>debug</h3>
<div class="debug">
<pre><?php print_r($contents); ?></pre>
</div>
</body>
Loading…
Cancel
Save