Source of file AbstractListener.php
Size: 1,581 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/ModuleManager/Listener/AbstractListener.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\ModuleManager\Listener; /** * Abstract listener */ abstract class AbstractListener { /** * @var ListenerOptions */ protected $options; /** * __construct * * @param ListenerOptions $options */ public function __construct(ListenerOptions $options = null) { if (null === $options) { $this->setOptions(new ListenerOptions); } else { $this->setOptions($options); } } /** * Get options. * * @return ListenerOptions */ public function getOptions() { return $this->options; } /** * Set options. * * @param ListenerOptions $options the value to be set * @return AbstractListener */ public function setOptions(ListenerOptions $options) { $this->options = $options; return $this; } /** * Write a simple array of scalars to a file * * @param string $filePath * @param array $array * @return AbstractListener */ protected function writeArrayToFile($filePath, $array) { $content = "<?php\nreturn " . var_export($array, 1) . ';'; file_put_contents($filePath, $content); return $this; } } |