original_string: protected function allowCreate($dir, $name, $isDir = null) {
  		$path = $this->joinPathCE($dir, $name);
  		$perm = null;
  		
  		if ($this->access) {
  			$perm = call_user_func($this->access, 'write', $path, $this->options['accessControlData'], $this, $isDir);			
  			if ($perm !== null) {
  				return !!$perm;
  			}
  		}
  		
  		$testPath = $this->separator.$this->relpathCE($path);
  		
  		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
  			$attrs = $this->attributes[$i];
  			
  			if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
  				$perm = $attrs['write'];
  			} 
  		}
  		
  		return $perm === null ? true : $perm;
  	}
code: protected function allowCreate($dir, $name, $isDir = null) {
  		$path = $this->joinPathCE($dir, $name);
  		$perm = null;
  		
  		if ($this->access) {
  			$perm = call_user_func($this->access, 'write', $path, $this->options['accessControlData'], $this, $isDir);			
  			if ($perm !== null) {
  				return !!$perm;
  			}
  		}
  		
  		$testPath = $this->separator.$this->relpathCE($path);
  		
  		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
  			$attrs = $this->attributes[$i];
  			
  			if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
  				$perm = $attrs['write'];
  			} 
  		}
  		
  		return $perm === null ? true : $perm;
  	}
code_tokens: protected function allowCreate ( $ dir , $ name , $ isDir = null ) { $ path = $ this -> joinPathCE ( $ dir , $ name ) ; $ perm = null ; if ( $ this -> access ) { $ perm = call_user_func ( $ this -> access , 'write' , $ path , $ this -> options [ 'accessControlData' ] , $ this , $ isDir ) ; if ( $ perm !== null ) { return ! ! $ perm ; } } $ testPath = $ this -> separator . $ this -> relpathCE ( $ path ) ; for ( $ i = 0 , $ c = count ( $ this -> attributes ) ; $ i < $ c ; $ i ++ ) { $ attrs = $ this -> attributes [ $ i ] ; if ( isset ( $ attrs [ 'write' ] ) && isset ( $ attrs [ 'pattern' ] ) && preg_match ( $ attrs [ 'pattern' ] , $ testPath ) ) { $ perm = $ attrs [ 'write' ] ; } } return $ perm === null ? true : $ perm ; }
docstring: Return true if file with given name can be created in given folder.
  
  @param string $dir  parent dir path
  @param string $name new file name
  @return bool
  @author Dmitry (dio) Levashov
docstring_tokens: Return true if file with given name can be created in given folder .