PHP Classes

Classifier: Load and initialize classes from a given directory

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (9 months ago) RSS 2.0 feedNot enough user ratingsTotal: 307 All time: 7,349 This week: 455Up
Version License PHP version Categories
classifier 1.0The PHP License3.0PHP 5, Language
Description 

Author

This class can load and initialize classes from a given directory.

It scans a given directory and includes all files it finds.

The class takes a look at each file name and creates an object of each class obtaining the class name from the file name after removing the .php file name extension.

The created objects are stored in variables of this class with the same name of the created objects classes.

The class loads any dependent classes looking at the requires variable array of the created objects.

It also initializes all the classes it finds by calling the respective init function.

Picture of Andoitz Jordan Marmolejo
  Performance   Level  
Name: Andoitz Jordan Marmolejo <contact>
Classes: 7 packages by
Country: Spain Spain
Age: 34
All time rank: 81318 in Spain Spain
Week rank: 227 Up8 in Spain Spain Up
Innovation award
Innovation award
Nominee: 3x

Winner: 2x

Details

PHP classifier programmed for a future MVC implementation in your web application. Create your classes with dependences of other classes. This is an example about correct MVC implementation. ¿How to use it? 1. Call the main class Classifier with the correct params: $classifier = new Classifier('/class'); 2. Create and configurate a Generic Class 3. Create your classes in your classes folder with a require array (class dependences).

  Files folder image Files (8)  
File Role Description
Files folder imageclass (4 files)
Plain text file Classifier.php Class Classifier
Plain text file GenericClass.php Class GenericClass
Accessible without login Plain text file index.php Example Index Example Use
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (8)  /  class  
File Role Description
  Plain text file Class1.php Class Class1
  Plain text file Class2.php Class Class2
  Plain text file Classifier.php Class Class source
  Plain text file GenericClass.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 75%
Total:307
This week:0
All time:7,349
This week:455Up