Central Code Location??

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Central Code Location??

Post by JPlush76 »

I'm noodling with the idea of creating a software package for multiple clients to use.. ideally for update purposes I would like to use a central code repository for non-custom functionality on my server.

basically

require_once('http://jimssite.com/code/here.php')

Does anyone see that as being a real performance problem? Pulling classes from a central server.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Well it will increase your server load, but not by a lot. However your server's availibility had better be pretty darn good or your clients will get upset when its down. They also may object to you "holding code hostage" depending on the nature of your contract with them.

And of course make sure you have both testing and production environments so when you change your common code you don't break all your clients at once :)
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

well they would be issued a license for the software, data would be kept on their end but the software that powers it would be centralized. Of course all code would have to be tested in a test system before moving to the central location.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

simillar thing

Post by phpScott »

The company that I work with is just about to do a simillar thing with a bunch of javaScript code and the only problem we are having is how to protect that code and make sure that registered users of the code are the only ones accessing.

phpScott
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

yea I can see javascript being a problem with that, being client side and all. when are you guys launching the code?
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

pretty soon

Post by phpScott »

we will be launching the code pretty soon, well as soon as wee can get this issue sorted.

Because all the pages using the js are acutally php pages will be using an include statement to get the js code in, well just writing the javascripit src = lines. Were are just now playing with header info to see how we can get the url of the site requesting the script.
Im sure it won't be hard to do just need a few hours to play.

phpScott
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

that should be easy if you use the HTTP_REFFER variable and just parse out everthing between http:// and .com and compare that against a list of allowable URLS
Morbius
Forum Newbie
Posts: 15
Joined: Sat Jul 27, 2002 12:10 am

Post by Morbius »

have you tried including it?

such as:

include("http://www.ur_<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>_site_here.com/"."your_<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>_code_location_here". ".php");

?
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Thanks jplush76

Post by phpScott »

That's exactly the little bit that I need jplush76.

as for Morbius' comment
nothing, no comment required. :?

phpScott
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

score, glad we could help each other this fine fine afternoon ;)
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Have you considered a SOAP solution? That would more likely be what you are looking for.
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

are you calling him dirty?
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

lol llomlib!

Jason, I'm no to familiar with SOAP, how would that help?
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

Php complete has a tutorial about this.
Building a PHP Library
Post Reply