Changed using pathinfo function on SplFileInfo object