[PHP] benchmarking php scripts

2002-01-16 Thread Eugene Lee

Is there a way to benchmark a PHP script to see how intensive it is?
For example, execution time, CPU/RAM/disk usage, etc.  Thanks in advance.


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




Re: [PHP] Re: benchmarking php scripts

2002-01-16 Thread Eugene Lee

On Wed, Jan 16, 2002 at 05:41:34PM +0900, Yasuo Ohgaki wrote:
: 
: Eugene Lee wrote:
: > 
: > Is there a way to benchmark a PHP script to see how intensive it is?
: > For example, execution time, CPU/RAM/disk usage, etc.  Thanks in advance.
: 
: Try APD.

Thanks.  It'll be a decent start.  Getting a few million hits per day is
really taking a toll on our server.


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




Re: [PHP] modular programming

2002-02-15 Thread Eugene Lee

On Sat, Feb 16, 2002 at 09:54:40AM +0530, Kunal Jhunjhunwala wrote:
: 
: does anyone know of any good papers on modular programing? I have been able
: to make my code modular, but I am not satisfied with it. I am trying to make
: my program work the "plug in" way.. where i can just add more modules on the
: fly... any tips? :)

You're talking about a nice, OO framework.  Outside of university
computer science ivory tower environments like Smalltalk, and besides
NeXTSTEP/OPENSTEP/Cocoa of Mac OS X, your best bet is to make more OO
classes and learn to abstract consistent pieces.  Try taking a look at
"Design Patterns: Elements of Reusable Object-Oriented Software" by
Gamma, Helm, Johnson, Vlissides.

Also, from the ColdFusion world, there are framework architectures like
Fusebox whose concepts are supposed to be language-independent.


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] Rebooting

2002-04-09 Thread Eugene Lee

On Tue, Apr 09, 2002 at 07:19:44PM +0200, Dave Raven wrote:
: 
: I need to reboot a FreeBSD 4.5-STABLE
: computer using php + apache. I have a 
: small wrapper which runs the reboot 
: command as root, but it freezes half way
: through and the box hangs. 
: 
: I'm thinking that the reboot process is 
: killing apache, and in effect killing itself.
: How might I get around this?

How about launching a shell script that reboots the server as its own
process?  For example, make a script at /etc/shutdown containing this:

#!/bin/sh
/sbin/reboot

then in your PHP script do something like:

/dev/null/ 2>&1 &');
        ?>


-- 
Eugene Lee
[EMAIL PROTECTED]

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




[PHP] shopping cart suggestions

2002-04-09 Thread Eugene Lee

Apologies if this is an oft-repeated question, but could anyone
recommend a PHP/MySQL shopping cart (free or commercial) that works
pretty well, decently customizable, and doesn't depend on additions
beyond the standard PHP distribution (e.g. PHPlib).

The PHP Knowledge Base <http://php.faqts.com/> lists only 2:

FishCart <http://www.fishcart.org/>
FreeTrade <http://www.working-dogs.com/freetrade/> (dead link)

freshmeat <http://freshmeat.net/> lists 16 (looks like FreeTrade moved here).

HotScripts.com <http://hotscripts.com/> lists 48, but not all of the
scripts are rated.

Any suggestions or comments are welcome.  Much thanks in advance!


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] Re: Forms in PHP

2002-04-12 Thread Eugene Lee

On Fri, Apr 12, 2002 at 09:36:42AM -0700, Andrew Chase wrote:
: 
: foreach(array_keys($menu_options) as $option_value){
:   $option_text = $menu_options[$option_value];
:   echo '$option_text';
: }
: 
: would just output
: 
: $option_text
: $option_text
: $option_text
: 
: which is probably not the desired output :)  You need to use double quotes
: for variable substitution. Unfortunately, if you want to maintain XHTML
: compliance the tag attributes have to be double-quoted too...
: 
: echo "$option_text\n";

Why stick with quotation marks?

echo "$option_text\n";


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] chown ..opperation not permitted

2002-04-15 Thread Eugene Lee

On Mon, Apr 15, 2002 at 10:54:51AM -0700, John Weez wrote:
: 
: I have a script which makes a directory. This directory is owned by 
: nobody.nobody because that is what apache runs as. But, I want this 
: directory to be owned by a differrent user. So, After making the 
: directory i use the php command chown to change the directory ownership. 
: Now, I get an error saying opperation not permitted.

The 'chown' command can only be executed by the superuser.

The next question to ask is, why do you want this PHP-created directory
to be owned by a different user?


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Eugene Lee

On Mon, Apr 22, 2002 at 05:10:34PM -0400, Leif K-Brooks wrote:
: 
: I use $formvar for form processing, I don't use the arrays.  This is how I
: was taught to do it.  If my host upgrades to 4.2.0, my website is as good as
: gone!  What am I supposed to do?!

Learn the new method.  Or RTFM.

http://www.php.net/manual/en/html/language.variables.predefined.html


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] compiling on freebsd

2002-04-24 Thread Eugene Lee

On Thu, Apr 25, 2002 at 01:50:17AM -0400, Larry Brown wrote:
: 
: I ended up using a port which eventually worked.  I parsed the INSTALL file
: and it didn't mention anything about specifically adding libphp4.so.  It
: mentioned checking the flags available with ./configure -help which I ran.
: But I had no way of knowing what apxs means.  It mentioned -with-apxs in the
: INSTALL description but stated that if I got an error to physically locate
: apxs and tell configure where it is.  I did a search for apxs* with no
: results.  Anyway, I did get it going.  Thank you for the input.

Here's the relevants bits of INSTALL, with line numbers to boot.

% grep -C1 -n libphp4 php-4.2.0/INSTALL 
102-$ cd ../apache_1.3.x
103:$ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
104: (The above line is correct!  Yes, we know libphp4.a does not exist at this
105-  stage.  It isn't supposed to.  It will be created.)
--
226-   ./configure --prefix=//apache \
227:   --activate-module=src/modules/php4/libphp4.a
228-   make
--
239-
240:  AddModule modules/php4/libphp4.a
241-
--
248-
249:   For Apache 1.2.x you will also have to look in the libphp4.module file,
250-   which was copied to the src directory. The EXTRA_LIBS line in the Apache
251-   Configuration file needs to be set to use the same libs as specified on
252:   the LIBS line in libphp4.module. You also need to make sure to add
253-   "-L." to the beginning of the EXTRA_LIBS line.
--
259-   NOTE: You should not enclose the EXTRA_LIBS line in double-quotes, as it
260:   is in the libphp4.module file.
261-
262:   Also, look at the RULE_WANTHSREGEX setting in the libphp4.module file 
263-   and set the WANTHSREGEX directive accordingly in your Configuration file.
--
282-
283:  LoadModule php4_module libexec/libphp4.so
284-
285:   The actual path before the libphp4.so part might differ slightly.  This
286-   is likely fine.  If you are paranoid you can examine the output from the
287:   make install step to see where the libphp4.so file was actually put and
288-   place the full path to this file on this LoadModule line.


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] Apache is not rendering php pages. Config problem?

2002-05-10 Thread Eugene Lee

On Fri, May 10, 2002 at 09:53:10PM +0200, andy wrote:
: 
: I did just build abpache and php. Unfortuanatelly the http.conf looks quit
: different to one I did install last year.
: There is no phpmodule in there, so I cant activate it. I did   include some
: lines from my old config:
: 
: AddType application/x-httpd-php .php4 .php3 .php
: AddType application/x-httpd-php-source .phps
: 
: but does not help anything. Did I miss something? I did compile php with
: apxs and apache with --enable-module=so

This configuration option enables DSO support, but does not
automatically turn your modules into DSOs.  What does "httpd -l"
report?


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] Apache is not rendering php pages. Config problem?

2002-05-10 Thread Eugene Lee

On Fri, May 10, 2002 at 11:34:28PM +0200, Andy wrote:
: "Eugene Lee" <[EMAIL PROTECTED]> asked:
: > On Fri, May 10, 2002 at 09:53:10PM +0200, andy wrote:
: > :
: > : I did just build abpache and php. Unfortuanatelly the http.conf
: > : looks quit different to one I did install last year.  There is no
: > : phpmodule in there, so I cant activate it.
[...]
: > : Did I miss something? I did compile php with
: > : apxs and apache with --enable-module=so
: >
: > This configuration option enables DSO support, but does not
: > automatically turn your modules into DSOs.  What does "httpd -l"
: > report?
: 
: there is not much inside the log. (I do asume you mean the logs) Nothing
: related to that prob.

Nope, not the logs.

$ /usr/local/apache/bin/httpd -l
(or whatever your Apache root directory is)

: What yould be a propper config command for apache to build. I would like to
: run php as an apache module apxs

The online instructions should be okay:

    http://www.php.net/manual/en/install.apache.php


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] Re: variables

2002-05-22 Thread Eugene Lee

Also, it's good to read the press releases:

http://www.php.net/release_4_2_1.php

External variables

We would also like to attend you on a big change in PHP
4.2.0 concerning variable handling. External variables
(from the environment, the HTTP request, cookies or the
web server) are no longer registered in the global scope
by default. The preferred method of accessing these
external variables is by using the new Superglobal
arrays, introduced in PHP 4.1.0.

http://www.php.net/release_4_1_0.php

On Wed, May 22, 2002 at 11:52:02AM +0200, Michael Virnstein wrote:
: 
: you can use
: 
: $_POST['name1'] if you're using post vars
: $_GET['name1'] if you're using get vars
: 
: "Roman Duriancik" <[EMAIL PROTECTED]> schrieb:
: > 
: > When are set in php.ini (php version 4.2.1 on linux) register_globals = Off
: > how I read variables from  html files with forms in other php file ?


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] countries

2002-06-04 Thread Eugene Lee

Why not go to the source?


http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] PHP 4.1.0 is_dir bug

2001-12-13 Thread Eugene Lee

On Thu, Dec 13, 2001 at 08:17:30AM +, Philip Olson wrote:
: 
: It's fixed in CVS, we'll see it in the next release (4.2.0).  From the
: NEWS file:
: 
: - Fixed is_dir(), is_writeable(), is_readable(), is_executable(),
:   is_link() and is_file() functions to not throw a 'file does not
:   exist' warning. (Sterling)
: 
:   http://cvs.php.net/co.php/php4/NEWS

When will 4.2.0 be released?  If it's not within a few weeks, I think
it's more senseful to do a point-point release (e.g. 4.1.1) that is just
a bug fix (and no new features) for this and other problems.


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




Re: [PHP] IP address from which country

2002-01-09 Thread Eugene Lee

On Wed, Jan 09, 2002 at 11:33:46AM +0200, Dimitris Kossikidis wrote:
: 
: I 'm not sure, but i beleive you can get visitor's country from Apache 's
: Varialble $HTTP_ACCEPT_LANGUAGE. For further information read "Predefined
: Variables" in the manual.

This works assuming the browser itself sends the "correct" country code.
Browsers in most places will send a "Content-language: en" regardless of
what country the user's browser is running within.


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




Re: [PHP] Apache and "/"

2002-01-09 Thread Eugene Lee

On Wed, Jan 09, 2002 at 03:47:16PM -0800, Todd Cary wrote:
: 
: I forgot the parameter to change in httpd.conf so when the trailing "/"
: is left off, the "index.html" will be executed.  Anyone know the
: parameter?

DirectoryIndex index.html index.htm


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




Re: [PHP] Re: More thoughts about PHP: Taglibs

2001-09-12 Thread Eugene Lee

On Tue, Sep 11, 2001 at 11:14:30AM -0400, Michael Kimsal wrote:
: 
: Perhaps you should just use cold fusion then, if you're that
: hot and heavy into tag-based languages.
: 
: tagservlet.com has a Java/CF hybrid which may hold some interest.
: 
: PHP's strength, IMO, is that it's NOT a tag-based language.  You can create
: any functions you want and call them already from a  combination
: 
: 

ColdFusion 5 finally allows users to define functions, so the above
strength for PHP is now a strength for ColdFusion.


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




[PHP] downloadable annotated PHP manual?

2001-09-12 Thread Eugene Lee

Like the subject says, is there a downloadable version of the Annotated
PHP Manual?  I'm not always connected to the Internet, so this would be
a great help.  Thanks in advance.


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




Re: [PHP] downloadable annotated PHP manual?

2001-09-12 Thread Eugene Lee

On Wed, Sep 12, 2001 at 10:14:29PM -0400, Jack Dempsey wrote:
: Eugene Lee [mailto:[EMAIL PROTECTED]] asked:
: > 
: > Like the subject says, is there a downloadable version of the Annotated
: > PHP Manual?  I'm not always connected to the Internet, so this would be
: > a great help.  Thanks in advance.
: 
: http://php.net/download-docs.php

Thanks, but these versions (at least the English version for me) aren't
annotated and thus don't have any of the updates already made with the
online version.


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




[PHP] next maintenance release?

2001-09-25 Thread Eugene Lee

PHP 4.0.6 has been out for 3 months now.  Any word on the next update?


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]




Re: [PHP] Feature?

2001-09-25 Thread Eugene Lee

On Tue, Sep 25, 2001 at 11:36:25AM +0300, Andrey Hristov wrote:
: 
:  After some days spent in a hospital reading "Programming Perl" and
: "Oracle Web Applications" I found that a language construct which
: appears in Perl and PL/SQL is not available in PHP.
: As in most 3G languages function call is like that
: $bar=foo($bar1,$bar2,$bar3,'bar4');
: 
: function foo($par1=1,$par2=2,$par3=3,$par4='foo_bar',...){
: ...
: }
: In the case when I've few parameters I've to remember their order, so why not
: $bar=foo('par2'=>10);
: I want to pass value to only one or more but not to all params. Also
: this will make the code clearer I think.

AFAIK, Perl doesn't support named parameters (it's listed for Perl 6).
Since C does not support this, almost all C-like languages also do not
support this.  The only exception I know of is Objective-C, which is the
base language for Apple's new Unix-based Mac OS X.

As for PHP supporting named parameters, it seems silly to preserve C's
use of parentheses.  Why not do something more radical like Objective-C
that draws from Smalltalk syntax:

$bar = [foo par2:10]


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
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 PROTECTED]