BxDolLogsStoragePHPLog.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. class BxDolLogsStoragePHPLog extends BxDolLogsStorageFolder implements iBxDolSingleton
  10. {
  11. /**
  12. * Get singleton instance of the class
  13. */
  14. public static function getInstance()
  15. {
  16. if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
  17. $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolLogsStoragePHPLog();
  18. return $GLOBALS['bxDolClasses'][__CLASS__];
  19. }
  20. /**
  21. * Write to log
  22. * @param $oObject logs object
  23. * @param $mixed string or array to log
  24. * @return true on success or false on error
  25. */
  26. public function add($oObject, $mixed, $iLevel)
  27. {
  28. if (!$mixed)
  29. return true;
  30. $s = $this->formatLogString($oObject, $mixed, true, $iLevel);
  31. return error_log($s, 0);
  32. }
  33. /**
  34. * Not supported
  35. */
  36. public function get($oObject, $iLines, $sFilter = false)
  37. {
  38. return false;
  39. }
  40. /**
  41. * Check if filtering supported in `get` method
  42. */
  43. public function isFilterAvail()
  44. {
  45. return false;
  46. }
  47. /**
  48. * Check if `get` method available
  49. */
  50. public function isGetAvail()
  51. {
  52. return false;
  53. }
  54. }
  55. /** @} */