try { $backupFolName = date('MY'); $backupFolder = $backupPath . $folder->getLocationFolder() . "/" . $folder->getActualName() . "/" . $backupFolName; if (!is_dir($backupFolder)) { mkdir($backupFolder, 0777, true); } } catch (Exception $e) { echo "\n Exception occured backfolder creation -" . $e->getMessage(); } //backup folder creation ends.. echo "\n Files found in folder " . $filespath . "(" . $folder->getSeq() . ") ->> Parsing now"; $message = ""; foreach ($files as $value) { //backup file in a separate location try { $bkfilespath = $backupFolder . "/" . FileSystemUtils::getFileName($value); copy($value, $bkfilespath); } catch (Exception $e) { echo "\n Exception occured backingup file -" . $e->getMessage(); } //backup file ends here echo "\nNow Processing: " . $value; $fileNameTotalCount = strlen($value); $fileType = substr($value, $fileNameTotalCount - 3, 3); if (strtoupper($fileType) == "CFG") { ConfigurationParsing($value, $folder); continue; } if (strtoupper($fileType) == "WQD" || strtoupper($fileType) == "TXT" || strtoupper($fileType) == "WAD" || strtoupper($fileType) == "LSI") { echo "\n" . date("Y-m-d H:i:s") . " Parsing " . $fileType . " file " . $value; $WQDDataArray = null;