pixmicat

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/PMC2Prototype/ @ 378  →  /PMC2Prototype/ @ 379
/PMC2Prototype/lib/fileio/fileio.satellite.php
@@ -109,9 +109,9 @@
$this->IFS->saveIndex(); // 索引表更新
}
 
function FileIO($parameter){
require('./lib/fileio/ifs.php');
$this->IFS = new IndexFS(PMCCore_getConfig('LIB.FILEIO.INDEXLOG')); // IndexFS 物件
function FileIO($parameter, $ENV){
require($ENV['IFS.PATH']);
$this->IFS = new IndexFS($ENV['IFS.LOG']); // IndexFS 物件
$this->IFS->openIndex();
register_shutdown_function(array($this, '_setIndex')); // 設定解構元 (PHP 結束前執行)
set_time_limit(120); // 執行時間 120 秒 (傳輸過程可能很長)
/PMC2Prototype/lib/fileio/fileio.normal.php
@@ -14,13 +14,13 @@
 
/* private 藉由檔名分辨圖檔存放位置 */
function _getImagePhysicalPath($imgname){
return (substr($imgname, -5)=='s.jpg' ? $this->thumbPath : $this->imgPath).'/'.$imgname;
return (substr($imgname, -5)=='s.jpg' ? $this->thumbPath : $this->imgPath).$imgname;
}
 
function FileIO($parameter=''){
$this->path = realpath(PMCCore_getConfig('ENV.FOLDER.BOARD')).DIRECTORY_SEPARATOR;
$this->imgPath = $this->path.PMCCore_getConfig('IMG_DIR');
$this->thumbPath = $this->path.PMCCore_getConfig('THUMB_DIR');
function FileIO($parameter='', $ENV){
$this->path = $ENV['PATH'];
$this->imgPath = $this->path.$ENV['IMG'];
$this->thumbPath = $this->path.$ENV['THUMB'];
}
 
function init(){
/PMC2Prototype/lib/fileio/fileio.ftp.php
@@ -31,9 +31,9 @@
$this->IFS->saveIndex(); // 索引表更新
}
 
function FileIO($parameter){
require('./lib/fileio/ifs.php');
$this->IFS = new IndexFS(PMCCore_getConfig('LIB.FILEIO.INDEXLOG')); // IndexFS 物件
function FileIO($parameter, $ENV){
require($ENV['IFS.PATH']);
$this->IFS = new IndexFS($ENV['IFS.LOG']); // IndexFS 物件
$this->IFS->openIndex();
register_shutdown_function(array($this, '_ftp_close')); // 設定解構元 (PHP 結束前執行)
set_time_limit(120); // 執行時間 120 秒 (FTP 傳輸過程可能很長)
/PMC2Prototype/lib/fileio/ifs.php
@@ -14,7 +14,7 @@
 
/* 建構元 */
function IndexFS($logfile){
$this->logfile = PMCCore_getConfig('ENV.FOLDER.TEMP').$logfile; // 索引記錄檔位置
$this->logfile = $logfile; // 索引記錄檔位置
}
 
/* 初始化 */
/PMC2Prototype/lib/fileio/fileio.imageshack.php
@@ -89,9 +89,9 @@
$this->IFS->saveIndex(); // 索引表更新
}
 
function FileIO($parameter){
require('./lib/fileio/ifs.php');
$this->IFS = new IndexFS(PMCCore_getConfig('LIB.FILEIO.INDEXLOG')); // IndexFS 物件
function FileIO($parameter, $ENV){
require($ENV['IFS.PATH']);
$this->IFS = new IndexFS($ENV['IFS.LOG']); // IndexFS 物件
$this->IFS->openIndex();
register_shutdown_function(array($this, '_setIndex')); // 設定解構元 (PHP 結束前執行)
set_time_limit(120); // 執行時間 120 秒 (傳輸過程可能很長)
/PMC2Prototype/lib/lib_fileio.php
@@ -15,7 +15,6 @@
 
require($fileio_file);
 
 
// 擴充物件
class FileIOWrapper extends FileIO{
var $absoluteURL; // 伺服器絕對位置
@@ -36,14 +35,33 @@
function getImageTotalSize(){
$sfile = PMCCore_getConfig('ENV.FOLDER.TEMP').'sizecache.dat';
touch($sfile);
return (int)(file_get_contents($sfile) / 1024);
return file_get_contents($sfile);
}
 
// 更新圖片大小快取
function updateImageTotalSize(){
return true;
if(isset($this->IFS)){
return false; // TODO
}else{
$imgsize = 0;
foreach(glob($this->imgPath.'*') as $img){ $imgsize += filesize($img); }
foreach(glob($this->thumbPath.'*') as $img){ $imgsize += filesize($img); }
}
$fp = fopen(PMCCore_getConfig('ENV.FOLDER.TEMP').'sizecache.dat', 'w');
flock($fp, LOCK_EX);
fwrite($fp, round($imgsize / 1024));
flock($fp, LOCK_UN);
fclose($fp);
}
}
 
$returnOBJECT = new FileIOWrapper(PMCCore_getConfig('LIB.FILEIO.PARAMETER')); // FileIO 物件
$FileIOEnv = array( // FileIO 環境常數
'IFS.PATH' => './lib/fileio/ifs.php',
'IFS.LOG' => PMCCore_getConfig('ENV.FOLDER.TEMP').PMCCore_getConfig('LIB.FILEIO.INDEXLOG'),
'PATH' => realpath(PMCCore_getConfig('ENV.FOLDER.BOARD')).DIRECTORY_SEPARATOR,
'IMG' => PMCCore_getConfig('IMG_DIR').DIRECTORY_SEPARATOR,
'THUMB' => PMCCore_getConfig('THUMB_DIR').DIRECTORY_SEPARATOR
);
 
$returnOBJECT = new FileIOWrapper(PMCCore_getConfig('LIB.FILEIO.PARAMETER'), $FileIOEnv); // FileIO 物件
?>