src/bulletproof.php
public function setLocation($dir = 'bulletproof', $permission = 0666)
    {
      $isDirectoryValid = $this->isDirectoryValid($dir);

      if (!$isDirectoryValid) {
        $this->error = sprintf($this->commonUploadErrors[$this->language]['ERROR_04'], $dir);
        return false;
      }

      $create = !is_dir($dir) ? @mkdir('' . $dir, (int) $permission, true) : true;

      if (!$create) {
        $this->error = sprintf($this->commonUploadErrors[$this->language]['ERROR_05'], $dir);
        return false;
      }

      $this->location = $dir;

      return $this;
    }
public function setLocation($dir = 'bulletproof', $permission = 0666)
    {
      $isDirectoryValid = $this->isDirectoryValid($dir);

      if (!$isDirectoryValid) {
        $this->error = sprintf($this->commonUploadErrors[$this->language]['ERROR_04'], $dir);
        return false;
      }

      $create = !is_dir($dir) ? @mkdir('' . $dir, (int) $permission, true) : true;

      if (!$create) {
        $this->error = sprintf($this->commonUploadErrors[$this->language]['ERROR_05'], $dir);
        return false;
      }

      $this->location = $dir;

      return $this;
    }
public function setLocation ( $ dir = 'bulletproof' , $ permission = 0666 ) { $ isDirectoryValid = $ this -> isDirectoryValid ( $ dir ) ; if ( ! $ isDirectoryValid ) { $ this -> error = sprintf ( $ this -> commonUploadErrors [ $ this -> language ] [ 'ERROR_04' ] , $ dir ) ; return false ; } $ create = ! is_dir ( $ dir ) ? @ mkdir ( '' . $ dir , ( int ) $ permission , true ) : true ; if ( ! $ create ) { $ this -> error = sprintf ( $ this -> commonUploadErrors [ $ this -> language ] [ 'ERROR_05' ] , $ dir ) ; return false ; } $ this -> location = $ dir ; return $ this ; }
Creates a location for upload storage.

@param $dir string the folder name to create
@param int $permission chmod permission

@return $this
Creates a location for upload storage .