Example #1
0
<?php

include './config.php';
include ROOTPATH . 'lib/pmclibrary.php';
@unlink(FILEIO_INDEXLOG);
$FileIO = PMCLibrary::getFileIOInstance();
$fio = new IndexFS(FILEIO_INDEXLOG);
$fio->openIndex();
clearstatcache();
$dirs = array(IMG_DIR, THUMB_DIR);
foreach ($dirs as $dir) {
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if ($file == "." || $file == "..") {
                continue;
            }
            $fio->addRecord($file, filesize($dir . '/' . $file), '');
        }
    }
}
$fio->saveIndex();
echo "done";
Example #2
0
 public function __construct($parameter, $ENV)
 {
     parent::__construct();
     require $ENV['IFS.PATH'];
     $this->IFS = new IndexFS($ENV['IFS.LOG']);
     $this->IFS->openIndex();
     register_shutdown_function(array($this, 'saveIndex'));
 }