Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

class.Output.inc.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * basic output functions
  4. *
  5. * PHP version 5
  6. *
  7. * @category PHP
  8. * @package PSI_Output
  9. * @author Michael Cramer <BigMichi1@users.sourceforge.net>
  10. * @copyright 2009 phpSysInfo
  11. * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
  12. * @version SVN: $Id: class.Output.inc.php 569 2012-04-16 06:08:18Z namiltd $
  13. * @link http://phpsysinfo.sourceforge.net
  14. */
  15. /**
  16. * basic output functions for all output formats
  17. *
  18. * @category PHP
  19. * @package PSI_Output
  20. * @author Michael Cramer <BigMichi1@users.sourceforge.net>
  21. * @copyright 2009 phpSysInfo
  22. * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
  23. * @version Release: 3.0
  24. * @link http://phpsysinfo.sourceforge.net
  25. */
  26. abstract class Output
  27. {
  28. /**
  29. * error object for logging errors
  30. *
  31. * @var Error
  32. */
  33. protected $error;
  34. /**
  35. * call the parent constructor and check for needed extensions
  36. */
  37. public function __construct()
  38. {
  39. $this->error = Error::singleton();
  40. $this->_checkConfig();
  41. CommonFunctions::checkForExtensions();
  42. // $this->error = Error::singleton();
  43. // $this->_checkConfig();
  44. }
  45. /**
  46. * read the config file and check for existence
  47. *
  48. * @return void
  49. */
  50. private function _checkConfig()
  51. {
  52. if (!is_readable(APP_ROOT.'/read_config.php')) {
  53. $this->error->addError('file_exists(read_config.php)', 'read_config.php does not exist or is not readable by the webserver in the phpsysinfo directory.');
  54. } else {
  55. include_once APP_ROOT.'/read_config.php';
  56. }
  57. if ($this->error->errorsExist()) {
  58. $this->error->errorsAsXML();
  59. }
  60. }
  61. }