static function main() { $files = sys_FileSystem::readDirectory("../images"); $validimages = new _hx_array(array()); $_g = 0; while ($_g < $files->length) { $it = $files[$_g]; ++$_g; if (StringTools::endsWith($it, ".jpg") === true) { $validimages->push($it); } else { if (StringTools::endsWith($it, ".png") === true) { $validimages->push($it); } else { if (StringTools::endsWith($it, ".gif") === true) { $validimages->push($it); } } } unset($it); } php_Lib::println(haxe_Json::stringify($validimages, null)); }
static function deleteDirectory($folder, $included) { if ($folder === null || !file_exists($folder)) { return; } $path = com_wiris_util_sys_Store_2($folder, $included); $files = sys_FileSystem::readDirectory($folder); $i = 0; $_g1 = 0; $_g = $files->length; while ($_g1 < $_g) { $i1 = $_g1++; $file = $files[$i1]; $file = $path . "/" . $file; if (is_dir($file)) { com_wiris_util_sys_Store::deleteDirectory($file, $included); } else { $includedIterator = $included->iterator(); if ($included !== null) { while ($includedIterator->hasNext()) { if (StringTools::endsWith($file, $includedIterator->next())) { @unlink($file); } } } else { @unlink($file); } unset($includedIterator); } unset($i1, $file); } $files = sys_FileSystem::readDirectory($folder); if ($files->length === 0) { @rmdir($folder); } }
public function hlist() { return sys_FileSystem::readDirectory($this->file); }