Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert PHP class to a native class

Tags:

php

pear

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.

like image 521
Dewan159 Avatar asked Aug 24 '26 00:08

Dewan159


1 Answers

You may want to use __autoload() if i understand you correctly.

Note from @KingCrunch:

The __autoload() function should not be used anymore, because if you use other libraries, that define an spl-loader, the function is never call since then

So it'd be better if you stick with SPL Autoload functions.

like image 65
fabrik Avatar answered Aug 25 '26 14:08

fabrik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!