public function makeDirectoryBeforeUpload($path, $cleanDirectory = false)
    {
        if (! $this->exists($path)) {
            $this->makeDirectory($path, 0775, true);
            return true;
        }

        // tamamen silip oluşturmak istendi ise
        if (($this->exists($path) && $cleanDirectory) || (isset($this->options['is_reset']) && $this->options['is_reset'])) {
            $this->deleteDirectory($path, true);
            $this->makeDirectory($path, 0775, true, true);
            return true;
        }

        if ($this->options['relation'] !== 'hasMany' && ( ! isset($this->options['is_reset']) ||  $this->options['is_reset']) ) {
            $this->cleanDirectory($path);
        }
        return true;
    }
public function makeDirectoryBeforeUpload($path, $cleanDirectory = false)
    {
        if (! $this->exists($path)) {
            $this->makeDirectory($path, 0775, true);
            return true;
        }

        // tamamen silip oluşturmak istendi ise
        if (($this->exists($path) && $cleanDirectory) || (isset($this->options['is_reset']) && $this->options['is_reset'])) {
            $this->deleteDirectory($path, true);
            $this->makeDirectory($path, 0775, true, true);
            return true;
        }

        if ($this->options['relation'] !== 'hasMany' && ( ! isset($this->options['is_reset']) ||  $this->options['is_reset']) ) {
            $this->cleanDirectory($path);
        }
        return true;
    }
public function makeDirectoryBeforeUpload ( $ path , $ cleanDirectory = false ) { if ( ! $ this -> exists ( $ path ) ) { $ this -> makeDirectory ( $ path , 0775 , true ) ; return true ; } // tamamen silip oluşturmak istendi ise
 if ( ( $ this -> exists ( $ path ) && $ cleanDirectory ) || ( isset ( $ this -> options [ 'is_reset' ] ) && $ this -> options [ 'is_reset' ] ) ) { $ this -> deleteDirectory ( $ path , true ) ; $ this -> makeDirectory ( $ path , 0775 , true , true ) ; return true ; } if ( $ this -> options [ 'relation' ] !== 'hasMany' && ( ! isset ( $ this -> options [ 'is_reset' ] ) || $ this -> options [ 'is_reset' ] ) ) { $ this -> cleanDirectory ( $ path ) ; } return true ; }
if not exists make directory
or clean directory

@param string $path
@param boolean $cleanDirectory
@return boolean
if not exists make directory or clean directory