Base.php 700 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace PicoFeed;
  3. use PicoFeed\Config\Config;
  4. use PicoFeed\Logging\Logger;
  5. /**
  6. * Base class
  7. *
  8. * @package PicoFeed
  9. * @author Frederic Guillot
  10. */
  11. abstract class Base
  12. {
  13. /**
  14. * Config class instance
  15. *
  16. * @access protected
  17. * @var \PicoFeed\Config\Config
  18. */
  19. protected $config;
  20. /**
  21. * Constructor.
  22. *
  23. * @param \PicoFeed\Config\Config $config Config class instance
  24. */
  25. public function __construct(Config $config = null)
  26. {
  27. $this->config = $config ?: new Config();
  28. Logger::setTimezone($this->config->getTimezone());
  29. }
  30. public function setConfig(Config $config) {
  31. $this->config = $config;
  32. }
  33. }