You are here: Re: How would you attack this programming strategy? « PHP Programming Language « IT news, forums, messages
Re: How would you attack this programming strategy?

Posted by ZeldorBlat on 05/25/07 01:32

On May 24, 4:22 pm, BJMurphy <murphy....@gmail.com> wrote:
> On May 24, 4:09 pm, "laredotorn...@zipmail.com"
>
>
>
> <laredotorn...@zipmail.com> wrote:
> > Hi,
>
> > I'm using PHP 4.4.4 with Apache 2.2 on LInux. I have been building a
> > web site, and now a client wants that same site, only he wants all the
> > graphics substituted with his own. There could potentially be more
> > clients who want the same site but with custom graphics. What makes
> > more sense?
>
> > 1. Maintain a single code base, only have "if/else" blocks when it
> > comes to "<img src ...>" tags?
> > 2. Maintain two separate code bases except the images directory would
> > be different for each client (not sure how updating my code would
> > work, if I'd have to copy the same PHP files to multiple sites).
> > 3. Some other strategy?
>
> > Curious how you would approach this or what you have done if in a
> > similar situation.
>
> > - Dave
>
> Personally, I would keep one code base if at all possible. I would set
> a variable at some point for the images directory, and maintain
> parallel sets of images for each client. Then every <img> tag would
> just have the variable as part of the src path.

I would definitely just have a different directory for each customer's
images. You can even leave your code unchanged and use the "Alias"
directive in Apache's configuration to choose a different directory
for each virtual host (assuming each client had a different vhost).

For example. suppose all your <img> tags looked something like this:

<img src="/images/foo.gif">

Then, in httpd.conf under the vhost for client1, you might have:

Alias /images /path_to_web_files/client1_images

And under the vhost for client2, you would have:

Alias /images /path_to_web_files/client2_images

So, depending on which vhost is being used /images would point to a
different physical directory.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация