-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Kaloyan K. Tzvetkov wrote:
> I think there are other areas in ZF like this as well. What I propose is to
> consider forking ZF into 2 "versions" -
[...]
> What do you think ?

What a crazy idea :-) My personal guess is that people won't be very
excited about this.

But anyway I'ld like to share my view. I've also been facing such things
like having one of my sources be available in two versions, with just
"slight" modifications.

I therefore wrote a kind of "PHP Preprocessor". Yes, this sounds
incredible dull since we all know what PHP itself stands for. Anyway, it
did the job for me.

In my case it was about performance and I didn't want to have all my
zillions of error log statements (even being called) all the time. But
frankly you can manipulate the source in any way desired. The syntax I'm
using is very simplistic, e.g.

[some class code here]
  protected function _doImportant() {
#ifdef DEBUG
    $this->log("doing important stuff now");
#endif
    foreach ($this->import as $moreimportant) {
#ifdef DEBUG
      $this->log("as I said, important or $moreimportant");
#endif
    }
#ifdef DEBUG
    $this->log("finished doing ach so important thing");
#endif
  }
[continuing]

In this example, the nice thing is that without using the preprocessor,
there's no impact on the code at all. And at will you can create a
source without all the log statements even in there. I even wrote a
Phing task to do this nicely before deploying. Note that in my case the
preprocessor is a separate process *before* executing the source under
whichever sapi. It's not meant to be done real-time or whatsoever. It's
not a PHP extension, just some classes reading, understand, modifying
the sources.

Whether the usage of the preprocessor could be used for what Kaloyan
suggested and whether if it's possible to have a source still working
without having to "generate" even a development working version (which
is important because I think else no one would want to use it) remains
to be seen ...

Ok, since we've a new year and the fork idea is crazy I thought I share
my crazy idea for today too.

thanks for even reading so far,
- - Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHejYG1nS0RcInK9ARAkrUAKCPK+Xf2CRNT6rgjBwLqX86y4joewCfdZ3P
YNY28+OOOmkg26mBrRWNPt0=
=BlOa
-----END PGP SIGNATURE-----

Reply via email to