several sites sharing the same script

This is a discussion on several sites sharing the same script within the PHP General forums, part of the PHP Programming Forums category; Hello all, I am writing new php application which will be used by several sites. All sites will use same ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-29-2006
Internet.Maestro@gmail.com
 
Posts: n/a
Default several sites sharing the same script

Hello all,

I am writing new php application which will be used by several sites.
All sites will use same script (all files), but every will have its own config.php file.
I would like to place all necessary files to separate directory and all sites should share them, so all sites will be updated.

for e.x. structure will be:

| - script directory
|- site1.com dir
config.php
|- site2.com dir
config.php
|- site3.com dir
config.php

Does anyone have idea how to organize and share files?


Thanks For Your Time !
Reply With Quote
  #2 (permalink)  
Old 11-30-2006
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] several sites sharing the same script

On 11/29/06, Internet.Maestro@gmail.com <internet.maestro@gmail.com> wrote:
> Hello all,
>
> I am writing new php application which will be used by several sites.
> All sites will use same script (all files), but every will have its own config.php file.
> I would like to place all necessary files to separate directory and all sites should share them, so all sites will be updated.
>
> for e.x. structure will be:
>
> | - script directory
> |- site1.com dir
> config.php
> |- site2.com dir
> config.php
> |- site3.com dir
> config.php
>
> Does anyone have idea how to organize and share files?


My thinking is always like:
siteX.com/
include/
secure/

where siteX.com has a basic common code base, include/ has common code
that is shared across siteX.com, and in secure you have individual
settings per site, for example

siteX.com/index.php:
require('setup.php');

include/setup.php:
require($siteX .'.setup.php');
// perform standard setup routines
// include standard things you need to use accross sites

secure/$siteX.setup.php
// setup defines specific to the site and used in include/setup.php

and then you ensure you have set your your include_path to:
root_to/secure:root_to/include:root_to/:.:/usr/local/lib/php/

Curt.
Reply With Quote
  #3 (permalink)  
Old 11-30-2006
Richard Lynch
 
Posts: n/a
Default Re: [PHP] several sites sharing the same script

http://php.net/include_path

On Wed, November 29, 2006 5:48 pm, Internet.Maestro@gmail.com wrote:
> Hello all,
>
> I am writing new php application which will be used by several sites.
> All sites will use same script (all files), but every will have its
> own config.php file.
> I would like to place all necessary files to separate directory and
> all sites should share them, so all sites will be updated.
>
> for e.x. structure will be:
>
> | - script directory
> |- site1.com dir
> config.php
> |- site2.com dir
> config.php
> |- site3.com dir
> config.php
>
> Does anyone have idea how to organize and share files?
>
>
> Thanks For Your Time !
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0