original_string: public function create($pathname, $mode = false)
      {
          if (is_dir($pathname) || empty($pathname)) {
              return true;
          }
  
          if (!self::isAbsolute($pathname)) {
              $pathname = self::addPathElement($this->pwd(), $pathname);
          }
  
          if (!$mode) {
              $mode = $this->mode;
          }
  
          if (is_file($pathname)) {
              $this->_errors[] = sprintf('%s is a file', $pathname);
  
              return false;
          }
          $pathname = rtrim($pathname, DIRECTORY_SEPARATOR);
          $nextPathname = substr($pathname, 0, strrpos($pathname, DIRECTORY_SEPARATOR));
  
          if ($this->create($nextPathname, $mode)) {
              if (!file_exists($pathname)) {
                  $old = umask(0);
                  if (mkdir($pathname, $mode, true)) {
                      umask($old);
                      $this->_messages[] = sprintf('%s created', $pathname);
  
                      return true;
                  }
                  umask($old);
                  $this->_errors[] = sprintf('%s NOT created', $pathname);
  
                  return false;
              }
          }
  
          return false;
      }
code: public function create($pathname, $mode = false)
      {
          if (is_dir($pathname) || empty($pathname)) {
              return true;
          }
  
          if (!self::isAbsolute($pathname)) {
              $pathname = self::addPathElement($this->pwd(), $pathname);
          }
  
          if (!$mode) {
              $mode = $this->mode;
          }
  
          if (is_file($pathname)) {
              $this->_errors[] = sprintf('%s is a file', $pathname);
  
              return false;
          }
          $pathname = rtrim($pathname, DIRECTORY_SEPARATOR);
          $nextPathname = substr($pathname, 0, strrpos($pathname, DIRECTORY_SEPARATOR));
  
          if ($this->create($nextPathname, $mode)) {
              if (!file_exists($pathname)) {
                  $old = umask(0);
                  if (mkdir($pathname, $mode, true)) {
                      umask($old);
                      $this->_messages[] = sprintf('%s created', $pathname);
  
                      return true;
                  }
                  umask($old);
                  $this->_errors[] = sprintf('%s NOT created', $pathname);
  
                  return false;
              }
          }
  
          return false;
      }
code_tokens: public function create ( $ pathname , $ mode = false ) { if ( is_dir ( $ pathname ) || empty ( $ pathname ) ) { return true ; } if ( ! self :: isAbsolute ( $ pathname ) ) { $ pathname = self :: addPathElement ( $ this -> pwd ( ) , $ pathname ) ; } if ( ! $ mode ) { $ mode = $ this -> mode ; } if ( is_file ( $ pathname ) ) { $ this -> _errors [ ] = sprintf ( '%s is a file' , $ pathname ) ; return false ; } $ pathname = rtrim ( $ pathname , DIRECTORY_SEPARATOR ) ; $ nextPathname = substr ( $ pathname , 0 , strrpos ( $ pathname , DIRECTORY_SEPARATOR ) ) ; if ( $ this -> create ( $ nextPathname , $ mode ) ) { if ( ! file_exists ( $ pathname ) ) { $ old = umask ( 0 ) ; if ( mkdir ( $ pathname , $ mode , true ) ) { umask ( $ old ) ; $ this -> _messages [ ] = sprintf ( '%s created' , $ pathname ) ; return true ; } umask ( $ old ) ; $ this -> _errors [ ] = sprintf ( '%s NOT created' , $ pathname ) ; return false ; } } return false ; }
docstring: Create a directory structure recursively.
  
  Can be used to create deep path structures like `/foo/bar/baz/shoe/horn`
  
  @param string $pathname The directory structure to create. Either an absolute or relative
  path. If the path is relative and exists in the process' cwd it will not be created.
  Otherwise relative paths will be prefixed with the current pwd().
  @param int|bool $mode octal value 0755
  @return bool Returns TRUE on success, FALSE on failure
docstring_tokens: Create a directory structure recursively .