PHP Classes

PHP LGCF Loader: Load classes and functions when needed

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 203 All time: 8,454 This week: 660Up
Version License PHP version Categories
lgcfloader 3.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
Autoloading allows PHP to load classes using configurable rules, so developers do not have to write too much code to load all the class scripts they need.

This package not only can autoload classes, but also can cache the code of the classes to be loaded in session variables, so class loading can be done faster from memory.

Manuel Lemos
Picture of zinsou A.A.E.Moïse
  Performance   Level  
Name: zinsou A.A.E.Moïse is available for providing paid consulting. Contact zinsou A.A.E.Moïse .
Classes: 50 packages by
Country: Benin Benin
Age: 34
All time rank: 6761 in Benin Benin
Week rank: 215 Up1 in Benin Benin Equal
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

Example

<?php


require('../PersistentGlobalsMaker.php');

require_once(
'../LGCF_Loader.class.php');

echo
'<pre>';
//load classes only if not loaded
   
// classes_loader('../myclasses.php');//change your classes path here;
   
// load functions only if not loaded
   
// functions_loader('../myfunctions.php','function');//change your functions path here;

   
$x=call_Gcl('test1',array(4,5,6));
    print(
$x->just_for_test());
    echo
'<br>';
   
   
$x=call_Gcl('test2',array(4,5,6));
    print(
$x->just_for_test());
    echo
'<br>';
   
$x=call_Gcl('test3',array(4,5,6));
    print(
$x->just_for_test());
    echo
'<br>';
   
$x=call_Gcl('test4',array(4,5,6));
    print(
$x->just_for_test());
    echo
'<br>';
   
$x=call_Gcl('test',array(4,7,6));
    print(
$x->just_for_test());
    echo
'<br>';
   
call_glfunc('kakao\Show_me_hello');


foreach(
kakao\fortest() as $x){
echo
$x.'<br>';
}

echo
kakao\Show_me_hello();

var_dump(LGCF_LOADER::gAc(),LGCF_LOADER::gAf(),LGCF_LOADER::gP(),call_Gcl('ProjectInfoCollector',array(__DIR__)));

?>


Details

PHP Lazy Global Classes and functions loader (LGCF LOADER) package, is a package to reproduce a well known concept for the PHP classes and functions loading: THE LAZY LOADING.... The concept is to globally load classes and functions without need of an autoloader of multi files inclusions. Did you ever hear about Assetic...? Now this package actually work like it. Why every body use autoloaders ? I think the main purpose is to keep their code separated and clean and easy to maintain. Assetic do it well with your js and css files by letting developers keep their files structures but serving condensed files to the clients. This package do the same with your PHP classes and functions files.It let you keep your classes files and functions files separated and easy to maintain but created a global container which regroups in one file all your data which could be lazily served from anywhere in your pages. How to use it : For the test 1-Download the package and unzip it in a folder 2-Download the Persistent PHP Super Globals Array Maker package and unzip the content in the same folder(the content must really be in the same folder) 3-Download the PHP Code Gleaner Package and unzip the content in the same folder(the content must really be in the same folder) 4-Run the install script in the browser. 5-Open any example file in the browser For your own script 1-Download the package and unzip it a folder 2-Download the Persistent PHP Super Globals Array Maker package and unzip the content in the same folder(the content must really be in the same folder) 3-Download the PHP Code Gleaner Package and unzip the content in the same folder(the content must really be in the same folder) 4-Run the install script in the browser. 5-Open the file LGCF_loader.class.php and change your path at the bottom of the file to load classes and functions. 6-Include the persistent global maker source at the top of your page 7-Include the LGCF_loader.class.php via the statement include_once,include,require etc... at the top of your page Now you can proceed as shown in the examples files to call your classes or functions Alternatively ,you can install the package and its dependencies via composer see the download session of this package to copy and the paste the composer code. Nb: you can launch progressively the paths on the page you need them instead of launch them once. This way the caching process will always be short For more infos about the new things in this version read the changelog.txt file. Use the forum to report bugs,suggestions and other or contact me at leizmo@gmail.com The PHP Code Gleaner and Analyzer package can be found at: https://www.phpclasses.org/package/10697-PHP-Scan-PHP-scripts-to-extract-data-about-the-code.html The Persistent PHP Super Globals Array Maker can be found at: https://www.phpclasses.org/package/10822-PHP-Create-array-variables-that-act-like-superglobals.html

  Files folder image Files (10)  
File Role Description
Files folder imageexamples (3 files)
Accessible without login Plain text file changelog.txt Doc. change log
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 (10)  /  examples  
File Role Description
  Accessible without login Plain text file example1.php Example example script
  Accessible without login Plain text file example2.php Example example script
  Accessible without login Plain text file example3.php Example example script

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
Downloadlgcfloader-2018-06-29.zip 9KB
Downloadlgcfloader-2018-06-29.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
PHP Code Gleaner and Analyzer Tool Download .zip .tar.gz mother class which this class extends package Required
Persistent PHP Superglobals Array Maker Download .zip .tar.gz require to make custom super global $_LGCF_LOADER available Required
 Version Control Unique User Downloads Download Rankings  
 0%
Total:203
This week:0
All time:8,454
This week:660Up
User Comments (1)