Re: [PEPr] Comment on Text::Text_Highlighter
| From: | Andrey Demenev | Date: | Thu, 13 May 2004 11:17:52 +0000 |
| Subject: | Re: [PEPr] Comment on Text::Text_Highlighter | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-29198@lists.php.net to get a copy of this message | ||
Davey wrote:
I actually realised that after sending this, thats actually one of things I was going to change. Greg brought up that these should be objects for easier extension. But, what I would like, is that if you're only highlighting one type of code, you shouldn't need to use the factory method, you just call the syntax's own class directly. - DaveyIt can be used both ways: <?php require_once 'Text/Highlighter.php'; $hl =& Text_Highlighter::factory('PHP'); $code = file_get_contents('somefile.php'); $html = $hl->Highlight($code); echo $html; ?> <?php require_once 'Text/Highlighter/PHP.php'; $hl =& new Text_Highlighter_PHP; $code = file_get_contents('somefile.php'); $html = $hl->Highlight($code); echo $html; ?> -- Andrey Demenev aka Blindman demenev@on-line.jar.ru