PHP Classes
elePHPant
Icontem

PHP LGCF Loader: Load classes and functions when needed

Recommend this page to a friend!
  Info   View files Example   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-09-10 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 157 This week: 1All time: 8,408 This week: 653Up
Version License PHP version Categories
lgcfloader 1.0.0Custom (specified...5PHP 5, Language
Description Author

This package can be used to load classes and functions when needed.

It can load scripts with classes or functions on demand from a given path.

The loaded classes and functions are stored in session variables to avoid further class or function script reloading.

Innovation Award
PHP Programming Innovation award nominee
October 2017
Number 5
This package can be used to load classes and functions when needed.

It can load scripts with classes or functions on demand from a given path.

The loaded classes and functions are stored in session variables to avoid further class or function script reloading.

Manuel Lemos
  Performance   Level  
Name: zinsou A.A.E.Mo´se is available for providing paid consulting. Contact zinsou A.A.E.Mo´se .
Classes: 27 packages by
Country: Benin Benin
Age: 28
All time rank: 14661 in Benin Benin
Week rank: 3 Up1 in Benin Benin Equal
Innovation award
Innovation award
Nominee: 7x

Winner: 1x

Details
		PHP  Lazy Global Classes and functions loader (LGCF LOADER) package,
		is a package to introduce a concept for the classes and functions loading:
							THE LAZY LOADING....
		Actually it is experimental but it works....
		The concept is to globally load classes and functions without need of an autoloader or multiple files inclusions...
		Actually , i'm not proud to use the $_SESSION superglobal ARRAY but maybe in the future there will be a special superglobal 
        available in PHP for this type of purpose...	
			
			
			How to use it :
			-First put all your classes or functions in one single file(one file for classes only and one for functions don't mix them)
				the classes or function must be declared in UPPER CASE AS CLASS...or FUNCTION
				in case of functions that wrappes another functions in their declaration you must just 
				use FUNCTION for the main function only example: 
				
				FUNCTION addsomething(){
					function todo(){}//just for example
					function workwith(){}//just for example
					
				}
				
				FUNCTION addsomething(){
					function doho(){}//just for example
					function workwithho(){}//just for example
					
				}
				
				or 
				
				CLASS Miovar{
					protected $myvar;
					public function doho(){}//just for example
					private function workwithho(){}//just for example
				}
				
				CLASS JO{
					protected $myvar;
					public function doho(){}//just for example
					private function workwithho(){}//just for example
				}
				
				note that the	Global lazy loading at this state don't care about namespace so all your classes must be without them with different name...
				
			- Then  include the file LGCF_Loader.class.php once at the top of all the file where you want to use your functions or classes
				just after the session_start statetement and set in it your files paths
				
			-Finally you can use your function or class as:
			$x=call_Gcl($your_class_name_here,array('your,class,args,here'));// to instanciate an object...
				
				or

			call_gfunc($your_function_name_here,array(your,function,args,here));// to call your function as CLASS or
			
			
			
	Remarks:
	1.keep in mind that at this state of Functions lazy loading ,use a word as FUNCTION in upper case in any string in your function statement 
    could break your functions and will cause fatal error when calling 
	2.keep in mind that at this state of CLASSES lazy loading ,use a word as CLASS in upper case in any string in your function statement 
    could break your classes and will cause fatal error when instanciating an object 
	
	I provide some examples files to show how to use it...Feel free to send bug reporting and suggestion via the forum or
	at leizmo@gmail.com
  Files folder image Files  
File Role Description
Files folder imageexamples (3 files)
Accessible without login Plain text file example.php Example first example file
Accessible without login Plain text file LGCFLOADER_LICENSE_FILE.txt Lic. license file
Plain text file LGCF_Loader.class.php Class class source
Accessible without login Plain text file myclasses.php Aux. classes for test purposes
Accessible without login Plain text file myfunctions.php Data functions for test purposes
Accessible without login Plain text file readme.txt Doc. readme

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file example1.php Example example script
  Accessible without login Plain text file example2.php Example important example script
  Accessible without login Plain text file example3.php Example example script

 Version Control Unique User Downloads Download Rankings  
 0%
Total:157
This week:1
All time:8,408
This week:653Up
User Comments (1)