|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help
lists.php.net
Date: Tue Mar 04 2008 - 00:25:15 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 4 Mar 2008 06:25:15 -0000 Issue 5328
Topics (messages 270859 through 270895):
Re: Pear => Host?
270859 by: Daniel Brown
Re: Weird Zend IDE Issue
270860 by: Jochem Maas
270864 by: Richard Lynch
270865 by: Jochem Maas
270866 by: Samuel Vogel
270869 by: Steve Finkelstein
270872 by: Sancar Saran
270873 by: Steve Finkelstein
Re: Weird Results from Curl
270861 by: Richard Lynch
Re: php with modified version of sqlite
270862 by: Richard Lynch
Re: Can PHP do this? -- w/o using event handler
270863 by: Richard Lynch
270887 by: Louie Miranda
Re: Making sure an include file works
270867 by: Richard Lynch
PHP performance
270868 by: Thiago Pojda
270870 by: Eric Butera
270871 by: Thiago Pojda
270876 by: Aschwin Wesselius
270882 by: Chris
270890 by: Eric Butera
270892 by: Chris
270893 by: Eric Butera
270894 by: Chris
[RFC] Replace the flex-based scanner with an re2c [1] based lexer
270874 by: Marcus Boerger
Making an interactive RGB color picker
270875 by: Keikonium
270877 by: Shawn McKenzie
270878 by: Shawn McKenzie
270879 by: Daniel Brown
Good PHP/MySql starter book?
270880 by: JJB
270881 by: Wolf
Fatal error: Call to a member function web_order_change() on a non-object
270883 by: Ben Edwards
270884 by: Chris
270885 by: Ben Edwards
270886 by: Chris
270889 by: Jim Lucas
imap_setflags_full Seen
270888 by: Richard Lynch
Crop part of existing pdf
270891 by: gary liang
270895 by: Brady Mitchell
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Mon, Mar 3, 2008 at 10:18 AM, <movies
biblescramble.com> wrote:
> >yikes, php4 !? if they dont host php5 that could be reason enough to
> switch, >*ducks*.
>
> My host would charge $60 for a year, which includes PHP and MySQL. I am
> VERY open to suggestions. It would be handy to be at the same place as one
> or more of you guys. That would sure eliminate one layer of obscurity when
> I have a question.
<plug shame="none" />
You may want to check out PilotPIg (http://www.pilotpig.net/),
which is run by one of the guys on this list, and used by a few of the
regular posters here.
</plug>
*cough* Actually, I'm the one who runs it.... ;-P
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Steve Finkelstein schreef:
> I've tried both restarting the IDE and changing font type + size in my
> preferences however this does not seem to render any effect on the
> code editor.
>
> Mind if I ask where you are changing the font so that we are on the same page?
Tools > Preferences > Colors & Fonts :: Editor Font.
"courier new" screws up the brackets for me, "courier" works.
>
> Thanks,
>
> /sf
>
>
> On 3/3/08, Jochem Maas <jochem
iamjochem.com> wrote:
>> Steve Finkelstein schreef:
>>> Hi all,
>>>
>>> I know this isn't a forum for Zend IDE, but since there's probably a
>>> decent population here using it, I figured I'd ask away.
>>>
>>> I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that
>>> all left brackets, (eg: [ ) are not showing up in the code editor. I
>>> have a screenshot of it here: http://catalyst.httpd.org/zend.png
>>>
>>> Has anyone ever experienced anything similar?
>> yes. choose a different font - at least that worked for me (you might
>> have to fiddle with font-size too).
>>
>>> Thank you,
>>>
>>> /sf
>>>
>>
>
attached mail follows:
On Sun, March 2, 2008 11:07 pm, Steve Finkelstein wrote:
> Hi all,
>
> I know this isn't a forum for Zend IDE, but since there's probably a
> decent population here using it, I figured I'd ask away.
>
> I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that
> all left brackets, (eg: [ ) are not showing up in the code editor. I
> have a screenshot of it here: http://catalyst.httpd.org/zend.png
>
> Has anyone ever experienced anything similar?
Looks to me like your monitor needs adjusting, and it's just not
showing that column of pixels.
Dink around with the little buttons on your monitor.
You could also try a different font with a fatter [ symbol if it lets
you choose font. Or even just bump the font size up by point.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Richard Lynch schreef:
> On Sun, March 2, 2008 11:07 pm, Steve Finkelstein wrote:
>> Hi all,
>>
>> I know this isn't a forum for Zend IDE, but since there's probably a
>> decent population here using it, I figured I'd ask away.
>>
>> I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that
>> all left brackets, (eg: [ ) are not showing up in the code editor. I
>> have a screenshot of it here: http://catalyst.httpd.org/zend.png
>>
>> Has anyone ever experienced anything similar?
>
> Looks to me like your monitor needs adjusting, and it's just not
> showing that column of pixels.
I think it's more a case of grubby font display in Java apps running on
Mac OS X (leopard at least).
when is the last time you saw a Mac (iMac or MacBook) with dodgy monitor settings?
>
> Dink around with the little buttons on your monitor.
>
> You could also try a different font with a fatter [ symbol if it lets
> you choose font. Or even just bump the font size up by point.
>
attached mail follows:
Richard Lynch schrieb:
> On Sun, March 2, 2008 11:07 pm, Steve Finkelstein wrote:
>
>> Hi all,
>>
>> I know this isn't a forum for Zend IDE, but since there's probably a
>> decent population here using it, I figured I'd ask away.
>>
>> I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that
>> all left brackets, (eg: [ ) are not showing up in the code editor. I
>> have a screenshot of it here: http://catalyst.httpd.org/zend.png
>>
>> Has anyone ever experienced anything similar?
>>
>
> Looks to me like your monitor needs adjusting, and it's just not
> showing that column of pixels.
>
> Dink around with the little buttons on your monitor.
>
> You could also try a different font with a fatter [ symbol if it lets
> you choose font. Or even just bump the font size up by point.
>
If it would be a problem caused by the monitor, then the screenshot
would show the brackets!
so long,
Samy
attached mail follows:
Samy is correct. I'm able to replicate this on 3 different monitors.
Also, as far as changing the Editor Font and Size in the IDE -- I need
to figure out what's setting this to a read-only property. I can't
change the Editor Font or size at this point in time.
/sf
On 3/3/08, Samuel Vogel <samy-delux
gmx.de> wrote:
> Richard Lynch schrieb:
>
> > On Sun, March 2, 2008 11:07 pm, Steve Finkelstein wrote:
> >
> >> Hi all,
> >>
> >> I know this isn't a forum for Zend IDE, but since there's probably a
> >> decent population here using it, I figured I'd ask away.
> >>
> >> I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that
> >> all left brackets, (eg: [ ) are not showing up in the code editor. I
> >> have a screenshot of it here: http://catalyst.httpd.org/zend.png
> >>
> >> Has anyone ever experienced anything similar?
> >>
> >
> > Looks to me like your monitor needs adjusting, and it's just not
> > showing that column of pixels.
> >
> > Dink around with the little buttons on your monitor.
> >
> > You could also try a different font with a fatter [ symbol if it lets
> > you choose font. Or even just bump the font size up by point.
> >
>
>
> If it would be a problem caused by the monitor, then the screenshot
> would show the brackets!
>
> so long,
> Samy
>
attached mail follows:
On Monday 03 March 2008 07:07:18 Steve Finkelstein wrote:
> Hi all,
>
> I know this isn't a forum for Zend IDE, but since there's probably a
> decent population here using it, I figured I'd ask away.
>
> I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that
> all left brackets, (eg: [ ) are not showing up in the code editor. I
> have a screenshot of it here: http://catalyst.httpd.org/zend.png
>
> Has anyone ever experienced anything similar?
>
> Thank you,
>
> /sf
Hello,
My bet was, problem on highlight syntax.
Please copy paste the text another editor if [ was there you may ecounter
syntax higlighting error
Regards
Sancar
attached mail follows:
It required creating my own 'Custom Profile' which allowed me to
manipulate the Font and/or Size. As soon as I modified those, it
worked fine.
Thanks for the assistance all. Pain in the butt issue!
/sf
On 3/3/08, Sancar Saran <sancar.saran
evodot.com> wrote:
> On Monday 03 March 2008 07:07:18 Steve Finkelstein wrote:
> > Hi all,
> >
> > I know this isn't a forum for Zend IDE, but since there's probably a
> > decent population here using it, I figured I'd ask away.
> >
> > I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that
> > all left brackets, (eg: [ ) are not showing up in the code editor. I
> > have a screenshot of it here: http://catalyst.httpd.org/zend.png
> >
> > Has anyone ever experienced anything similar?
> >
> > Thank you,
> >
> > /sf
>
>
> Hello,
>
> My bet was, problem on highlight syntax.
>
> Please copy paste the text another editor if [ was there you may ecounter
> syntax higlighting error
>
> Regards
>
>
> Sancar
>
attached mail follows:
On Fri, February 29, 2008 3:20 pm, Wolf wrote:
> I'm curling a site to process some data, all well and good but the
> results are baffling...
>
> $result = curl_exec($ch);
> curl_close($ch);
> echo "<HR>".gettype ($result);
>
> Of course that's not all the code, but the results contain:
> ---------
> 0 11
> 0 1
> 1 1
> 1 11
> 5 An Error Has Occurred During Processing.
> Error: An Error occured .
> A message has been sent to the System Administrator with the details
> of the problem you have encountered. 1
> ----
>
> What I can't seem to figure out is what the result type actually is
> and how to pull just the first piece (0,1,etc) out of the "0 11" that
> gets returned.
The result type of curl_exec should always be string, except when it
fails, when it's FALSE (bool) (Or maybe it's 0 (int) ??? rtfm)
The error message is not actually part of $result nor gettype. It is
being spewed out to stderr (pipe 2) and splatted to your terminal
screen in the middle of stdout (pipe 1) confusing you, perhaps.
I'm not sure where the 0 and 11 bit is coming from, but if you want
the first part only:
$data = (int) $result;
should get only the first portion of the integral result.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Fri, February 29, 2008 2:58 pm, Jean-Christophe Roux wrote:
> Hello,
>
> I am running php 5.1.6 on a Centos 5.0 box (installed with yum). My
> php app uses pdo_sqlite. The issue is that I am going to have to use a
> special version of sqlite with some custom functions. How do I control
> which version of sqlite, php is calling?
Use yum to remove PHP.
Compile PHP from source; No more yum.
At the ./configure stage, you can use something like:
--with-sqlite=/full/path/to/sqlite/dir/that/has/both/include/and/lib
./configure will "dig down" inside the directory looking for the
"include" dir (headers) and "lib" dir (libraries) in order to compile
in your version of sqlite.
You can also use:
--with-sqlite=shared,/usr/local
(for an example)
and then it builds the sqlite extension "shared" which means it can be
upgraded independently of PHP itself, to save a few minutes' compile
time if sqlite source changes...
This might be good if your sqlite provider is changing it often.
sqlite may be one of the extensions that can NOT be compiled as
"shared" though, for all I know.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Mon, March 3, 2008 1:57 am, Louie Miranda wrote:
> Could PHP do..
>
> 1. Connect and send a parameter to a remote host
> 2. Wait for the host to reply -- not using event handler
> 3. Send XML data to the host
<?php
$xml = file_get_contents("/path/to/file.xml");
$s = fsockopen("remote host here");
$reply = fgets($s, 1000000);
$bytes = fputs($s, $xml);
if ($bytes != ($len = strlen($xml))){
error_log("Only sent $bytes of $len bytes!");
}
?>
You'll need about 3X as much code for proper error checking, but
that's about it, really...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Thanks everyone.
I think, I will go with the sockets.
Louie
On Tue, Mar 4, 2008 at 12:36 AM, Richard Lynch <ceo
l-i-e.com> wrote:
> On Mon, March 3, 2008 1:57 am, Louie Miranda wrote:
> > Could PHP do..
> >
> > 1. Connect and send a parameter to a remote host
> > 2. Wait for the host to reply -- not using event handler
> > 3. Send XML data to the host
>
> <?php
> $xml = file_get_contents("/path/to/file.xml");
> $s = fsockopen("remote host here");
> $reply = fgets($s, 1000000);
> $bytes = fputs($s, $xml);
> if ($bytes != ($len = strlen($xml))){
> error_log("Only sent $bytes of $len bytes!");
> }
> ?>
>
> You'll need about 3X as much code for proper error checking, but
> that's about it, really...
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
>
>
--
Louie Miranda (lmiranda
gmail.com)
http://www.axishift.com
Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :)
attached mail follows:
On Thu, February 28, 2008 10:25 pm, Robert Cummings wrote:
> Doh! Time for me to start trawling the PHP site again to acquaint
> myself
> with all the new functions :) I probably would have found it though if
> searching the site's functions for syntax didn't take me directly to
> the
> documentation for soundex().
It's not a new function, really...
It's a new function that didn't work out well, and is deprecated and
only lived from PHP 5.0.0 to PHP 5.0.4
Probably not something you'll want to rely on.
Back to exec("php -l ...");
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Guys,
I've been asked to build a performance report for a PHP app. I can't profile
it using automated tools as I don't have full access to the server, only to
the application itself.
It's a PHP4 Object-Oriented app, which uses ADODB as abstraction layer with
a Oracle 8i databse. The system also uses a VB.NET socket server for some
data manipulation.
As for migrating to PHP5 I think it's crucial, but I need facts that it
really runs faster than PHP4. Anyone? :)
Any ideas on what might be the bottleneck?
Thanks guys
Atenciosamente,
<http://www.softpartech.com.br/> www.softpartech.com.br
Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
thiago.pojda
softpartech.com.br
Excelência em Softwares Financeiros
attached mail follows:
On Mon, Mar 3, 2008 at 12:09 PM, Thiago Pojda
<thiago.pojda
softpartech.com.br> wrote:
> Guys,
>
> I've been asked to build a performance report for a PHP app. I can't profile
> it using automated tools as I don't have full access to the server, only to
> the application itself.
>
> It's a PHP4 Object-Oriented app, which uses ADODB as abstraction layer with
> a Oracle 8i databse. The system also uses a VB.NET socket server for some
> data manipulation.
>
> As for migrating to PHP5 I think it's crucial, but I need facts that it
> really runs faster than PHP4. Anyone? :)
>
> Any ideas on what might be the bottleneck?
>
> Thanks guys
>
> Atenciosamente,
>
>
> <http://www.softpartech.com.br/> www.softpartech.com.br
>
>
> Thiago Henrique Pojda
> Desenvolvimento Web
> +55 41 3033-7676
> thiago.pojda
softpartech.com.br
> ExcelĂȘncia em Softwares Financeiros
>
>
>
Try and get a copy of the files and database, then set it up on your
dev machine. Then profile using Xdebug.
If you're looking for comparison numbers maybe look at:
http://sebastian-bergmann.de/archives/745-Benchmark-of-PHP-Branches-3.0-through-5.3-CVS.html
Just FYI, using ADODB will slow down the performance of your app. Any
function calls cost against you and it all adds up.
attached mail follows:
-----Mensagem original-----
De: Eric Butera [mailto:eric.butera
gmail.com]
<snip>
On Mon, Mar 3, 2008 at 12:09 PM, Thiago Pojda
<thiago.pojda
softpartech.com.br> wrote:
> Guys,
>
> I've been asked to build a performance report for a PHP app. I can't
> profile it using automated tools as I don't have full access to the
> server, only to the application itself.
>
> It's a PHP4 Object-Oriented app, which uses ADODB as abstraction
> layer with a Oracle 8i databse. The system also uses a VB.NET socket
> server for some data manipulation.
>
> As for migrating to PHP5 I think it's crucial, but I need facts that
> it really runs faster than PHP4. Anyone? :)
>
> Any ideas on what might be the bottleneck?
>
> Thanks guys
>
Try and get a copy of the files and database, then set it up on
your dev machine. Then profile using Xdebug.
If you're looking for comparison numbers maybe look at:
http://sebastian-bergmann.de/archives/745-Benchmark-of-PHP-Branc
hes-3.0-through-5.3-CVS.html
Just FYI, using ADODB will slow down the performance of your
app. Any function calls cost against you and it all adds up.
</snip>
I have a copy of the files and database, but setting it up is not that
simple. This vb.net is licensed and we don't have license for.
If I could profile the app I'd be more than happy, but that's not going to
happen anytime soon.
Thanks for those numbers, they'll be handy :)
ADODB removal will be studied, thanks for the hint!
attached mail follows:
Thiago Pojda wrote:
> Guys,
>
> I've been asked to build a performance report for a PHP app. I can't profile
> it using automated tools as I don't have full access to the server, only to
> the application itself.
>
> It's a PHP4 Object-Oriented app, which uses ADODB as abstraction layer with
> a Oracle 8i databse. The system also uses a VB.NET socket server for some
> data manipulation.
>
> As for migrating to PHP5 I think it's crucial, but I need facts that it
> really runs faster than PHP4. Anyone? :)
>
> Any ideas on what might be the bottleneck?
Hi Thiago,
I think it depends on what the application does. You can't just point
out a bottleneck just by saying which parts are used.
You can however put little timing functions here and there to measure
which part of an application is taking too long.
Like this:
$s = microtime();
do_some_stuff();
do_some_more_stuff();
$f = microtime();
echo ($f - $s)."\n";
This is very simple benchmarking and you need a lot of these steps to
really get some idea where the bottleneck could be. A good start would
be nearby query execution and results another would be with file access
or remote connections. Also good to investigate are huge loops, huge
arrays that are iterated over etc.
Do this step by step so you are sure which part you are investigating.
Otherwise you have 10 steps, 10 results and you don't know anymore where
to look.
Good luck.
Aschwin Wesselius
attached mail follows:
> Just FYI, using ADODB will slow down the performance of your app. Any
> function calls cost against you and it all adds up.
If you remove it, then you remove functionality - so before you go and
rip it out, check whether it's the bottleneck using xdebug.
I use an abstraction layer all the time and the benefits far outweigh
the 'costs'.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
On Mon, Mar 3, 2008 at 6:18 PM, Chris <dmagick
gmail.com> wrote:
>
> > Just FYI, using ADODB will slow down the performance of your app. Any
> > function calls cost against you and it all adds up.
>
> If you remove it, then you remove functionality - so before you go and
> rip it out, check whether it's the bottleneck using xdebug.
>
> I use an abstraction layer all the time and the benefits far outweigh
> the 'costs'.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
Hi Chris,
These 'benefits' you talk about really only matter if you switch your
databases. If this app is written against Oracle and they never plan
to change it, then it isn't a bad idea to cut out that fat and just
deal with the native interface. Even writing wrapper functions that
are very basic that abstract mysql_query or mssql_query end up adding
a lot of overhead over lots of requests. Look at some of the PDO
benchmarks. It is slower than the native functions too because it is
just a wrapper.
Even further if you are writing an app where you care about
performance you should be writing your SQL to the point where it
really isn't portable using all the little vendor specific features so
that you get the most out of it.
From my personal profiling most of my application time is spent in
data access. So the less layers you have there the faster it runs.
But that is just my 2cents on it. :)
attached mail follows:
> These 'benefits' you talk about really only matter if you switch your
> databases. If this app is written against Oracle and they never plan
> to change it, then it isn't a bad idea to cut out that fat and just
> deal with the native interface. Even writing wrapper functions that
> are very basic that abstract mysql_query or mssql_query end up adding
> a lot of overhead over lots of requests. Look at some of the PDO
> benchmarks. It is slower than the native functions too because it is
> just a wrapper.
Using native functions all over the place, how would you log all the
database queries that a page is running (especially if you don't have
server-level access, only ftp access - ie a clients server on a shared
host) ?
Using wrapper functions/classes it's easy to add an error_log call in to
the 'Query' method to see where everything comes from, and/or how long
each query takes to run.
Obviously that stuff is disabled by default but with a code change it's
doing what you need.
> Even further if you are writing an app where you care about
> performance you should be writing your SQL to the point where it
> really isn't portable using all the little vendor specific features so
> that you get the most out of it.
Depends on the app I guess, though I haven't seen an app that vendor
specific (apart from anything to do with full text searching).
Using xdebug is the first step to working out where your real bottleneck
is - I highly doubt it'll be the wrapper class/functions.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
On Mon, Mar 3, 2008 at 9:21 PM, Chris <dmagick
gmail.com> wrote:
>
> > These 'benefits' you talk about really only matter if you switch your
> > databases. If this app is written against Oracle and they never plan
> > to change it, then it isn't a bad idea to cut out that fat and just
> > deal with the native interface. Even writing wrapper functions that
> > are very basic that abstract mysql_query or mssql_query end up adding
> > a lot of overhead over lots of requests. Look at some of the PDO
> > benchmarks. It is slower than the native functions too because it is
> > just a wrapper.
>
> Using native functions all over the place, how would you log all the
> database queries that a page is running (especially if you don't have
> server-level access, only ftp access - ie a clients server on a shared
> host) ?
>
> Using wrapper functions/classes it's easy to add an error_log call in to
> the 'Query' method to see where everything comes from, and/or how long
> each query takes to run.
>
> Obviously that stuff is disabled by default but with a code change it's
> doing what you need.
>
>
> > Even further if you are writing an app where you care about
> > performance you should be writing your SQL to the point where it
> > really isn't portable using all the little vendor specific features so
> > that you get the most out of it.
>
> Depends on the app I guess, though I haven't seen an app that vendor
> specific (apart from anything to do with full text searching).
>
> Using xdebug is the first step to working out where your real bottleneck
> is - I highly doubt it'll be the wrapper class/functions.
>
> --
>
>
> Postgresql & php tutorials
> http://www.designmagick.com/
>
He said he can't use xdebug.
attached mail follows:
> I have a copy of the files and database, but setting it up is not that
> simple. This vb.net is licensed and we don't have license for.
>
> If I could profile the app I'd be more than happy, but that's not going to
> happen anytime soon.
What does the vb.net stuff do? Is it the frontend (eg for data-entry) or
is it used on the server-side of things?
Can you profile the php app separate to the vb.net stuff?
First step is usually the database.
Get adodb (either hack it or see if it has an on/off setting for this)
to log all of your db queries and see if any are missing indexes or need
attention.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Hello everyone,
sorry for the crosspost. But recent discussions about:
'[RFC] Replace the flex-based scanner with an re2c [1] based lexer'
revealed one big issue. During the development of said RFC we dropped
--enable-multibyte-support and interaction between engine and ext/mbstring
using declare(encoding=..). Now neither of the two is documented anywhere,
nor does any of the core developers happen to know how it works, what it is
supposed to do or how to test it.
Since we do not want to drop this feature we need some test code, best in
the form of .PHPTs. You can find information on how to write tests here:
http://qa.php.net/write-test.php and
http://talks.somabo.de/200703_montreal_need_for_testing.pdf
If you are interested in this further you are of course also more than
welcome to help in any other form. Apart from the proposal below, there
is also my blog entry to help you getting started:
http://blog.somabo.de/2008/02/php-on-re2c.html
thanks
marcus
Sunday, March 2, 2008, 11:21:34 PM, you wrote:
> RFC: REPLACE THE FLEX-BASED SCANNER WITH AN RE2C [1] BASED LEXER
> Situation:
> The current flex-based lexer depends on an outdated and unsupported flex
> version. Alternatives include either updating to a newer version of flex or
> using re2c, which we already use for a variety of things (serializing, pdo sql
> scanning, date/time parsing). While moving towards a newer flex version would
> be much easier, switching to re2c promises a much faster lexer. Actually,
> without any specific re2c optimizations we already get around a 20% scanner
> performance increase. Running the tests gets an overall speedup of 2%. It is
> arguable whether this is enough, but re2c has more advantages. First of all,
> re2c allows one to scan any type of input (ASCII, UTF-8, UTF-16, UTF-32).
> Secondly, it allows for better integration with Lemon [2], which would be the
> next step. And thirdly we can switch to a reentrant scanner.
> Current state:
> Flex has been fully replaced by re2c in Zend. We have also switched to an
> mmap-based lexer approach for now. However, we had to drop multibyte support
> as well as the encoding declare. The current state can be checked out from
> Scott's subversion repository [3] and you can follow the development on his
> Trac setup [4]. When you want to build php with re2c, then you need to grab
> re2c from its sourceforge subversion repository [5]. You can also check out
> the changes in a patch created Sunday 2nd March against a PHP checkout from
> 14th February [6].
> Further steps:
> Commit this to PHP 5.3. Synch to HEAD. Add pecl/intl to 5.3. Discuss/recreate
> multibyte support with libintl.
> Future steps:
> Replace bison with lemon in PHP 5.4 or HEAD.
> Time Frame:
> Commit to 5.3 between the 5th and the 15th of March. Synch to HEAD a couple
> of days later. Moving pecl/libintl to ext (depends on the 5.3 RMs decision).
> After that is done, decide about multibyte support. Along with the commit to
> the 5.3 branch there will be a new re2c version available.
> Marcus Boerger
> Nuno Lopes
> Scott MacVicar
> [1] http://re2c.org/
> [2] http://www.hwaci.com/sw/lemon/
> [3] svn://whisky.macvicar.net/php-re2c
> [4] http://trac.macvicar.net/php-re2c/
> [5] https://re2c.svn.sourceforge.net/svnroot/re2c/trunk/re2c
> [6] http://php.net/~helly/php-re2c-20080302.diff.txt
attached mail follows:
This may not be exactly what you think, but I didn't know how else to word
the title. I basically need to make a script that will go through every
possible color combination and print them to look just like (or similar) to
the windows color picker. I need it in the format X-Y-Z. For example:
255-255-255
255-254-254
255-253-253
What I have so far is this:
***********************
<?php
$break = print"<br>";
$n1 = "255";
$n2 = "12";
$n3 = "186";
$output = print"
\$drawrect(\$get(color_x),\$get(color_y),\$get(color_w),\$get(color_h),brushColor-$n1-$n2-$n3
penColor-$n1-$n2-$n3)
\$button2(\$get(color_x),\$get(color_y),0,0,\$get(color_w),\$get(color_h),,,PVAR:SET:colorize_global:brushcolor-$n1-$n2-$n3
pencolor-$n1-$n2-$n3,TOOLTIP:\"$n1-$n2-$n3\")
";
$output
?>
***********************
The $drawrect, $button2, and $get are NOT php functions, but to be printed
as actual text (which is why I have escaped them with the backslash).
Anyways, I thought it would be easiest to separate each R-G-B value into its
own variable ($n1, $n2, and $n3). That way I could just use some code
(regex?) to cycle through the numbers 0 to 255.
The HARD part (that I can't seem to even think of a way to make it possible)
is to change JUST the G and B values while keeping the R value at 255. Then
when the G and B values both hit 0, the R value is set to 254 and repeated
until it also hits 0 with the other two. I think (?) that will do every
possible color? I also need to print each string with the individual color
output, and I don't know how to do that either.
In short, I would like something that looks just like the windows color
picker, and when each pixel of it is clicked, it will show me the R-G-B
value in the format I would like.
If anyone understands what I am after,and could help, that would be awesome!
attached mail follows:
Keikonium wrote:
> This may not be exactly what you think, but I didn't know how else to
> word the title. I basically need to make a script that will go through
> every possible color combination and print them to look just like (or
> similar) to the windows color picker. I need it in the format X-Y-Z. For
> example:
>
> 255-255-255
> 255-254-254
> 255-253-253
>
> What I have so far is this:
>
> ***********************
> <?php
> $break = print"<br>";
> $n1 = "255";
> $n2 = "12";
> $n3 = "186";
>
> $output = print"
> \$drawrect(\$get(color_x),\$get(color_y),\$get(color_w),\$get(color_h),brushColor-$n1-$n2-$n3
> penColor-$n1-$n2-$n3)
> \$button2(\$get(color_x),\$get(color_y),0,0,\$get(color_w),\$get(color_h),,,PVAR:SET:colorize_global:brushcolor-$n1-$n2-$n3
> pencolor-$n1-$n2-$n3,TOOLTIP:\"$n1-$n2-$n3\")
> ";
>
> $output
> ?>
> ***********************
>
> The $drawrect, $button2, and $get are NOT php functions, but to be
> printed as actual text (which is why I have escaped them with the
> backslash). Anyways, I thought it would be easiest to separate each
> R-G-B value into its own variable ($n1, $n2, and $n3). That way I could
> just use some code (regex?) to cycle through the numbers 0 to 255.
>
> The HARD part (that I can't seem to even think of a way to make it
> possible) is to change JUST the G and B values while keeping the R value
> at 255. Then when the G and B values both hit 0, the R value is set to
> 254 and repeated until it also hits 0 with the other two. I think (?)
> that will do every possible color? I also need to print each string with
> the individual color output, and I don't know how to do that either.
>
> In short, I would like something that looks just like the windows color
> picker, and when each pixel of it is clicked, it will show me the R-G-B
> value in the format I would like.
>
> If anyone understands what I am after,and could help, that would be
> awesome!
There are plenty of free ones available, try:
http://www.softcomplex.com/products/tigra_color_picker/
But to answer part of your question, this will give you the over
16,000,000 million colors. Example only, I wouldn't run this :-)
for($n1 = 255; $n1 >= 0; $n1 = $n1--) {
$h1 = base_convert($n1, 10, 16);
for($n2 = 255; $n2 >= 0; $n2 = $n2--) {
$h2 = base_convert($n2, 10, 16);
for($n3 = 255; $n3 >= 0; $n3 = $n3--) {
$h3 = base_convert($n3, 10, 16);
echo "$n1-$n2-$n3 ".sprintf("#%06s\n","$h1$h2$h3");
}
}
}
This example will give you the web safe color pallet, 200 and some odd
colors:
for($n1 = 255; $n1 >= 0; $n1 = $n1 - 51) {
$h1 = base_convert($n1, 10, 16);
for($n2 = 255; $n2 >= 0; $n2 = $n2 - 51) {
$h2 = base_convert($n2, 10, 16);
for($n3 = 255; $n3 >= 0; $n3 = $n3 - 51) {
$h3 = base_convert($n3, 10, 16);
echo "$n1-$n2-$n3 ".sprintf("#%06s\n","$h1$h2$h3");
}
}
}
-Shawn
attached mail follows:
Shawn McKenzie wrote:
> Keikonium wrote:
>> This may not be exactly what you think, but I didn't know how else to
>> word the title. I basically need to make a script that will go through
>> every possible color combination and print them to look just like (or
>> similar) to the windows color picker. I need it in the format X-Y-Z. For
>> example:
>>
>> 255-255-255
>> 255-254-254
>> 255-253-253
>>
>> What I have so far is this:
>>
>> ***********************
>> <?php
>> $break = print"<br>";
>> $n1 = "255";
>> $n2 = "12";
>> $n3 = "186";
>>
>> $output = print"
>> \$drawrect(\$get(color_x),\$get(color_y),\$get(color_w),\$get(color_h),brushColor-$n1-$n2-$n3
>> penColor-$n1-$n2-$n3)
>> \$button2(\$get(color_x),\$get(color_y),0,0,\$get(color_w),\$get(color_h),,,PVAR:SET:colorize_global:brushcolor-$n1-$n2-$n3
>> pencolor-$n1-$n2-$n3,TOOLTIP:\"$n1-$n2-$n3\")
>> ";
>>
>> $output
>> ?>
>> ***********************
>>
>> The $drawrect, $button2, and $get are NOT php functions, but to be
>> printed as actual text (which is why I have escaped them with the
>> backslash). Anyways, I thought it would be easiest to separate each
>> R-G-B value into its own variable ($n1, $n2, and $n3). That way I could
>> just use some code (regex?) to cycle through the numbers 0 to 255.
>>
>> The HARD part (that I can't seem to even think of a way to make it
>> possible) is to change JUST the G and B values while keeping the R value
>> at 255. Then when the G and B values both hit 0, the R value is set to
>> 254 and repeated until it also hits 0 with the other two. I think (?)
>> that will do every possible color? I also need to print each string with
>> the individual color output, and I don't know how to do that either.
>>
>> In short, I would like something that looks just like the windows color
>> picker, and when each pixel of it is clicked, it will show me the R-G-B
>> value in the format I would like.
>>
>> If anyone understands what I am after,and could help, that would be
>> awesome!
>
>
> There are plenty of free ones available, try:
> http://www.softcomplex.com/products/tigra_color_picker/
>
> But to answer part of your question, this will give you the over
> 16,000,000 million colors. Example only, I wouldn't run this :-)
>
> for($n1 = 255; $n1 >= 0; $n1 = $n1--) {
> $h1 = base_convert($n1, 10, 16);
> for($n2 = 255; $n2 >= 0; $n2 = $n2--) {
> $h2 = base_convert($n2, 10, 16);
> for($n3 = 255; $n3 >= 0; $n3 = $n3--) {
> $h3 = base_convert($n3, 10, 16);
> echo "$n1-$n2-$n3 ".sprintf("#%06s\n","$h1$h2$h3");
> }
> }
> }
>
>
> This example will give you the web safe color pallet, 200 and some odd
> colors:
>
> for($n1 = 255; $n1 >= 0; $n1 = $n1 - 51) {
> $h1 = base_convert($n1, 10, 16);
> for($n2 = 255; $n2 >= 0; $n2 = $n2 - 51) {
> $h2 = base_convert($n2, 10, 16);
> for($n3 = 255; $n3 >= 0; $n3 = $n3 - 51) {
> $h3 = base_convert($n3, 10, 16);
> echo "$n1-$n2-$n3 ".sprintf("#%06s\n","$h1$h2$h3");
> }
> }
> }
>
> -Shawn
>
Email editing bug. The first example the loops should be $n1-- , $n2--
, $n3-- , not $n1 = $n1-- , etc...
for($n1 = 255; $n1 >= 0; $n1--) {
$h1 = base_convert($n1, 10, 16);
for($n2 = 255; $n2 >= 0; $n2--) {
$h2 = base_convert($n2, 10, 16);
for($n3 = 255; $n3 >= 0; $n3--) {
$h3 = base_convert($n3, 10, 16);
echo "$n1-$n2-$n3 ".sprintf("#%06s\n","$h1$h2$h3");
}
}
}
-Shawn
attached mail follows:
On Mon, Mar 3, 2008 at 3:13 PM, Keikonium <Keikonium
hotmail.com> wrote:
> This may not be exactly what you think, but I didn't know how else to word
> the title. I basically need to make a script that will go through every
> possible color combination and print them to look just like (or similar) to
> the windows color picker. I need it in the format X-Y-Z. For example:
>
> 255-255-255
> 255-254-254
> 255-253-253
[snip!]
This is a very Bad Idea[tm], because it's going to generate
16,777,216 lines that the browser needs to receive, parse, and
display. This is going to be over 2,516,582,400 bytes (yes, 2.5GB!)
of data to be served. There are several better ways of doing it,
including using an HTML image map that has all of the colors laid-out
by pixel coordinates, reducing the number of colors you want to
display, using Flash, or any number of alternatives.
In any case, here's the code:
<?php
if($_GET['r'] && $_GET['g'] && $_GET['b']) {
if(
!preg_match('/^[0-9]{1,3}$/',$_GET['r'])
|| !preg_match('/^[0-9]{1,3}$/',$_GET['g'])
|| !preg_match('/^[0-9]{1,3}$/',$_GET['b'])
) {
die('Incorrect parameters specified. Please try again.');
} else {
echo "You chose the following:\n";
echo "<b>R</b>: ".$_GET['r']."<br />\n";
echo "<b>G</b>: ".$_GET['g']."<br />\n";
echo "<b>B</b>: ".$_GET['b']."<br />\n";
echo "<br />\n";
}
}
$newline = 63;
for($i=255;$i>0;$i--) {
for($j=255;$j>0;$j--) {
for($k=255;$k>0;$k--) {
echo "<span
style=\"background:rgb(".$i.",".$j.",".$k.");padding:0px;height=5px;width=5px;\">";
echo "<a href=\"?r=".$i."&g=".$j."&b=".$k."\"";
echo "
style=\"color:rgb(".$i.",".$j.",".$k.");\">X</a></span>";
if($newline === 0) {
echo "<br />\n";
$newline = 63;
} else {
echo "\n";
$newline--;
}
}
}
}
?>
It's also available to view here (but the demo is limited to save
my server from Yahoo! Slurps, Google grabs, etc.):
[Demo] http://www.pilotpig.net/code-library/colorpicker.php
[Source]
http://www.pilotpig.net/code-library/source.php?f=colorpicker.php
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Hello,
Can anyone recommend a good book for getting started with PHP/MySql from
the perspective of writing some basic intranet applications?
- Joel
attached mail follows:
---- JJB <onephatcat
earthlink.net> wrote:
> Hello,
>
> Can anyone recommend a good book for getting started with PHP/MySql from
> the perspective of writing some basic intranet applications?
>
> - Joel
>
I personally found the Sam's "Teach yourself Apache, PHP, MySQL in 24 hours" as a good book to learn and keep around as a reference.
Now I have Ajax and other books sitting around with it as well as a PHP 5 Security and PHP 5 cookbook
Wolf
Wolf
attached mail follows:
Our server has just been upgraded to PHP 5.2.5 and suddenly I am
getting the following error:
Fatal error: Call to a member function web_order_change() on a
non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on
line 32
The code is:
$SESSION["cart"]->web_order_change( true );
The command 'global $SESSION;' is the first line of the script.
$SESSION is the session variable created with
session_start();
session_register("SESSION");
if ( !isset($SESSION["cart"]) ) {
$SESSION["cart"] = new Cart;
}
I am guessing this is a change in OO handling, any idea what is going
on and how to fix it?
Regards,
Ben
--
Ben Edwards - Bristol, UK
http://www.flickr.com/photos/funkytwig - have a look at my pics
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
attached mail follows:
Ben Edwards wrote:
> Our server has just been upgraded to PHP 5.2.5 and suddenly I am
> getting the following error:
>
> Fatal error: Call to a member function web_order_change() on a
> non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on
> line 32
>
> The code is:
>
> $SESSION["cart"]->web_order_change( true );
>
> The command 'global $SESSION;' is the first line of the script.
>
> $SESSION is the session variable created with
>
> session_start();
> session_register("SESSION");
>
> if ( !isset($SESSION["cart"]) ) {
> $SESSION["cart"] = new Cart;
> }
>
> I am guessing this is a change in OO handling, any idea what is going
> on and how to fix it?
I don't think it's a change in OO handling, maybe it's a change in the
error_reporting level for the new version and you hadn't noticed the
problem before.
The problem is that $SESSION['cart'] isn't an object - you'll have to
work out why.
It could be that $SESSION['cart'] is getting overridden at some point
with another type of variable.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
On 03/03/2008, Chris <dmagick
gmail.com> wrote:
> Ben Edwards wrote:
> > Our server has just been upgraded to PHP 5.2.5 and suddenly I am
> > getting the following error:
> >
> > Fatal error: Call to a member function web_order_change() on a
> > non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on
> > line 32
> >
> > The code is:
> >
> > $SESSION["cart"]->web_order_change( true );
> >
> > The command 'global $SESSION;' is the first line of the script.
> >
> > $SESSION is the session variable created with
> >
> > session_start();
> > session_register("SESSION");
> >
> > if ( !isset($SESSION["cart"]) ) {
> > $SESSION["cart"] = new Cart;
> > }
> >
> > I am guessing this is a change in OO handling, any idea what is going
> > on and how to fix it?
>
>
> I don't think it's a change in OO handling, maybe it's a change in the
> error_reporting level for the new version and you hadn't noticed the
> problem before.
Its a Fatel Error not a warning. Dont see how level off error
reporting could be relevant.
Regards,
Ben
> The problem is that $SESSION['cart'] isn't an object - you'll have to
> work out why.
>
> It could be that $SESSION['cart'] is getting overridden at some point
> with another type of variable.
>
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
--
Ben Edwards - Bristol, UK
http://www.flickr.com/photos/funkytwig - have a look at my pics
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
attached mail follows:
>> I don't think it's a change in OO handling, maybe it's a change in the
>> error_reporting level for the new version and you hadn't noticed the
>> problem before.
>
> Its a Fatel Error not a warning. Dont see how level off error
> reporting could be relevant.
Fair enough :P
What type of variable is 'cart' when this error happens?
Have permissions been screwed on the session_save_path folder? (check a
phpinfo for where this is if you're not setting it explicitly).
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Chris wrote:
>
>>> I don't think it's a change in OO handling, maybe it's a change in the
>>> error_reporting level for the new version and you hadn't noticed the
>>> problem before.
>>
>> Its a Fatel Error not a warning. Dont see how level off error
>> reporting could be relevant.
>
> Fair enough :P
>
> What type of variable is 'cart' when this error happens?
>
> Have permissions been screwed on the session_save_path folder? (check a
> phpinfo for where this is if you're not setting it explicitly).
>
Make sure that you are defining the class before you initialize the session.
I have seen this happen with others on the list, and it has sometimes been that
they are initializing the session, which tries to recreate the object, but the
actual class definition has not happened yet.
make sure you include all your classes before you initialize your session, see
if that works.
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
attached mail follows:
I am trying to use this:
imap_setflag_full($imap, $uid, "\\\\Seen", FT_UID) or die("Unable to
mark message as \\Seen");
to mark a message as "read"
It does not seem to have any effect on the return values in
imap_fetch_overview.
Nor does it appear as "read" when I view it with my email client.
The "unseen" count on the mailbox also does not decrease, which I
would expect if it was "working"
Is there some kind of trick I'm missing?
Is there some OTHER flag/function I'm supposed to be using to mark a
message as "Read"? I sure can't find it in tfm so far...
The $imap stream is valid, and I can fetch the headers and body just
fine.
The $uid is from imap_uid and, again, is used to fetch the header and
body just fine.
I've tried imap_close($imap, CL_EXPUNGE) in the hopes that it would
"write" the changes, but no such luck.
PHP 4.4.7 Hardened
Gentoo 2.6.18 hardened R6 SMP
phpinfo says IMAP c-client Version 2004 w/ SSL support enabled
Gentoo says courier-imap 4.0.6-r2 is installed, so probably using that.
The versions are out of my control, due to a security and stability
focus of this install.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Hi:
_________________________________________________________________
It's simple! Sell your car for just $30 at CarPoint.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT
attached mail follows:
On Mar 3, 2008, at 614PM, gary liang wrote:
> Is there any command line tool, which is able to crop part of pdf
> file? I ask for command line tool, because it can be used in php
> code. Any hint?
Depending on what exactly you mean by "cropping" a pdf, pdftk may be
what you need.
http://www.accesspdf.com/pdftk/
Brady
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]