Re: [PHP-DEV] highlight_file modification

2002-09-17 Thread Devon O'Dell

I'm still wondering about that weird little bug in the parser
that causes a newline to be added/returned at the end of the
last line.  It's really making the line numbers look stupid when
you have no blank like after the end of the script.

22: ?
23:

I do understand your issues with  i18n not being present in
Zend, although I do wonder if it'd be necessary to have a show
source function in PHP to handle i18n... it seems a bit sluggish
to make everything in a core translated.

And, in that case, the only problem I'm having is with the
extra line number :)

Oh yeah, I'm trying to write an extension for xls2xml (to
translate an Excel spreadsheet to XML, quite good actually),
but buildconf doesn't seem to be recognizing my config.m4.
I'm following the instructions as given in the ext_skel script.

Devon

Yasuo Ohgaki wrote:

 Modules are better to be independent from each
 other. Making Zend and PHP depend each other is not a good
 idea.

 Therefore, I would like to leave phps alone for now
 until Zend became fully I18N at least.

 Make sense?

 -- 
 Yasuo Ohgaki


 Devon O'Dell wrote:

 I've implemented a lot better code output in this. Would you
 like to help me implement mbfilter into this (if it's supported
 in the spoken php build) where necessary.

 The buffer code is already tweaked, I added 2 output functions
 specifically for the highlighting (just slightly modified versions
 of zend_html_puts and zend_html_putc, called
 zend_highlight_puts and zend_highlight_putc) because it just
 works better and it doesn't break anything outside the highlighting
 functions that relies on the html_put* functions.

 Currently, the page isn't even HTML compliant. That's changed
 in my patched version, I expect to complete that today.

 Anyway, later

 Devon 



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-13 Thread Devon O'Dell

What buffer and encoding stuff are you talking about?!
show_source() is an FALIAS to highlight_file() which
calls zend_highlight().  phps files via apache call
zend_highlight().

Where are you going with this?

Devon

Yasuo Ohgaki wrote:

 phps may not work under Apache 1.3.x also.
 Any addition to phps does not worth the effort.

 People should use show_source() etc instead of
 phps.



 It works under some condition, but it's not on some
 configuration/usage. Buffer and encoding is the cause
 of malfunction.

 Therefore, I recommend use of show_source() instead of
 phps.

 -- 
 Yasuo Ohgaki



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-13 Thread Devon O'Dell

Hm, actually...

I have gotten everything working *except* there is one weird little 
thing that happens with indenting for some token types because of the 
way that I have my output ordered.  The reason for this is because I 
cannot (don't want to) call zend_html_puts() with an additional 
argument... which would break some other functions that call 
zend_html_puts() (namely in info.c).

Actually, the problem is in zend_html_putc() - in the previous version, 
it could just find \n and replace it with a br /, but it's a bit 
different with tables.

It is a huge problem if I just write my own version of these two 
functions to separate the highlighting functions from the generic 
zend_html_put*() functions (because there's a ton more of the same code 
than there would be if I just added an additional argument to the functions)

I'm thinking the *BEST* thing i can do is just add an extra variable to 
the zend_html_puts() and zend_html_putc() and fix the info.c and main.c 
and basic_functions.c (I think thats the only place where other calls 
occur) to call the function with a define to specify normal output. 
 This would be faster/easier/better.  I just wanted to make sure this 
would be a good idea before changing stuff in these files.

:\

Other ideas?

Devon


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-12 Thread Devon O'Dell

Tables work a *lot* better for aligning the text.  Otherwise, how many 
spaces are you going to pad line numbers with?  6?  No matter how 
rediculous it seems, I know a person with a 1 million+ line script 
(though I have absolutely no clue what it does).

IMHO, tables just allow for much better output than spaces.

Devon

Tom Sommer wrote:

[EMAIL PROTECTED] [EMAIL PROTECTED] wrote
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  

Output from show_source using the current patch can be found at

http://www.dapond.net/code/bleh.html



Don't use tables.. use HTML spaces instead, like the current show_source

--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



  





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-12 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:
 On Thu, 12 Sep 2002, Yasuo Ohgaki wrote:
 
 
Tom Sommer wrote:

Devon O'Dell [EMAIL PROTECTED] wrote in
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


Maybe, but then we're assuming Apache ;)


.phps does not work on IIS


phps may not work under Apache 1.3.x also.
Any addition to phps does not worth the effort.

People should use show_source() etc instead of
phps.
 
 
 Why are you keep advertising this? .phps works just fine (with Apache).
 

It works under some condition, but it's not on some
configuration/usage. Buffer and encoding is the cause
of malfunction.

Therefore, I recommend use of show_source() instead of
phps.

--
Yasuo Ohgaki



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Marcus Börger

At 13:47 11.09.2002, Devon O'Dell wrote:
Hey,

I don't know if this has been brought up before (you can smack me, I know 
that's the 3rd time I've said this), but something I (and others) thought 
would be cool is line numbering for highlight_file (aka show_source).

However i like this idea.

I've made modifications so that this feature is settable from php.ini 
(highlight.format, either 0 or 1) and tested my source, looks like it 
works fine and the only stuff that didn't work in make test was stuff 
where the EXPECT was wrong.

There shouldn't be any problem with the tests because the default should 
stay the same as it is now.
When you want to test your ini settings you can either use normal ini 
functions or the newly introduced
--INI-- section in the .phpt files.

marcus

I guess I'm waiting for karma, lemme know if I should submit the patches 
in another email.

Devon


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Dan Hardiker

[..]
 something I (and others) thought would be cool is line numbering
 for highlight_file (aka show_source).
[..]
 Devon

+1 from me

Line numbering on show_source output is always useful! Especially when in
a chat room your debugging someone elses code and you have to refer to
that if statement halfway down the page heh.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Alan Knowles

I know it's a bit of a radical suggestion, but would depreciating 
highlight_string in favour of a pear package using the tokenizer not be 
a better approach.

is there any reason to keep this in C?

Anyway, just throwing a few stones into the water

Regards
Alan
 



Devon O'Dell wrote:

 Hey,

 I don't know if this has been brought up before (you can smack me, I 
 know that's the 3rd time I've said this), but something I (and others) 
 thought would be cool is line numbering for highlight_file (aka 
 show_source).

 I've made modifications so that this feature is settable from php.ini 
 (highlight.format, either 0 or 1) and tested my source, looks like it 
 works fine and the only stuff that didn't work in make test was stuff 
 where the EXPECT was wrong.

 I guess I'm waiting for karma, lemme know if I should submit the 
 patches in another email.

 Devon






-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Edin Kadribasic

On Wed, 11 Sep 2002 13:47:56 +0200
Devon O'Dell [EMAIL PROTECTED] wrote:
 Hey,
 
 I don't know if this has been brought up before (you can smack me, I 
 know that's the 3rd time I've said this), but something I (and others)
 
 thought would be cool is line numbering for highlight_file (aka 
 show_source).
 
 I've made modifications so that this feature is settable from php.ini 
 (highlight.format, either 0 or 1) and tested my source, looks like it 
 works fine and the only stuff that didn't work in make test was stuff 
 where the EXPECT was wrong.

Please let's not add an ini setting for every little thing. It makes
writing portable scripts very difficult.

I think that it would be preferrable to add an optional parameter to the
exisiting function, or make a new function.

Edin

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Marcus Börger

At 14:35 11.09.2002, Alan Knowles wrote:
I know it's a bit of a radical suggestion, but would depreciating 
highlight_string in favour of a pear package using the tokenizer not be a 
better approach.

is there any reason to keep this in C?

Highliting is a feature from the parser and the php function is only a 
wrapper for the
C functions used to implement that. Makes +1 from me for the modifucation 
and of
cause for NOT removing it.


Anyway, just throwing a few stones into the water

Regards
Alan



Devon O'Dell wrote:

Hey,

I don't know if this has been brought up before (you can smack me, I know 
that's the 3rd time I've said this), but something I (and others) thought 
would be cool is line numbering for highlight_file (aka show_source).

I've made modifications so that this feature is settable from php.ini 
(highlight.format, either 0 or 1) and tested my source, looks like it 
works fine and the only stuff that didn't work in make test was stuff 
where the EXPECT was wrong.

I guess I'm waiting for karma, lemme know if I should submit the patches 
in another email.

Devon





--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DEV] highlight_file modification

2002-09-11 Thread BUSTARRET, Jean-Francois

+1 For me for a new parameter

Jean-François Bustarret
[EMAIL PROTECTED]
 

-Message d'origine-
De : Edin Kadribasic [mailto:[EMAIL PROTECTED]]
Envoyé : mercredi 11 septembre 2002 14:39
À : Devon O'Dell
Cc : [EMAIL PROTECTED]
Objet : Re: [PHP-DEV] highlight_file modification


On Wed, 11 Sep 2002 13:47:56 +0200
Devon O'Dell [EMAIL PROTECTED] wrote:
 Hey,
 
 I don't know if this has been brought up before (you can smack me, I 
 know that's the 3rd time I've said this), but something I (and others)
 
 thought would be cool is line numbering for highlight_file (aka 
 show_source).
 
 I've made modifications so that this feature is settable from php.ini 
 (highlight.format, either 0 or 1) and tested my source, looks like it 
 works fine and the only stuff that didn't work in make test was stuff 
 where the EXPECT was wrong.

Please let's not add an ini setting for every little thing. It makes
writing portable scripts very difficult.

I think that it would be preferrable to add an optional parameter to the
exisiting function, or make a new function.

Edin

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread derick

On Wed, 11 Sep 2002, Edin Kadribasic wrote:

 Please let's not add an ini setting for every little thing. It makes
 writing portable scripts very difficult.
 
 I think that it would be preferrable to add an optional parameter to the
 exisiting function, or make a new function.

+1, I'd go for an extra option though...

Derick

---
 Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
 Frequent ranting: http://www.derickrethans.nl/
---
 PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Devon O'Dell

Rewriting the function so that it had an optional parameter for line 
numbering (or not line numbering) would also reduce the file size of the 
patch.  I agree this may be a better approach for highlight_file; 
however, .phps files use this same function... there isn't another way 
to set it for a phps (unless you create an ini setting).

The other option is just making it work with line numbering regardless. 
This won't break any scripts, just make them have line numbers instead.

Devon

Edin Kadribasic wrote:

 On Wed, 11 Sep 2002 13:47:56 +0200
 Devon O'Dell [EMAIL PROTECTED] wrote:
  

 Hey,

 I don't know if this has been brought up before (you can smack me, I 
 know that's the 3rd time I've said this), but something I (and others)

 thought would be cool is line numbering for highlight_file (aka 
 show_source).

 I've made modifications so that this feature is settable from php.ini 
 (highlight.format, either 0 or 1) and tested my source, looks like it 
 works fine and the only stuff that didn't work in make test was stuff 
 where the EXPECT was wrong.
   


 Please let's not add an ini setting for every little thing. It makes
 writing portable scripts very difficult.

 I think that it would be preferrable to add an optional parameter to the
 exisiting function, or make a new function.

 Edin

  





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Tom Sommer

Devon O'Dell [EMAIL PROTECTED] wrote in
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 The other option is just making it work with line numbering regardless.
 This won't break any scripts, just make them have line numbers instead.

This is not a good idea, many may find line-numbers useless in some
cases/scripts...
I agree that it would be an great idea to make it an optional parameter, and
NOT in the ini file :)

This applies in both highligt_file, show_source and highlight_string

--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Devon O'Dell

It applies also to .phps files, where enabled.

Devon

Tom Sommer wrote:

Devon O'Dell [EMAIL PROTECTED] wrote in
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  

The other option is just making it work with line numbering regardless.
This won't break any scripts, just make them have line numbers instead.



This is not a good idea, many may find line-numbers useless in some
cases/scripts...
I agree that it would be an great idea to make it an optional parameter, and
NOT in the ini file :)

This applies in both highligt_file, show_source and highlight_string

--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Dan Hardiker

 The other option is just making it work with line numbering
 regardless. This won't break any scripts, just make them have line
 numbers instead.

 This is not a good idea, many may find line-numbers useless in some
 cases/scripts...
 I agree that it would be an great idea to make it an optional parameter,
 and NOT in the ini file :)

 This applies in both highligt_file, show_source and highlight_string

I disagree entirely. In many cases, line-numbers are invalible to
assisting people / even reading source code on multiple pages. If the
attempt of showing the source and syntax highlighting it is to give a
read-only in editor feel, how many people work with line numbers
switched off now-a-days (but agreed, this is down to personal preference).

I believe the default should be its current behaviour (for backward
compatability, and to prevent unexpected change)... but I do think there
should be an ini option so that .phps files can have this functionality.

Real world example:

A user comes into one of my help channels and screams my script aint
working, whats wrong. Instead of getting them flooding the screen with
irrelevant cut's n paste's or leaving myself open to accepting files from
people I dont trust (or even know), .phps files are the quickest, easiest
and most effective way of supporting a person in this sort of scenario. In
#php on irc.dal.net, we see this kind of problem hourly, if not more
regularly than that.

Having line numbers on a .phps file would enable us to support users MUCH
better just by asking them to rename the file from .php to .phps and give
us the URL. We then say your missing a ; on line 52. Much easier than
trying to navigate them to the if halfway down the screen.

If you can think of an alternative way to enable / disable the
modifications suggested other than using a php.ini entry...  ;)

/unintentional rant

Sorry guys, but this sort of functionalty enabled in the .phps would make
my life (and anyone else who works with PHP developers) alot easier - and
benifit many. Personally I cant think of a reason *not* to have the
numbers.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Hartmut Holzgraefe

Devon O'Dell wrote:
 ... there isn't another way 
 to set it for a phps (unless you create an ini setting).

what about

   application/x-httpd-php-source-with-line-numbers

? ;)

-- 
Six Offene Systeme GmbH http://www.six.de/
i.A. Hartmut Holzgraefe
Email: [EMAIL PROTECTED]
Tel.:  +49-711-99091-77


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Devon O'Dell

Maybe, but then we're assuming Apache ;)

Devon

Hartmut Holzgraefe wrote:

 Devon O'Dell wrote:

 ... there isn't another way to set it for a phps (unless you create 
 an ini setting).


 what about

   application/x-httpd-php-source-with-line-numbers

 ? ;)



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Tom Sommer


Devon O'Dell [EMAIL PROTECTED] wrote in
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Maybe, but then we're assuming Apache ;)

.phps does not work on IIS

Maybe it should be an INI option, but the default should be off (for
backward compatability). I totally agree that this would kick ass (sorry) in
help channels where i personally hate asking So whats line 20?

The feature should be implemented in PHP, but not active by default.
It should be controlled by php.ini and this value should be overwrited by
the optional parameter in the functions.. how's that?

The only reason for even using php.ini for this, is because of phps
--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread DJ Anubis

Le Mercredi 11 Septembre 2002 14:05, Dan Hardiker a écrit :
 [..]

  something I (and others) thought would be cool is line numbering
  for highlight_file (aka show_source).

 [..]

  Devon

+1 from me


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Dan Hardiker

 The feature should be implemented in PHP, but not active by default. It
 should be controlled by php.ini and this value should be overwrited by
 the optional parameter in the functions.. how's that?

I think it should be switched on by default, if possible, because it is
only going to help support if the majority of installations (especially
hosters) switch it on. If its not switched on, its not going to help the
people in support channels because the feature wont be activated.

If anyone can give me some good reasons why having this extra
(unintrusive) feature on by default would be a problem to the majority (or
even 30%) of the PHP using population, then I might agree that it should
be defaulted to off.

Personally Im of the mind that, if it doesnt hinder you, it can only help.

 The only reason for even using php.ini for this, is because of phps

Agreed


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Sascha Cunz

hi
[...]
 I believe the default should be its current behaviour (for backward
 compatability, and to prevent unexpected change)... but I do think there
 should be an ini option so that .phps files can have this functionality.
[...]
+1 on that.

[...]
 Having line numbers on a .phps file would enable us to support users MUCH
 better just by asking them to rename the file from .php to .phps and give
 us the URL. We then say your missing a ; on line 52. Much easier than
 trying to navigate them to the if halfway down the screen.

+1, too.


 If you can think of an alternative way to enable / disable the
 modifications suggested other than using a php.ini entry...  ;)
[...]

wouldn't it be better to let the viewer decide, if line numbers should appear 
or not. This wouldn't break BC and also would not be needed to be enabled on 
any server. Maybe we could use a GET Param on this (only for the .phps's) 
like:

http://localhost/test.phps?linenumbers=0
http://localhost/test.phps?linenumbers=1

in which we would default linenumbers to zero.

Best regards
Sascha

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread [EMAIL PROTECTED]

Right now I'm going through all this mess and trying to get it so that it's
actually an XHTML 1.1 compliant output.  Right now, there's no guarantee
that it's even HTML [insert version here] compliant.

All the ini configuration is set.  I will set the ini default to the old
value.  I assume people know how to use ini_set(); and will be able to
change the behavior of this function that way if they are being hosted
somewhere they have no control over the ini.

I'll look into all the servers that support .phps and [attempt to] modify
their code so that you may use ?number=1 or whatever.  I'd like to see what
people say about this.

Additionally, if that suggestion recieves good karma, I'd like to get
general input on what I should name the variable.

I'd like to get all this fixed before I release the patch so you all don't
have to go behind me cleaning up stuff :).

Devon

Original Message:
-
From: Sascha Cunz [EMAIL PROTECTED]
Date: Wed, 11 Sep 2002 22:27:31 +0200
To: [EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED]
Subject: Re: [PHP-DEV] highlight_file modification


hi
[...]
 I believe the default should be its current behaviour (for backward
 compatability, and to prevent unexpected change)... but I do think there
 should be an ini option so that .phps files can have this functionality.
[...]
+1 on that.

[...]
 Having line numbers on a .phps file would enable us to support users MUCH
 better just by asking them to rename the file from .php to .phps and give
 us the URL. We then say your missing a ; on line 52. Much easier than
 trying to navigate them to the if halfway down the screen.

+1, too.


 If you can think of an alternative way to enable / disable the
 modifications suggested other than using a php.ini entry...  ;)
[...]

wouldn't it be better to let the viewer decide, if line numbers should
appear 
or not. This wouldn't break BC and also would not be needed to be enabled
on 
any server. Maybe we could use a GET Param on this (only for the .phps's) 
like:

http://localhost/test.phps?linenumbers=0
http://localhost/test.phps?linenumbers=1

in which we would default linenumbers to zero.

Best regards
Sascha

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



mail2web - Check your email from the web at
http://mail2web.com/ .



--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Dan Hardiker

 If you can think of an alternative way to enable / disable the
 modifications suggested other than using a php.ini entry...  ;)
 [...]

 wouldn't it be better to let the viewer decide, if line numbers should
 appear  or not. This wouldn't break BC and also would not be needed to
 be enabled on  any server. Maybe we could use a GET Param on this (only
 for the .phps's)  like:

 http://localhost/test.phps?linenumbers=0
 http://localhost/test.phps?linenumbers=1

 in which we would default linenumbers to zero.

+1 ... sounds like everyone wins. We hit maximum deployment with minimum
impact on systems that want to remain the way they are now.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Edin Kadribasic

[EMAIL PROTECTED] wrote:
 Right now I'm going through all this mess and trying to get it so that
 it's actually an XHTML 1.1 compliant output.  Right now, there's no
 guarantee that it's even HTML [insert version here] compliant.
 
 All the ini configuration is set.  I will set the ini default to the
 old value.  I assume people know how to use ini_set(); and will be
 able to change the behavior of this function that way if they are
 being hosted somewhere they have no control over the ini.

Did I miss something here? I don't remember us reaching agreement about
adding another config option.

Edin

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread [EMAIL PROTECTED]

Output from show_source using the current patch can be found at

http://www.dapond.net/code/bleh.html

This still doesn't implement the .phps?linenumbers (since that's gonna have
to do with the server module/cgi binary code) and also since nobody's (yet)
given input as to what variable name would be sufficient. 
show_line_numbers?  Headers/footers will also have to go in the server
module/cgi code to implement XHTML/1.1 for the output, since I can't think
of a way to figure out whether zend_highlight() was called from the
apache_php_module_main function (or, simply to tell whether or not it was
called from anywhere other than highlight_file/highlight_string).

Dunno.

I'm still messing around with a couple things, I want to have no floating
tags (you can see that they exist by some of the /font tags with no
font initializer)... wanna get everything perfect before I release the
patch.

So far, I think it's looking pretty good if you ask me :).

Devon

Original Message:
-
From: Dan Hardiker [EMAIL PROTECTED]
Date: Wed, 11 Sep 2002 21:36:40 +0100 (BST)
To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] highlight_file modification


 If you can think of an alternative way to enable / disable the
 modifications suggested other than using a php.ini entry...  ;)
 [...]

 wouldn't it be better to let the viewer decide, if line numbers should
 appear  or not. This wouldn't break BC and also would not be needed to
 be enabled on  any server. Maybe we could use a GET Param on this (only
 for the .phps's)  like:

 http://localhost/test.phps?linenumbers=0
 http://localhost/test.phps?linenumbers=1

 in which we would default linenumbers to zero.

+1 ... sounds like everyone wins. We hit maximum deployment with minimum
impact on systems that want to remain the way they are now.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



mail2web - Check your email from the web at
http://mail2web.com/ .



--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Tom Sommer


[EMAIL PROTECTED] [EMAIL PROTECTED] wrote
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Output from show_source using the current patch can be found at

 http://www.dapond.net/code/bleh.html

Don't use tables.. use HTML spaces instead, like the current show_source

--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Tom Sommer


Edin Kadribasic [EMAIL PROTECTED] wrote in
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Did I miss something here? I don't remember us reaching agreement about
 adding another config option.

He still has the right to make a patch if he wants to.
Currently the way to go is to make the output and then in the end, find out
how the configs for this new feature should be made...

--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread [EMAIL PROTECTED]

Hehe, it's just a local patch, I don't have CVS commit access, and I
wouldn't commit it now anyway if I did since there hasn't been any formal
discussion about it.  I've just developed it along what people have said
they thought would be nice.  Everything can easily be modified/removed as
far as ini options and such.

Additionally, that was just a little output demo.  I'm making something at
http://www.dapond.net/code/demo that will actually dynamically do that and
the patched version will be built onto that machine tomorrow (afaik).

I am only announcing my achievements, not intentions to stay in any one
place with this.

Thus, the reason I was asking how I should do it :)

Devon

Original Message:
-
From: Tom Sommer [EMAIL PROTECTED]
Date: Thu, 12 Sep 2002 00:34:39 +0200
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] highlight_file modification



Edin Kadribasic [EMAIL PROTECTED] wrote in
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Did I miss something here? I don't remember us reaching agreement about
 adding another config option.

He still has the right to make a patch if he wants to.
Currently the way to go is to make the output and then in the end, find out
how the configs for this new feature should be made...

--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



mail2web - Check your email from the web at
http://mail2web.com/ .



--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread [EMAIL PROTECTED]

Actually, sorry, i'm too tired to do the /demo thing tonight.  It'll be
compiled in tomorrow and you all can see it if you want.

Sorry for the waste of space :\

Nite,

Devon

Original Message:
-
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Wed, 11 Sep 2002 18:40:44 -0400
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] highlight_file modification


Hehe, it's just a local patch, I don't have CVS commit access, and I
wouldn't commit it now anyway if I did since there hasn't been any formal
discussion about it.  I've just developed it along what people have said
they thought would be nice.  Everything can easily be modified/removed as
far as ini options and such.

Additionally, that was just a little output demo.  I'm making something at
http://www.dapond.net/code/demo that will actually dynamically do that and
the patched version will be built onto that machine tomorrow (afaik).

I am only announcing my achievements, not intentions to stay in any one
place with this.

Thus, the reason I was asking how I should do it :)

Devon

Original Message:
-
From: Tom Sommer [EMAIL PROTECTED]
Date: Thu, 12 Sep 2002 00:34:39 +0200
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] highlight_file modification



Edin Kadribasic [EMAIL PROTECTED] wrote in
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Did I miss something here? I don't remember us reaching agreement about
 adding another config option.

He still has the right to make a patch if he wants to.
Currently the way to go is to make the output and then in the end, find out
how the configs for this new feature should be made...

--
* Tom Sommer
* http://www.tsn.dk | webmaster(a)tsn.dk
* Any sufficiently advanced bug is indistinguishable from a feature



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



mail2web - Check your email from the web at
http://mail2web.com/ .



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



mail2web - Check your email from the web at
http://mail2web.com/ .



--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Yasuo Ohgaki

Edin Kadribasic wrote:
 On Wed, 11 Sep 2002 13:47:56 +0200
 Devon O'Dell [EMAIL PROTECTED] wrote:
 
Hey,

I don't know if this has been brought up before (you can smack me, I 
know that's the 3rd time I've said this), but something I (and others)

thought would be cool is line numbering for highlight_file (aka 
show_source).

I've made modifications so that this feature is settable from php.ini 
(highlight.format, either 0 or 1) and tested my source, looks like it 
works fine and the only stuff that didn't work in make test was stuff 
where the EXPECT was wrong.
 
 
 Please let's not add an ini setting for every little thing. It makes
 writing portable scripts very difficult.
 
 I think that it would be preferrable to add an optional parameter to the
 exisiting function, or make a new function.

+1 for no more ini directives...

No more ini entry unless it is strictly required/prefered.

--
Yasuo Ohgaki


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Sascha Cunz

 http://www.dapond.net/code/bleh.html

 This still doesn't implement the .phps?linenumbers (since that's gonna have
 to do with the server module/cgi binary code) and also since nobody's (yet)
 given input as to what variable name would be sufficient.

at least SG(request_info).query_string contains the full (unparsed) query 
string at this moment. 

 show_line_numbers?  Headers/footers will also have to go in the server
 module/cgi code to implement XHTML/1.1 for the output, since I can't think
 of a way to figure out whether zend_highlight() was called from the
 apache_php_module_main function (or, simply to tell whether or not it was
 called from anywhere other than highlight_file/highlight_string).

Ignoring the use of show_source(file) currently the apache, cgi, cli, pi3web 
and servlet sapis are able to produce highlited source. None of these SAPIs 
will send correct HTML, since HTML and BODY are missing. I think, in a 
web-server environment, they should do so, shouldn't they?

But what about the CLI? I could imagine, one uses this to parse PHP-Code into 
printable form.

Anyway - after walking through all these SAPIs - one way to figure out, 
whether zend_highlight was called from highlight_file/highlight_string or not 
is:
Adding a flag to the zend_syntax_highlighter_ini-structure, initializing it to 
FALSE in php_get_highlight_struct (All SAPIs and the PHP-Function 
highlight_file etc. use this way to create it; i wonder why zend_highlight 
doesn't get this structure itself?). By setting this flag to TRUE, you can 
omit sending a header from the PHP-Functions.

I know, this is a kludge, but at least it's an option.

Sascha

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread Rick Widmer


May I suggest that for .phps you just turn line numbers on all the time,
unless someone can come up with a reason not to enable them better
than that's the way its always been.   Backwards compatibility is good
when it affects how a program runs, but in this case I just don't see a
reason not to enable line numbers.

My guess is the most common, if not the _only_ use for .phps is
displaying php source code for humans to read.  Maybe if you can find
more than one person who is pulling .phps output into a program and
parsing it then _maybe_ that might be a reason not  to turn on line
numbers all the time.

Considering the number of people the line numbers will help, I'm not sure
finding just one or two people who expect no line numbers is reason
enough not to turn it on all the time.  Like it is _so_ hard to just ignore
(or remove) them if you don't need them.

Rick


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread derick

On Thu, 12 Sep 2002, Yasuo Ohgaki wrote:

 Tom Sommer wrote:
  Devon O'Dell [EMAIL PROTECTED] wrote in
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  
 Maybe, but then we're assuming Apache ;)
  
  
  .phps does not work on IIS
  
 
 phps may not work under Apache 1.3.x also.
 Any addition to phps does not worth the effort.
 
 People should use show_source() etc instead of
 phps.

Why are you keep advertising this? .phps works just fine (with Apache).

Derick

---
 Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
 Frequent ranting: http://www.derickrethans.nl/
---
 PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread derick

On Thu, 12 Sep 2002, Tom Sommer wrote:

 
 Edin Kadribasic [EMAIL PROTECTED] wrote in
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Did I miss something here? I don't remember us reaching agreement about
  adding another config option.
 
 He still has the right to make a patch if he wants to.
 Currently the way to go is to make the output and then in the end, find out
 how the configs for this new feature should be made...

Sure he can still make that patch, but I think it's pretty simple that 
it won't be accepted then, and all the work on magic ini settings is 
just a waste of time then.

Derick

---
 Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
 Frequent ranting: http://www.derickrethans.nl/
---
 PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] highlight_file modification

2002-09-11 Thread [EMAIL PROTECTED]

With regards to the SG macro:
   forgot it was there.  Was 1am ;)  That's probably the way to test for
it, and was my impression too... a .phps should be a fully compliant HTML
page.

With regards to the ini settings:
   seems pointless and frowned upon... nobody is positive about me creating
another ini variable.  I'll just make it use an optional argument, in that
case, to preserve BC.

With regards to line numbers always displayed on .phps files instead of
some kind of BC thing:
   seems easy.

Also, I got some input outside the list that it may be useful to have an
argument that just displays the source in a couple of pre tags with no
coloring.  Apparrently this is useful for people who want to download
scripts that they're helping people with.  I personally don't see the
point, but I wanted to mention it to see if anybody else thought it was
some kind of great idea.

I'm about to head to work, and I'll draft up kind of a list of what I've
got done.

Devon

Original Message:
-
From:  [EMAIL PROTECTED]
Date: Thu, 12 Sep 2002 07:52:21 +0200 (CEST)
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] highlight_file modification


On Thu, 12 Sep 2002, Tom Sommer wrote:

 
 Edin Kadribasic [EMAIL PROTECTED] wrote in
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Did I miss something here? I don't remember us reaching agreement about
  adding another config option.
 
 He still has the right to make a patch if he wants to.
 Currently the way to go is to make the output and then in the end, find
out
 how the configs for this new feature should be made...

Sure he can still make that patch, but I think it's pretty simple that 
it won't be accepted then, and all the work on magic ini settings is 
just a waste of time then.

Derick

---
 Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
 Frequent ranting: http://www.derickrethans.nl/
---
 PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



mail2web - Check your email from the web at
http://mail2web.com/ .



--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php