Is there a way to embed a group of PHP classes into PHP, so that I can call them natively without including the classes as files every time? I need this to be locally used or on a private server.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For laziness you could use the php.ini setting:
The
auto_prepend_fileis included before any script is run. It sounds like that is what you want. It could very well define classes or functions, or just be an autoloader. But you should avoid to use it for overly project-specific functionality – as it will impact all PHP scripts.(I’m personally using it to hobble on some PHP6 functionality..)