api.configforge.php 767 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. class ConfigForge {
  3. /**
  4. * Contains current config lines as index=>line
  5. *
  6. * @var array
  7. */
  8. protected $currentConfig = array();
  9. public function __construct() {
  10. }
  11. public function loadConfig($configPath) {
  12. if (is_readable($configPath)) {
  13. $configTmp = file_get_contents($configPath);
  14. if (!empty($configTmp)) {
  15. $this->currentConfig = explodeRows($configTmp);
  16. }
  17. }
  18. }
  19. public function renderEditor($config, $spec) {
  20. $result='';
  21. return($result);
  22. }
  23. }
  24. /**
  25. *
  26. * $forge->renderEditor('specfile.conf');
  27. *
  28. * [section]
  29. * CONFIG="config/alter.ini"
  30. * OPTION=ROTATOR_FAST
  31. * TYPE=TRIGGER
  32. * VALUES="1,0"
  33. * VALIDATOR=""
  34. *
  35. *
  36. */