protected function getDirectoryRelativeToFile($file, $input) { $path = realpath(dirname($file) . '/' . $input); return $path !== false ? $path : $input; }