Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
33.33% |
1 / 3 |
CRAP | |
4.05% |
3 / 74 |
| iaLibAutoLoader | |
0.00% |
0 / 1 |
|
33.33% |
1 / 3 |
80.54 | |
4.05% |
3 / 74 |
| __construct | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 11 |
|||
| iaClasses | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 60 |
|||
| loader | |
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
|||
| getClasses | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
| <?php | |
| /** | |
| * autload ia classes | |
| * | |
| */ | |
| class iaLibAutoLoader { | |
| protected $ia_path = null; | |
| protected $classmap = array(); | |
| /** | |
| * Registers autload function. | |
| * | |
| * @return void | |
| */ | |
| public function __construct() { | |
| if($this->ia_path === null) { | |
| global $gConfig; | |
| if(isset($gConfig['iaLibFSPath'])) { | |
| $this->ia_path = $gConfig['iaLibFSPath']; | |
| } else { | |
| $this->ia_path = __DIR__ ; | |
| } | |
| } | |
| $lastChar = substr($this->ia_path, -1); | |
| if($lastChar === '/' || $lastChar === DIRECTORY_SEPARATOR) { | |
| $this->ia_path = substr($this->ia_path, 0, -1); | |
| } | |
| $this->iaClasses(); | |
| spl_autoload_register(array($this, 'loader')); | |
| } | |
| /** | |
| * Default ia class or namespace\class to autload in this autloader. | |
| * | |
| * @return void | |
| */ | |
| protected function iaClasses() { | |
| // ia_bitacora_widget | |
| // ia_situaciones_widget | |
| // issues widget | |
| // help widget | |
| // workday widget | |
| // pwd, reset | |
| // roles widget | |
| // settings widget | |
| $this->classmap['ia\Sql\Mysql\IaMysqli'] = $this->ia_path.'/../Sql/src/mysql/IaMysqli.php'; | |
| $this->classmap['ia\Sql\Mysql\SqlBuilder'] = $this->ia_path.'/../Sql/src/mysql/SqlBuilder.php'; | |
| $this->classmap['ia\Sql\Mysql\SqlInfo'] = $this->ia_path.'/../Sql/src/mysql/SqlInfo.php'; | |
| $this->classmap['ia\Sql\Mysql\QueryInfo'] = $this->ia_path.'/../Sql/src/mysql/QueryInfo.php'; | |
| $this->classmap['ia\Sql\Mysql\CommonQueries'] = $this->ia_path.'/../Sql/src/mysql/CommonQueries.php'; | |
| $this->classmap['ia\Sql\Mysql\MultipleInsert'] = $this->ia_path.'/../Sql/src/mysql/MultipleInsert.php'; | |
| $this->classmap['ia\Sql\Mysql\SqlTable'] = $this->ia_path.'/../Sql/src/mysql/SqlTable.php'; | |
| $this->classmap['iaSqlite'] = $this->ia_path.'/../Sql/src/sqlite3/iaSqlite.php'; | |
| $this->classmap['ia\Date\DateFormatter'] = $this->ia_path.'/../Date/src/DateFormatter.php'; | |
| $this->classmap['ia\Date\DateUtil'] = $this->ia_path.'/../Date/src/DateUtil.php'; | |
| $this->classmap['ia\Date\YearMonth'] = $this->ia_path.'/../Date/src/YearMonth.php'; | |
| $this->classmap['ia\DevTools\iaTimer'] = $this->ia_path.'/../DevTools/src/iaTimer.php'; | |
| $this->classmap['ia\DocumentIt\DocumentIt'] = $this->ia_path.'/../DocumentIt/src/DocumentIt.php'; | |
| $this->classmap['ia\DocumentIt\PerfilExample'] = $this->ia_path.'/../DocumentIt/src/PerfilExample.php'; | |
| $this->classmap['ia\Geo\GeoHash'] = $this->ia_path.'/../Geo/src/GeoHash.php'; | |
| $this->classmap['ia\Geo\GeoDNA'] = $this->ia_path.'/../Geo/src/GeoDNA.php'; | |
| $this->classmap['ia\JqGrid\JqGridRead'] = $this->ia_path.'/../JqGrid/src/JqGridRead.php'; | |
| $this->classmap['ia\JqGrid\Filter2where'] = $this->ia_path.'/../JqGrid/src/Filter2where.php'; | |
| $this->classmap['ia\Math\BcMath'] = $this->ia_path.'/../Math/src/BcMath.php'; | |
| $this->classmap['ia\Math\Combination'] = $this->ia_path.'/../Math/src/Combination.php'; | |
| $this->classmap['ia\Math\Math'] = $this->ia_path.'/../Math/src/Math.php'; | |
| $this->classmap['ia\Math\Permutation'] = $this->ia_path.'/../Math/src/Permutation.php'; | |
| $this->classmap['ia\Math\Stats'] = $this->ia_path.'/../Math/src/Stats.php'; | |
| $this->classmap['ia\Math\StatsTotalIt'] = $this->ia_path.'/../Math/src/StatsTotalIt.php'; | |
| $this->classmap['ia\Work\WorkDay\WorkDay'] = $this->ia_path.'/../Work/src/WorkDay/WorkDay.php'; | |
| $this->classmap['ia\Work\WorkDay\WorkDayCalculator'] = $this->ia_path.'/../Work/src/WorkDay/WorkDayCalculator.php'; | |
| $this->classmap['ia\Work\WorkDay\WorkHourCalculator'] = $this->ia_path.'/../Work/src/WorkDay/WorkHourCalculator.php'; | |
| $this->classmap['ia\Work\Workflow\WF_dateIt'] = $this->ia_path.'/../Work/src/Workflow/WF_dateIt.php'; | |
| $this->classmap['ia\Work\Workflow\WF_DisplayTable'] = $this->ia_path.'/../Work/src/Workflow/WF_DisplayTable.php'; | |
| $this->classmap['ia\Work\Workflow\WF_template'] = $this->ia_path.'/../Work/src/Workflow/WF_template.php'; | |
| $this->classmap['ia\Work\Workflow\wfx'] = $this->ia_path.'/../Work/src/Workflow/wfx.php'; | |
| $this->classmap['ia\Lib\iaErrorReporter'] = $this->ia_path.'/iaErrorReporter.php'; | |
| $this->classmap['ia\Lib\iaErrorReporterDisplay'] = $this->ia_path.'/iaErrorReporterDisplay.php'; | |
| $this->classmap['ia\Util\Str'] = $this->ia_path.'/../Util/src/Str.php'; | |
| $this->classmap['ia\Util\XlsxUtil'] = $this->ia_path.'/../Util/src/XlsxUtil.php'; | |
| $this->classmap['ia\Util\FormatIt'] = $this->ia_path.'/../Util/src/FormatIt.php'; | |
| $this->classmap['ia\Util\FileIt'] = $this->ia_path.'/../Util/src/FileIt.php'; | |
| $this->classmap['ia\Lib\iaArray'] = $this->ia_path.'/iaArray.php'; | |
| $this->classmap['ia\Lib\iaFileUploader'] = $this->ia_path.'/iaFileUploader.php'; | |
| $this->classmap['ia\Lib\iaUploadFile'] = $this->ia_path.'/iaUploadFile.php'; | |
| $this->classmap['ia\Lib\iaFiller'] = $this->ia_path.'/iaFiller.php'; | |
| $this->classmap['ia\Lib\iaLib'] = $this->ia_path.'/iaLib.php'; | |
| $this->classmap['ia\Lib\Synonyms'] = $this->ia_path.'/Synonyms.php'; | |
| // $this->classmap['ia\Lib\iaNumbers2Ranges'] = $this->ia_path.'/iaNumbers2Ranges.php'; | |
| $this->classmap['ia\Lib\iaPalabra'] = $this->ia_path.'/iaPalabra.php'; | |
| $this->classmap['ia\Lib\iaParametros'] = $this->ia_path.'/iaParametros.php'; | |
| $this->classmap['ia\Lib\iaPwd'] = $this->ia_path.'/iaPwd.php'; | |
| $this->classmap['ia\Lib\iaRanger'] = $this->ia_path.'/iaRanger.php'; | |
| $this->classmap['ia\Lib\iaTableIt'] = $this->ia_path.'/iaTableIt.php'; | |
| $this->classmap['ia\Lib\iaReMapKeys'] = $this->ia_path.'/iaReMapKeys.php'; | |
| $this->classmap['ia\Lib\iaSynonims'] = $this->ia_path.'/iaSynonims.php'; | |
| $this->classmap['ia\Cache\CachePhp'] = $this->ia_path.'/../Cache/src/CachePhp.php'; | |
| $this->classmap['ia\Data\MexicoEstados'] = $this->ia_path.'/../Data/src/MexicoEstados.php'; | |
| $this->classmap['ia\User\CurrentUser'] = $this->ia_path.'/../User/src/CurrentUser.php'; | |
| $this->classmap['ia\Log\Bitacora'] = $this->ia_path.'/../Log/src/Bitacora.php'; | |
| $this->classmap['iaLibAutoLoader'] = $this->ia_path.'/iaLibAutoLoader.php'; | |
| // inc_lib | |
| $this->classmap['XLSXWriter'] = $this->ia_path.'/../../inc_lib/xlsxwriter.class.php'; | |
| $this->classmap['PushId'] = $this->ia_path.'/../../inc_lib/PushId.php'; // firebase pushid uuid guid 20 bytes cronological | |
| $this->classmap['URLify'] = $this->ia_path.'/../../inc_lib/URLify.php'; // unaccent also DamerauLevenshtein | |
| // $this->classmap['Oefenweb\DamerauLevenshtein\DamerauLevenshtein'] = $this->ia_path.'/../inc_lib/DamerauLevenshtein.php'; | |
| $this->classmap['AesCipher'] = $this->ia_path.'/../../inc_lib/AesCipher.php'; | |
| } | |
| /** | |
| * autload registered function. | |
| * | |
| * @param string $class | |
| * @return void | |
| */ | |
| public function loader($class) { | |
| if(array_key_exists($class, $this->classmap)) { | |
| require_once( $this->classmap[$class] ); | |
| } | |
| } | |
| public function getClasses() {return $this->classmap;} | |
| } | |
| new iaLibAutoLoader(); |