Re: [PHP] Application settings, configuration, and preferences.

2010-10-27 Thread J Ravi Menon
On Wed, Oct 27, 2010 at 11:39 AM, J Ravi Menon wrote: > I am partial to the filesystem but I can see scenarios where the db > approach might be useful (single point of control) with good caching > strategy using apc or other mechanisms. > > One approach I have followed is tha

Re: [PHP] Application settings, configuration, and preferences.

2010-10-27 Thread J Ravi Menon
I am partial to the filesystem but I can see scenarios where the db approach might be useful (single point of control) with good caching strategy using apc or other mechanisms. One approach I have followed is that if the config. field and values are simple key-value pairs, you could store them in

Re: [PHP] Model View Concepts

2010-10-25 Thread J Ravi Menon
On Fri, Oct 22, 2010 at 3:03 AM, Ashley Sheridan wrote: > On Fri, 2010-10-22 at 10:16 +0200, Sebastian Detert wrote: > >> Hi all, >> >> I'm currently searching for any code snippets, tutorials, howtos, >> concepts which explain different ways to collect all type of data/input >> (i.e. inside a cla

Re: [PHP] PHP Email Question

2010-09-30 Thread J Ravi Menon
On Wed, Sep 29, 2010 at 1:37 PM, Joe Jackson wrote: > Hi > > I am trying the following snippet as Bostjan  suggested, and an email is > getting sent when I submit the form however in the body of the email I am > getting none of the form data in the body of the email.  All I am getting is > the let

Re: [PHP] PHP Email Question

2010-09-21 Thread J Ravi Menon
Just on this topic, I found swiftmailer library to be really useful esp. in dealing with 'template' emails with custom variables per recipient: http://swiftmailer.org/ The e.g. on email template processing: http://swiftmailer.org/docs/decorator-plugin-howto There are batchSend() functionalities

Re: [PHP] php cli question

2010-09-15 Thread J Ravi Menon
gt; > b. > > > On 15 September 2010 04:19, J Ravi Menon wrote: >> >> On Tue, Sep 14, 2010 at 1:15 PM, Per Jessen wrote: >> > J Ravi Menon wrote: >> > >> >> On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen wrote: >> >>> J Ravi Menon wrot

Re: [PHP] php cli question

2010-09-14 Thread J Ravi Menon
On Tue, Sep 14, 2010 at 1:15 PM, Per Jessen wrote: > J Ravi Menon wrote: > >> On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen wrote: >>> J Ravi Menon wrote: >>> >>>> Few questions: >>>> >>>> 1) Does opcode cache really matter in su

Re: [PHP] php cli question

2010-09-14 Thread J Ravi Menon
On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen wrote: > J Ravi Menon wrote: > >> Few questions: >> >> 1) Does opcode cache really matter in such cli-based daemons? As >> 'SomeClass' is instantiated at every loop, I am assuming it is only >> compil

[PHP] Re: php cli question

2010-09-13 Thread J Ravi Menon
On Sat, Sep 11, 2010 at 8:50 PM, Shawn McKenzie wrote: > On 09/10/2010 11:13 AM, J Ravi Menon wrote: >> Hi, >> >> I have some basic questions on running php  (5.2.x series on Linux >> 2.6) as a standalone daemon using posix methods (fork() etc..): >> >&

[PHP] php cli question

2010-09-10 Thread J Ravi Menon
Hi, I have some basic questions on running php (5.2.x series on Linux 2.6) as a standalone daemon using posix methods (fork() etc..): #!/usr/bin/php doSomething() } // shutdown logic. The 'someclass.php' in turn will include other files (via require_once). The above file will be executed dir

Re: [PHP] Re: Best Practices Book, Document, Web Site?

2010-03-05 Thread J Ravi Menon
Other than coding standards, the other good read is: (it seems to cover most topics I have ran into while maintaining a high traffic site implemented in php 5): http://phplens.com/lens/php-book/optimizing-debugging-php.php It is 'best practices' from another angle - use of opcode cache (apc etc..

Re: [PHP] memory efficient hash table extension? like lchash ...

2010-01-25 Thread J Ravi Menon
es but not sure it is necessarily guaranteed in future versions. Ravi On Mon, Jan 25, 2010 at 3:49 PM, D. Dante Lorenso wrote: > J Ravi Menon wrote: >> >> PHP does expose sys V shared-memory apis (shm_* functions): >> http://us2.php.net/manual/en/book.sem.php > >

Re: [PHP] memory efficient hash table extension? like lchash ...

2010-01-25 Thread J Ravi Menon
PHP does expose sys V shared-memory apis (shm_* functions): http://us2.php.net/manual/en/book.sem.php If you already have apc installed, you could also try: http://us2.php.net/manual/en/book.apc.php APC also allows you to store user specific data too (it will be in a shared memory). Haven't tr

Re: [PHP] Object Oriented Programming question

2010-01-20 Thread J Ravi Menon
Hi Bob, [Couldn't resist jumping into this topic :)] Even if you look at traditional unix (or similar) kernel internals, although they tend to use functional paradigms, they do have a OOP-like flavor. Example: Everything in a unix system is a 'file' (well not really with networking logic, but it

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread J Ravi Menon
Sorry forgot to mention that we used APC with apc.stat turned off which will give a little bit more performance gain, but it does mean flushing the cache on every code push (which is trivial). Ravi On Fri, Jan 8, 2010 at 11:30 AM, J Ravi Menon wrote: > Hi, > > A note on bytecode ca

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread J Ravi Menon
Hi, A note on bytecode caching and include/include_once performance. A while ago when we were profiling our code, we did notice that file includes do take a noticeable percentage of overall overhead (enough for us to look into it more deep). We are using apc cache on a standard LAMP platform (linu

Re: [PHP] System errno in PHP

2008-02-22 Thread Ravi Menon
Hi, I also ran into the same issue with file and socket apis, and for now, I just hack it like ( for linux 2.6 systems ): class Errno { const EINTR= 4; const EIO = 5; const EINVAL = 22; const ENODATA = 61; const EBADMSG = 74; const EOPNOTSUPP =

[PHP] curl timeout vs socket timeout

2008-01-28 Thread Ravi Menon
Hi, We have two versions of client code, one using curl, and other one using raw sockets via fsockopen(), and we use the following code to set the i/o timeouts: 1) curl: . . curl_setopt( $handle, CURLOPT_TIMEOUT, 1 ); . . $resp = curl_exec($handle) 2) sockets: stream_set_timeout( $sock, 1);

Re: [PHP] apc and cli

2007-12-12 Thread Ravi Menon
December 12, 2007 1:33 pm, Ravi Menon wrote: > > We have long running daemons written in php ( cli, non-apache > > contexts) with the typical pattern: > > > > while( !$shutdown ) > > { > > $c = new SomeClass; > > > > $c->process(); > &g

[PHP] apc and cli

2007-12-12 Thread Ravi Menon
Hi, We have long running daemons written in php ( cli, non-apache contexts) with the typical pattern: while( !$shutdown ) { $c = new SomeClass; $c->process(); } For performance reasons, would it help if apc.enable_cli is turned on: apc.enable_cli integer Mostly for testing and

Re: [PHP] php.ini include_path and symlinks

2007-11-07 Thread Ravi Menon
> > Are you using a compile cache like eaccelerator or APC etc? Sometimes > it's the cache that doesn't realize things have changed. I use a symlink > switcher for version releases also and I always flush the eaccelerator > directory when I do that. Yes we use APC ( with apc.stat on ). This was the

[PHP] php.ini include_path and symlinks

2007-11-06 Thread Ravi Menon
Hi, We run php 5.2.0 + apache 2.2. with apc turned on ( apc.stat also on ). Earlier we did not use the php.ini include_path setting. We relied on some symlinks for our common code so that require_once works correctly. This worked fine and during code releases we flipped the main 'release' symlink