file = WBClass::create('WBVFS_File'); $this->table = WBClass::create('WBDatasource_Table'); } public function select() { return $this->table->getIds('vfsfile'); } public function repair($id) { $this->file = $this->file->loadById($id); $oldSize = $this->file->getSize(); $size = filesize($this->file->getPath() . '.org'); if ($size == $oldSize) { echo "$id - OK $oldSize -> $size\n"; return; } echo "$id - update $oldSize -> $size\n"; $save = array( 'size' => $size ); $this->file->save($save); } } $ti = new TestRepairFileSize(); $ids = $ti->select(); foreach ($ids as $id) { $ti->repair($id); break; usleep(500); } ?>