Directories and files manipulating php script