<?php

return;

$base = getcwd();
$dirs = scandir('.');


foreach ($dirs as $dir) {
	if (substr($dir, 0, 1) === '.') continue;

	$path = $base . '/' . $dir . '/';

	if (!is_dir($path)) continue;

	var_export($path);
	print("\n");

	$files = scandir($path);
//	if (count($files) !== 4) continue;

	foreach ($files as $file) {
		if (substr($file, 0, 1) === '.') continue;

		$ext = substr($file, -5);
		if ($ext !== 'x.iso') continue;


		$name = str_replace($ext, '.iso', $file);

		print($file . "\n");
		print($name . "\n");
		//rename($path.$file, $path.$dir.$ext);

		unlink($path.$name);

		rename($path.$file, $path.$name);
	}
	print("\n");
//	break;
}


print("\n");
