public static function createDirectory($directoryToCreate, $mode = 0775, $recursive = false)
    {

        // we don't have a directory to change the user/group permissions for
        if (is_dir($directoryToCreate) === false) {
            // create the directory if necessary
            if (mkdir($directoryToCreate, $mode, $recursive) === false) {
                throw new \Exception(sprintf('Directory %s can\'t be created', $directoryToCreate));
            }
        }
    }