Thread: PHP SQL Color Syntax that is Postgresql & GPL3 Compatible?
Hi. I'm looking for an Open Source PHP code that will take plain text SQL and turn it into colorful HTML. If it could take messy code and clean up indents and such (a la SQLinForm), that would be a nice bonus. Ideally it would understand many flavors of SQL, but handling Postgresql syntax is most important. I want to include this in my own project, so it needs to be redistributable and specifically GPL3 compatible. Again ideally, it would be a standalone and fairly lightweight piece of code, rather than having to embed some monster package.
Does anyone know of such a beast? TIA for any help provided.
Ken Tanzer
--


AGENCY Software
A data system that puts you in control
(253) 245-3801
On Apr 25, 2012, at 6:57 AM, Ken Tanzer wrote: > Hi. I'm looking for an Open Source PHP code that will take plain text SQL and turn it into colorful HTML. If it couldtake messy code and clean up indents and such (a la SQLinForm), that would be a nice bonus. Ideally it would understandmany flavors of SQL, but handling Postgresql syntax is most important. I want to include this in my own project,so it needs to be redistributable and specifically GPL3 compatible. Again ideally, it would be a standalone andfairly lightweight piece of code, rather than having to embed some monster package. > > Does anyone know of such a beast? TIA for any help provided. Not stand alone, but the phpPgAdmin project colors SQL/PostgreSQL code and I believe the license is GPL. http://phppgadmin.sourceforge.net/doku.php?id=start John DeSoi, Ph.D.
I took a look. The syntax highlighting in phpPgAdmin is nicely self-contained in one file, and BSD-licensed. Unfortunately the actual highlighting is less advanced than some others. (I've gotten spoiled by vim, but suspect it's not written in PHP!) Now I'm looking at a couple of javascript options with good highlighting instead.
Thanks for the suggestion.
Ken
Ken
On Wed, Apr 25, 2012 at 4:55 AM, John DeSoi <desoi@pgedit.com> wrote:
On Apr 25, 2012, at 6:57 AM, Ken Tanzer wrote:Not stand alone, but the phpPgAdmin project colors SQL/PostgreSQL code and I believe the license is GPL.
> Hi. I'm looking for an Open Source PHP code that will take plain text SQL and turn it into colorful HTML. If it could take messy code and clean up indents and such (a la SQLinForm), that would be a nice bonus. Ideally it would understand many flavors of SQL, but handling Postgresql syntax is most important. I want to include this in my own project, so it needs to be redistributable and specifically GPL3 compatible. Again ideally, it would be a standalone and fairly lightweight piece of code, rather than having to embed some monster package.
>
> Does anyone know of such a beast? TIA for any help provided.
http://phppgadmin.sourceforge.net/doku.php?id=start
John DeSoi, Ph.D.

AGENCY Software
A data system that puts you in control
(253) 245-3801
On Apr 26, 2012, at 11:23 PM, Ken Tanzer wrote: > I took a look. The syntax highlighting in phpPgAdmin is nicely self-contained in one file, and BSD-licensed. Unfortunatelythe actual highlighting is less advanced than some others. (I've gotten spoiled by vim, but suspect it's notwritten in PHP!) Now I'm looking at a couple of javascript options with good highlighting instead. I'm not sure what your ultimate goal is, but here are a couple of open source projects where I have implemented PostgreSQLsyntax coloring. PHP/TextMate: https://github.com/desoi/pgedit-textmate Javascript/Ace: https://github.com/desoi/ace John DeSoi, Ph.D.