Updated PEAR and PEAR packages.
[timetracker.git] / WEB-INF / lib / pear / PEAR / Task / Replace / rw.php
1 <?php
2 /**
3  * <tasks:replace> - read/write version
4  *
5  * PHP versions 4 and 5
6  *
7  * @category  pear
8  * @package   PEAR
9  * @author    Greg Beaver <cellog@php.net>
10  * @copyright 1997-2009 The Authors
11  * @license   http://opensource.org/licenses/bsd-license.php New BSD License
12  * @link      http://pear.php.net/package/PEAR
13  * @since     File available since Release 1.4.0a10
14  */
15 /**
16  * Base class
17  */
18 require_once 'PEAR/Task/Replace.php';
19 /**
20  * Abstracts the replace task xml.
21  * @category   pear
22  * @package    PEAR
23  * @author     Greg Beaver <cellog@php.net>
24  * @copyright  1997-2009 The Authors
25  * @license    http://opensource.org/licenses/bsd-license.php New BSD License
26  * @version    Release: 1.10.1
27  * @link       http://pear.php.net/package/PEAR
28  * @since      Class available since Release 1.4.0a10
29  */
30 class PEAR_Task_Replace_rw extends PEAR_Task_Replace
31 {
32     public function __construct(&$pkg, &$config, &$logger, $fileXml)
33     {
34         parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
35         $this->_contents = $fileXml;
36         $this->_pkg = &$pkg;
37         $this->_params = array();
38     }
39
40     public function validate()
41     {
42         return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents);
43     }
44
45     public function setInfo($from, $to, $type)
46     {
47         $this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type));
48     }
49
50     public function getName()
51     {
52         return 'replace';
53     }
54
55     public function getXml()
56     {
57         return $this->_params;
58     }
59 }