bacterozoid
02-21-2010, 12:28 PM
I've got a project I'm working on which requires some code that is going to end up being very reusable. In order to get the most value out of my code, I want to store it 100% separate from my project.
The library itself is basically two classes + some images. How can I set things up so that in any other project, I can do something like
require '../libs/mylib/mylib.php'
and everything will fall into place? This also includes using those images. Right now, in the library, I simply say "images/image.png". The problem: That path is relative to the file that included the library, not the library. I want to store the images as part of the library.
The library itself is basically two classes + some images. How can I set things up so that in any other project, I can do something like
require '../libs/mylib/mylib.php'
and everything will fall into place? This also includes using those images. Right now, in the library, I simply say "images/image.png". The problem: That path is relative to the file that included the library, not the library. I want to store the images as part of the library.