[fix] wrong path for datadir and video dir
[fix] path of option.php
This commit is contained in:
parent
98817c473e
commit
c87db70f55
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ tmp
|
|||
videos
|
||||
.project
|
||||
bin/cronTask.sh
|
||||
option.php
|
|
@ -93,10 +93,10 @@ if (!empty($ci['ac']) && $ci['ac'] === 'view') {
|
|||
}
|
||||
}
|
||||
if (empty($ci['bc'])) {
|
||||
$path = 'videos/';
|
||||
$path = $GLOBALS['config']['VIDEODIR'].'/';
|
||||
} else {
|
||||
$splitBc = chunk_split($ci['bc'], 8, '/');
|
||||
$path = 'videos/'.$splitBc;
|
||||
$path = $GLOBALS['config']['VIDEODIR'].'/'.$splitBc;
|
||||
$breadcrumb = makeBreadcrumb($ci['bc'], $fullListDir);
|
||||
$nbBread = count($breadcrumb);
|
||||
}
|
||||
|
|
14
index.php
14
index.php
|
@ -6,7 +6,7 @@ date_default_timezone_set('UTC');
|
|||
|
||||
##### Default config ######
|
||||
# create option.php in #
|
||||
# datadir #
|
||||
# root folder of sovigall #
|
||||
###########################
|
||||
// Data subdirectory
|
||||
$GLOBALS['config']['DATADIR'] = 'data';
|
||||
|
@ -34,8 +34,8 @@ $GLOBALS['config']['PAGECACHE'] = 'pagecache';
|
|||
// php
|
||||
$GLOBALS['config']['DOWNLOAD_METHOD'] = 'xsendfile';
|
||||
|
||||
if(file_exists($GLOBALS['config']['DATADIR'].'/option.php')){
|
||||
require_once $GLOBALS['config']['DATADIR'].'/option.php';
|
||||
if(file_exists('option.php')){
|
||||
require_once 'option.php';
|
||||
}
|
||||
|
||||
if (get_magic_quotes_gpc()) {
|
||||
|
@ -114,7 +114,7 @@ AddType video/webm .webm
|
|||
</Files>
|
||||
XSendFile on
|
||||
Options -Indexes';
|
||||
file_put_contents($GLOBALS['config']['VIDEODIR'].'.htaccess', $videoDirHtaccess);
|
||||
file_put_contents($GLOBALS['config']['VIDEODIR'].'/.htaccess', $videoDirHtaccess);
|
||||
file_put_contents($GLOBALS['config']['CONFIG_FILE'], $data);
|
||||
$page = 'content';
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ function addDir($dir, $breadcrumb, $fullListDir) {
|
|||
$fullListDir[$dirHash] = $dir;
|
||||
$path = chunk_split($breadcrumb, 8, '/');
|
||||
file_put_contents($GLOBALS['config']['LISTDIR'], "<?php\n\$fullListDir=".var_export($fullListDir, true).";\n?>");
|
||||
if (mkdir('videos/'.$path.'/'.$dirHash)) {
|
||||
if (mkdir($GLOBALS['config']['VIDEODIR'].'/'.$path.'/'.$dirHash)) {
|
||||
return array(
|
||||
'result' => 'success',
|
||||
'fullListDir' => $fullListDir
|
||||
|
@ -221,7 +221,7 @@ function renDir($dir, $breadcrumb, $fullListDir) {
|
|||
$fullListDir[$dirHash] = $dir;
|
||||
$path = chunk_split($breadcrumb, 8, '/');
|
||||
|
||||
if (rename('videos/'.$path, 'videos/'.substr($path, 0, -9).'/'.$dirHash)) {
|
||||
if (rename($GLOBALS['config']['VIDEODIR'].'/'.$path, $GLOBALS['config']['VIDEODIR'].'/'.substr($path, 0, -9).'/'.$dirHash)) {
|
||||
unset($fullListDir[$currentDir]);
|
||||
file_put_contents($GLOBALS['config']['LISTDIR'], "<?php\n\$fullListDir=".var_export($fullListDir, true).";\n?>");
|
||||
$breadcrumb = substr($path, 0, -9).$dirHash;
|
||||
|
@ -307,7 +307,7 @@ function getVideoInfo($file, $dir, $fullListFile) {
|
|||
$file = substr($file, 0, 10);
|
||||
$postInfo = $fullListFile[$file];
|
||||
$path = chunk_split($dir, 8, '/');
|
||||
$descFile = glob("videos/".$path.$file."*.json");
|
||||
$descFile = glob($GLOBALS['config']['VIDEODIR']."/".$path.$file."*.json");
|
||||
$jsonInfo = json_decode(file_get_contents($descFile[0]));
|
||||
|
||||
$time = gmdate('H\hi\ms\s', $jsonInfo -> duration);
|
||||
|
|
Loading…
Reference in a new issue