PHP Classes
elePHPant
Icontem

PHP Helper Class: Call helper functions that are loaded dynamically

Recommend this page to a friend!
  Info   View files Documentation   View files View files (21)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-02-15 (5 months ago) RSS 2.0 feedNot enough user ratingsTotal: 182 All time: 8,396 This week: 285Up
Version License PHP version Categories
php-helper 1.0.2The PHP License5.3PHP 5, Language
Description Author

This package allows applications to call helper functions that are loaded dynamically.

It provides a class overloading function to handle static function calls that checks if it exists a script in a helper directory with the name of the static function that is called.

If it script exists, the class loads the script and it automatically calls a function that it contains to execute the code of the called function.

If the script does not exist, it may load it dynamically from a remote site from a given URL.

Innovation Award
PHP Programming Innovation award nominee
January 2019
Number 4
Most applications need to use a set of general purpose functions that are often referred as helper functions.

Each application script may need some of the available helper functions but usually not all at once that the application as a whole needs.

This package can load helper function scripts dynamically, thus avoiding to use too much memory, which would happen if all the functions were defined in a single script or a list of large scripts with many helper function inside each one.

Manuel Lemos
  Performance   Level  
Name: Alexey Starikov <contact>
Classes: 2 packages by
Country: Russian Federation Russian Federation
Age: 42
All time rank: 315683 in Russian Federation Russian Federation
Week rank: 309 Up14 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 2x

 

Details

php-Helper

(PHP 5 >= 5.3.0, PHP 7)

Static class with automatic function loading

When calling the class H :: funcName, it is checked whether there is a function in the helper directory, if the function is found, then it starts, if it is not there, then we try to download the file from the Internet or local storage and then it is saved to the helper directory and executed.

The address of the repository of function files is specified in the property H :: $ remouteUrl Example

include 'H.php';
var_dump(H::bc('((($1+$2)*$3)-2)>=6',2,2,2));
var_dump(H::dirList('./')); 

Result

string(1) "1"
array(8) {
  [".gitignore"]=>
  string(10) ".gitignore"
  ["example.php"]=>
  string(11) "example.php"
  ["H.php"]=>
  string(5) "H.php"
  ["helper"]=>
  string(6) "helper"
  ["README.en.md"]=>
  string(12) "README.en.md"
  ["README.md"]=>
  string(9) "README.md"
}

  Files folder image Files  
File Role Description
Files folder imagehelper (17 files)
Accessible without login Plain text file example.php Aux. Auxiliary script
Plain text file H.php Class Class source
Accessible without login Plain text file README.en.md Doc. Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  helper  
File Role Description
  Accessible without login Plain text file arrayToJson.php Aux. Auxiliary script
  Accessible without login Plain text file arrayToXml.php Example Example script
  Accessible without login Plain text file bc.php Aux. Auxiliary script
  Accessible without login Plain text file checkInn.php Aux. Auxiliary script
  Accessible without login Plain text file checkKpp.php Aux. Auxiliary script
  Accessible without login Plain text file dec2hex.php Aux. Auxiliary script
  Accessible without login Plain text file dirList.php Example Example script
  Accessible without login Plain text file ean13Sum.php Aux. Auxiliary script
  Accessible without login Plain text file exec.php Aux. Auxiliary script
  Accessible without login Plain text file gen_rand_string.php Aux. Auxiliary script
  Accessible without login Plain text file hex2dec.php Aux. Auxiliary script
  Accessible without login Plain text file jsonToArray.php Aux. Auxiliary script
  Accessible without login Plain text file jsonToXml.php Example Example script
  Accessible without login Plain text file uuid.php Aux. Auxiliary script
  Accessible without login Plain text file wordEnd.php Aux. Auxiliary script
  Accessible without login Plain text file xmlToArray.php Example Example script
  Accessible without login Plain text file xmlToJson.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:182
This week:0
All time:8,396
This week:285Up