SAND-framework/application/class/ModularRegister.php

31 lines
748 B
PHP
Raw Normal View History

<?php
namespace MVC\Classe;
2020-12-09 10:26:26 +01:00
class ModularRegister
{
public $registry = array();
public $index = array();
2020-12-09 10:26:26 +01:00
public function __construct()
{
2019-08-12 15:10:25 +02:00
$fichier = file(MODULES_PATH . DIRECTORY_SEPARATOR . "setup" . DIRECTORY_SEPARATOR ."registre.model");
foreach ($fichier as $ligne_num => $ligne) {
2019-08-12 15:10:25 +02:00
if (preg_match("#([ ]*[a-zA-Z0-9-_+éèàùïîç]*)[ ]*[:][ ]*([0-9a-zA-Z-_+ 'éèàùïîç.]*[ ]*)#", $ligne, $matches)) {
$this->registry[$matches[1]] = $matches[2];
$this->index[] = $matches[1];
}
}
}
2020-12-09 10:26:26 +01:00
public function getRegistre()
{
2019-08-12 15:10:25 +02:00
return $this->registry;
}
2020-12-09 10:26:26 +01:00
public function getIndex()
{
2019-08-12 15:10:25 +02:00
return $this->index;
}
2020-12-09 10:26:26 +01:00
}