• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where to put plain object classes?

#17
Using Composer is the way to go. But you don't have to setup a package with packagist or any of that stuff. Just use if for it's autoloader.

You can make a new folder anywhere you want. Call it "mystuff". Now, create a composer.json file with the following contents:

Code:
{
   "autoload": {
       "psr-4": {
           "MyStuff\\": "mystuff/"
       }
   }
}

Then you can create classes with the MyStuff namespace and have Composer provide the autoloading.
Reply


Messages In This Thread
Where to put plain object classes? - by geekita - 12-02-2014, 05:51 AM
RE: Where to put plain object classes? - by kilishan - 12-17-2014, 07:13 PM
RE: Where to put plain object classes? - by Jamie - 01-06-2015, 05:18 AM
RE: Where to put plain object classes? - by Jamie - 01-06-2015, 03:08 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.