original_string: public function get_handler($path, array $config = array(), $content = array())
  	{
  		$path = $this->get_path($path);
  
  		if (is_file($path))
  		{
  			$info = pathinfo($path);
  
  			// deal with path names without an extension
  			isset($info['extension']) or $info['extension'] = '';
  
  			// check file extension
  			if ( ! empty($this->extensions) && ! in_array($info['extension'], $this->extensions))
  			{
  				throw new \FileAccessException('File operation not allowed: disallowed file extension.');
  			}
  
  			// create specific handler when available
  			if (array_key_exists($info['extension'], $this->file_handlers))
  			{
  				$class = '\\'.ltrim($this->file_handlers[$info['extension']], '\\');
  				return $class::forge($path, $config, $this);
  			}
  
  			return \File_Handler_File::forge($path, $config, $this);
  		}
  		elseif (is_dir($path))
  		{
  			return \File_Handler_Directory::forge($path, $config, $this, $content);
  		}
  
  		// still here? path is invalid
  		throw new \FileAccessException('Invalid path for file or directory.');
  	}
code: public function get_handler($path, array $config = array(), $content = array())
  	{
  		$path = $this->get_path($path);
  
  		if (is_file($path))
  		{
  			$info = pathinfo($path);
  
  			// deal with path names without an extension
  			isset($info['extension']) or $info['extension'] = '';
  
  			// check file extension
  			if ( ! empty($this->extensions) && ! in_array($info['extension'], $this->extensions))
  			{
  				throw new \FileAccessException('File operation not allowed: disallowed file extension.');
  			}
  
  			// create specific handler when available
  			if (array_key_exists($info['extension'], $this->file_handlers))
  			{
  				$class = '\\'.ltrim($this->file_handlers[$info['extension']], '\\');
  				return $class::forge($path, $config, $this);
  			}
  
  			return \File_Handler_File::forge($path, $config, $this);
  		}
  		elseif (is_dir($path))
  		{
  			return \File_Handler_Directory::forge($path, $config, $this, $content);
  		}
  
  		// still here? path is invalid
  		throw new \FileAccessException('Invalid path for file or directory.');
  	}
code_tokens: public function get_handler ( $ path , array $ config = array ( ) , $ content = array ( ) ) { $ path = $ this -> get_path ( $ path ) ; if ( is_file ( $ path ) ) { $ info = pathinfo ( $ path ) ; // deal with path names without an extension isset ( $ info [ 'extension' ] ) or $ info [ 'extension' ] = '' ; // check file extension if ( ! empty ( $ this -> extensions ) && ! in_array ( $ info [ 'extension' ] , $ this -> extensions ) ) { throw new \ FileAccessException ( 'File operation not allowed: disallowed file extension.' ) ; } // create specific handler when available if ( array_key_exists ( $ info [ 'extension' ] , $ this -> file_handlers ) ) { $ class = '\\' . ltrim ( $ this -> file_handlers [ $ info [ 'extension' ] ] , '\\' ) ; return $ class :: forge ( $ path , $ config , $ this ) ; } return \ File_Handler_File :: forge ( $ path , $ config , $ this ) ; } elseif ( is_dir ( $ path ) ) { return \ File_Handler_Directory :: forge ( $ path , $ config , $ this , $ content ) ; } // still here? path is invalid throw new \ FileAccessException ( 'Invalid path for file or directory.' ) ; }
docstring: Handler factory for given path
  
  @param	string				path to file or directory
  @param	array				optional config
  @return	File_Handler_File
  @throws	FileAccessException		when outside basedir restriction or disallowed file extension
docstring_tokens: Handler factory for given path