| 94 |
jpm |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* <tasks:replace> - read/write version
|
|
|
4 |
*
|
|
|
5 |
* PHP versions 4 and 5
|
|
|
6 |
*
|
|
|
7 |
* LICENSE: This source file is subject to version 3.0 of the PHP license
|
|
|
8 |
* that is available through the world-wide-web at the following URI:
|
|
|
9 |
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
|
|
|
10 |
* the PHP License and are unable to obtain it through the web, please
|
|
|
11 |
* send a note to license@php.net so we can mail you a copy immediately.
|
|
|
12 |
*
|
|
|
13 |
* @category pear
|
|
|
14 |
* @package PEAR
|
|
|
15 |
* @author Greg Beaver <cellog@php.net>
|
|
|
16 |
* @copyright 1997-2006 The PHP Group
|
|
|
17 |
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
|
|
18 |
* @version CVS: $Id: rw.php,v 1.3 2006/01/06 04:47:37 cellog Exp $
|
|
|
19 |
* @link http://pear.php.net/package/PEAR
|
|
|
20 |
* @since File available since Release 1.4.0a10
|
|
|
21 |
*/
|
|
|
22 |
/**
|
|
|
23 |
* Base class
|
|
|
24 |
*/
|
|
|
25 |
require_once 'PEAR/Task/Replace.php';
|
|
|
26 |
/**
|
|
|
27 |
* Abstracts the replace task xml.
|
|
|
28 |
* @category pear
|
|
|
29 |
* @package PEAR
|
|
|
30 |
* @author Greg Beaver <cellog@php.net>
|
|
|
31 |
* @copyright 1997-2006 The PHP Group
|
|
|
32 |
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
|
|
33 |
* @version Release: 1.5.1
|
|
|
34 |
* @link http://pear.php.net/package/PEAR
|
|
|
35 |
* @since Class available since Release 1.4.0a10
|
|
|
36 |
*/
|
|
|
37 |
class PEAR_Task_Replace_rw extends PEAR_Task_Replace
|
|
|
38 |
{
|
|
|
39 |
function PEAR_Task_Replace_rw(&$pkg, &$config, &$logger, $fileXml)
|
|
|
40 |
{
|
|
|
41 |
parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
|
|
|
42 |
$this->_contents = $fileXml;
|
|
|
43 |
$this->_pkg = &$pkg;
|
|
|
44 |
$this->_params = array();
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
function validate()
|
|
|
48 |
{
|
|
|
49 |
return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents);
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
function setInfo($from, $to, $type)
|
|
|
53 |
{
|
|
|
54 |
$this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type));
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
function getName()
|
|
|
58 |
{
|
|
|
59 |
return 'replace';
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
function getXml()
|
|
|
63 |
{
|
|
|
64 |
return $this->_params;
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
?>
|