Jump to content

How to "share" my classes?


ZeratulsDomain3

Recommended Posts

At work I wrote many classes/function that are hundreds of lines of code. This code rarely changes, but it does happen. Some of this code is also used in all 4 of the sites.

 

Problem right now is I have "4 sites" with duplicate code on them (copy/pasted). All on a single server running IIS. How can set this up so all 4 sites "share" the same PHP code?

 

My temporary "dirty" fix to this has been to: Setup a 5th site in IIS. Setup a firewall rule to block any access to it, then rename all my PHP files to ".txt" files then simple do "require "somePHPcode.txt" (this way IIS wont "run them" before sending them).

 

This works, but its not very elegant. Got a better method?

Link to comment
Share on other sites

What you really want to do, seems like a possible security-flaw to me: fetching external scripts to run on your server...

 

Wouldn't an account with f.e. github not be better? You put all classes together, you can maintain your code very easily and everytime you make some adjustments, you can simply fetch the updates with git...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.