BulletProof\Image::setLocation PHP Method

setLocation() public method

Creates a location for upload storage
public setLocation ( $dir = "bulletproof", integer $permission = 438 )
$dir string the folder name to create
$permission integer chmod permission
    public function setLocation($dir = "bulletproof", $permission = 0666)
    {
        if (!file_exists($dir) && !is_dir($dir) && !$this->location) {
            $createFolder = @mkdir("" . $dir, (int) $permission, true);
            if (!$createFolder) {
                $this->error = "Folder " . $dir . " could not be created";
                return;
            }
        }
        $this->location = $dir;
        return $this;
    }