".PHP_EOL." {$count}/{$total} move directory {$move['oldDir']} to {$move['newDir']} ".PHP_EOL."<--" . PHP_EOL . PHP_EOL; } else { echo " We will not rename directory {$file} ".PHP_EOL; } continue; } $filename = basename($file); $newname = Video::getPathToFile($filename); $renamed = rename($file, $newname); if ($renamed) { echo "{$count}/{$total} moved $filename to $newname" . PHP_EOL; } else { echo "{$count}/{$total} fail to move $filename to $newname" . PHP_EOL; } } ob_flush(); } echo PHP_EOL." Deleting cache ... "; ObjectYPT::deleteALLCache(); $videosDir = Video::getStoragePath(); exec("chown -R www-data:www-data {$videosDir}"); exec("chmod -R 755 {$videosDir}"); echo PHP_EOL." Done! ".PHP_EOL; die();