function saveFile($pFileName, $pContent)
    {
        $directory = \dirname($pFileName);

        if (!\is_dir($directory)) {
            try {
                $madeDir = \mkdir($directory, 0755, TRUE);

            } catch (\Exception $err) {
                throw new \Exception("mkdir: Unable make directory '{$directory}'.");
            }
        }

        // Save data to a file.
        $fileSaved = \file_put_contents($pFileName, $pContent); //, \LOCK_EX );

        if ($fileSaved === FALSE) {
            throw new \Exception("file_put_contents: Unable to save file '{$pFileName}'.");
        }

        return $fileSaved;
    }