Re: Consistent Class Renaming (Simple Refactoring)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 17, 2011 at 5:40 PM, Richard Quadling <rquadling@xxxxxxxxx>wrote:

> On 17 May 2011 17:04, Tony Mak <duranis2004@xxxxxxxxxxx> wrote:
> > Thanks for your replys.
> >
> > Of course >>PHP 2.7.2<< was a careless mistake, i meant PHP 5.2.7, to
> > underline i'm not able to use those neat namespace features in PHP 5.3.
> >
> >
> > Let me provide you with more details.
> >
> > As already mentioned cron.php should include at least two other
> php-scripts
> > because shell_exec cannot be called in safe-mode (which is on). I am able
> to
> > manipulate those scripts but as they could be quite complex i dont want
> to
> > check precisely.
> > But if I include them they probably could share the same classnames for a
> > semantically different class.
> > I just wanted to know if there is already a solution which could detect
> > those overlappings or prevent them by consistently renaming the classes
> (ie
> > class A in script1 gets class A_1 and class A in script2 gets class A_2,
> and
> > all class-calls get "new A"=> ("new A_1" | "new A_2") and "A::xx" =>
> > ("A_1::xx" | "A_2::xx") ).
> >
> >
> > Is there a specification in php which says how classes could exactly be
> > defined and called? Because im afraid that there will be more
> dependencies
> > to change then (ie Same-named constructor methods (backward
> compatibility)).
> > If there is i could write a script which renames the classes
> automatically.
> >
> > Otherwise i would have to wait until server updates to >=5.3
> > Sincerly yours,
> > toni
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> If the 2 scripts aren't dependent upon each other, then why not run 2
> crons?


I don't know what situation the OP is in, but one of my clients has dozens
of tasks that need to be executed at various times across a cluster of
servers, and rather than maintaining cron entries (which was getting
nightmareish) we use a single cron entry on each server that runs a
controlling process that in turn runs those tasks according to their
individual schedules. It's all very dynamic, scales automatically (within
limits) and enables the developers to add, remove and change the jobs
without having to mess about with system configuration files.

We get around class and function names that are specific to each job by
prefixing them with a token specific to that job. Simples.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux