[PHP] Poll: phpt or phpunit and why?

2008-02-06 Thread js
HI, When writing tests, do you use phpt or phpunit? (or another one?) Why do you use that one? Let's share the idea. I like both, but when I write simple tests, I prefer to use phpt because it's less code and easy to write. I use phpunit for tests of complex classes. I can do that with phpt, but

[PHP] Recommended ORM for PHP

2008-02-06 Thread js
Hi list, When creating a LAMP app, I always start by writing ORM myself. It's fun but it usually takes a long time. Besides, that always results in a toy-system, I mean, that has not so many features, not so efficient non-bug-free. I started to think that now is the time to throw away my rubbis

Re: [PHP] Redirecting STDERR to a file?

2008-02-02 Thread js
> > C would be the last resort. I suppose it would be easily done in Perl, > > but most of my colleagues prefer PHP. > > I love to make taking over the code easy, so PHP is more preferable to > > me. > > That makes perfect sense, but sometimes PHP is not the best/right > answer. > > What I think yo

Re: [PHP] Redirecting STDERR to a file?

2008-02-02 Thread js
Hi Per, > > nohup would work in some ways, but that's not a real daemon > > because the process will have tty, in a session and has a process > > group. I like to have a real daemon. > > Well, it depends on what you're after. Are you solving a problem or are > you doing an exercise because you ca

Re: [PHP] Redirecting STDERR to a file?

2008-02-02 Thread js
nohup would work in some ways, but that's not a real daemon because the process will have tty, in a session and has a process group. I like to have a real daemon. On Feb 2, 2008 5:25 PM, Per Jessen <[EMAIL PROTECTED]> wrote: > js wrote: > > > I was trying to write a scri

[PHP] Redirecting STDERR to a file?

2008-02-01 Thread js
Hi, I was trying to write a script in PHP that takes a program name as an argument and invoke it as a daemon. PHP provides fork(pcntl_fork), setsid(posix_setsid) and umask, so it was easy. However, I couldn't find a way to redirect STDERR a file. I like to have the daemon write its log to its o

Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-19 Thread js
Hi Jochem, Sorry, I missed "static". So, getDB() would works like singleton, right? I agree that's better method to manage dbh. On Dec 19, 2007 11:27 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > js schreef: > > That wouldn't work well when you have to update m

Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-19 Thread js
That wouldn't work well when you have to update multiple tables in a transaction. I think it's more maintainable to use GLOBALS than passing around dbh to classes/functions. On Dec 19, 2007 11:07 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > please reply to the list ... &g

Re: [PHP] Fast prefix search?

2007-10-13 Thread js
On 10/14/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > how big is your dataset; have you tested against a potential data set and > gotten > long execution times? The dataset consists of about several million lines and I've tested script like above against the dataset. it took almost a hour. (perl

Re: [PHP] Fast prefix search?

2007-10-13 Thread js
On 10/14/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > can you use the php string manipulation functions ? I'll probably use strstr() to check whether a string starts with some prefix. But problem I like to solve is how to effectively pick strings starting with a prefix from a large dataset, like

[PHP] Fast prefix search?

2007-10-13 Thread js
HI. I'm writing a script which extracts text which starts with some string. I tried to solve this by using Berkeley DB's B-tree and found that PHP provides Berkeley DB access through DBA[1] module. But , as the doc says collectly, "functionality is limited to a common subset of features" so I cou

[PHP] How can I make clean URL site with PHP?

2007-09-20 Thread js
Hi. I like clean URL site like http://del.icio.us/someone/tag (del.icio.us is powered by PHP, right?) But I have no idea how can I do it with PHP. Is this a just apache's rewrite magic? or another different technique? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

Re: [PHP] How can I get a list of object vars?

2007-08-02 Thread js
Thank you, it worked, but it contains some dust. Is it possible to remove the dust? more_var = 'val'; foreach ((array)$obj as $k => $v) echo "$k = $v\n"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How can I get a list of object vars?

2007-08-02 Thread js
Hi list. I'm trying to write a ORM in PHP. I want the ORM to have metadata mapping, which have a list of properties name and the value, without using any external file. (I like simple one, not want messy XML) I'm thinking PHP's reflective functions might help me to do that and treid get_object

Re: [PHP] Object-oriented $_REQUEST?

2007-04-28 Thread js
ray (or 4 if you include GPC and request) would become unnecessary overhead. But then again, maybe I am missing the point of this 'request' class. -Logan > -Original Message- > From: js [mailto:[EMAIL PROTECTED] > Sent: Saturday, April 28, 2007 2:56 PM > To: php-gener

[PHP] Object-oriented $_REQUEST?

2007-04-28 Thread js
Hi. I'm looking for implementation of request object that represent a request that works like this. $r = new request(); if ($r->method == 'GET') $name = $r->GET->get('name'); $age = $r->GET->get('age'); else if (request.method == 'POST') $name = $r->POST->get('name'); $age = $r->POST

Re: [PHP] sapi_add_header_ex() violating CODING_STANDARDS

2007-04-03 Thread js
Hi Jochem. On 4/3/07, Jochem Maas <[EMAIL PROTECTED]> wrote: from your explaination above one could infer that it was a transgression with regard to CS. whether you could consider it a bug would depend on whether the code in question actually caused problems or not ... the efree() at the point

[PHP] sapi_add_header_ex() violating CODING_STANDARDS

2007-04-03 Thread js
Hi list. I don't think this is the right place to talk about this, but writing PHP extensions I found that "sapi_add_header_ex()" in SAPI.c is violating a law of PHP CODING_STANDARDS, which says "[1] Functions that are given pointers to resources should not free them *snip* Exceptions: - The fu

[PHP] When to use exception, or When not to use exception

2007-02-21 Thread js
Hello list, Recently I upgraded my dev environment and started to use PHP5 at last! Compared with the former one, PHP5 rocks in many ways. So I love it so much, but sadly, I don't exactly know when to use exception. I'm never used to use Java, or languages that support exceptin so I have to learn

[PHP] Nevermind Ereg Bug

2001-11-09 Thread js
I figured out a work around. I'd still be interested if anyone else has experienced this. Josh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PRO

[PHP] Ereg Bug

2001-11-09 Thread js
I'm ready to rip my hair out! I have a form which submits to a script to generate an image using the info on the form. I am trying to center the text over the image, and this application requires the use of variable-width fonts. So I am using a very basic regex to check for an all-caps strin

[PHP] ereg question

2001-09-01 Thread js
In the Leon Atkinson Core PHP book, in his ereg example he states that ereg will only return the first match on a line. Can anyone confirm or deny this? Thanks, Josh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [