[fix] wrong path for datadir and video dir

[fix] path of option.php
This commit is contained in:
Knah Tsaeb 2013-08-06 10:51:56 +02:00
parent 98817c473e
commit c87db70f55
3 changed files with 13 additions and 12 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@ data
tmp
videos
.project
bin/cronTask.sh
bin/cronTask.sh
option.php

View File

@ -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);
}

View File

@ -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';
}
@ -186,9 +186,9 @@ function n_print($data, $name = '') {
<fieldset style="border: 1px solid orange; padding: 5px;color:#1E1915; background-color: #fff;">';
echo '
<legend style="border:1px solid orange;padding: 1px;background-color:#eee;color:orange;">
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
</legend>';
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
echo '
</fieldset>
<br />';
@ -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);