kartik\mpdf\Pdf::definePath PHP Method

definePath() protected static method

Defines a mPDF temporary path if not set
protected static definePath ( string $prop, string $dir ) : boolean
$prop string the mPDF constant to define
$dir string the directory to create
return boolean
    protected static function definePath($prop, $dir)
    {
        if (defined($prop)) {
            return;
        }
        $status = true;
        if (!is_dir($dir)) {
            $status = mkdir($dir, 0777, true);
        }
        if (!$status) {
            throw new InvalidConfigException("Could not create the folder '{$dir}' in '\$tempPath' set.");
        }
        define($prop, $dir);
    }