Редакция 69 | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 69 | Редакция 94 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | /**
|
2 | /**
|
3 | * <tasks:replace> - read/write version
|
3 | * <tasks:replace> - read/write version
|
4 | *
|
4 | *
|
5 | * PHP versions 4 and 5
|
5 | * PHP versions 4 and 5
|
6 | *
|
6 | *
|
7 | * LICENSE: This source file is subject to version 3.0 of the PHP license
|
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:
|
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
|
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
|
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.
|
11 | * send a note to license@php.net so we can mail you a copy immediately.
|
12 | *
|
12 | *
|
13 | * @category pear
|
13 | * @category pear
|
14 | * @package PEAR
|
14 | * @package PEAR
|
15 | * @author Greg Beaver <cellog@php.net>
|
15 | * @author Greg Beaver <cellog@php.net>
|
16 | * @copyright 1997-2008 The PHP Group
|
16 | * @copyright 1997-2008 The PHP Group
|
17 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
17 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
18 | * @version CVS: $Id: rw.php,v 1.4 2008/01/03 20:26:37 cellog Exp $
|
18 | * @version CVS: $Id: rw.php,v 1.4 2008/01/03 20:26:37 cellog Exp $
|
19 | * @link http://pear.php.net/package/PEAR
|
19 | * @link http://pear.php.net/package/PEAR
|
20 | * @since File available since Release 1.4.0a10
|
20 | * @since File available since Release 1.4.0a10
|
21 | */
|
21 | */
|
22 | /**
|
22 | /**
|
23 | * Base class
|
23 | * Base class
|
24 | */
|
24 | */
|
25 | require_once 'PEAR/Task/Replace.php'; |
25 | require_once 'PEAR/Task/Replace.php'; |
26 | /**
|
26 | /**
|
27 | * Abstracts the replace task xml.
|
27 | * Abstracts the replace task xml.
|
28 | * @category pear
|
28 | * @category pear
|
29 | * @package PEAR
|
29 | * @package PEAR
|
30 | * @author Greg Beaver <cellog@php.net>
|
30 | * @author Greg Beaver <cellog@php.net>
|
31 | * @copyright 1997-2008 The PHP Group
|
31 | * @copyright 1997-2008 The PHP Group
|
32 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
32 | * @license http://www.php.net/license/3_0.txt PHP License 3.0
|
33 | * @version Release: 1.7.2
|
33 | * @version Release: 1.7.2
|
34 | * @link http://pear.php.net/package/PEAR
|
34 | * @link http://pear.php.net/package/PEAR
|
35 | * @since Class available since Release 1.4.0a10
|
35 | * @since Class available since Release 1.4.0a10
|
36 | */
|
36 | */
|
37 | class PEAR_Task_Replace_rw extends PEAR_Task_Replace |
37 | class PEAR_Task_Replace_rw extends PEAR_Task_Replace |
38 | {
|
38 | {
|
39 | function PEAR_Task_Replace_rw(&$pkg, &$config, &$logger, $fileXml) |
39 | function PEAR_Task_Replace_rw(&$pkg, &$config, &$logger, $fileXml) |
40 | {
|
40 | {
|
41 | parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); |
41 | parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); |
42 | $this->_contents = $fileXml; |
42 | $this->_contents = $fileXml; |
43 | $this->_pkg = &$pkg; |
43 | $this->_pkg = &$pkg; |
44 | $this->_params = array(); |
44 | $this->_params = array(); |
45 | }
|
45 | }
|
46 | 46 | ||
47 | function validate() |
47 | function validate() |
48 | {
|
48 | {
|
49 | return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents); |
49 | return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents); |
50 | }
|
50 | }
|
51 | 51 | ||
52 | function setInfo($from, $to, $type) |
52 | function setInfo($from, $to, $type) |
53 | {
|
53 | {
|
54 | $this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type)); |
54 | $this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type)); |
55 | }
|
55 | }
|
56 | 56 | ||
57 | function getName() |
57 | function getName() |
58 | {
|
58 | {
|
59 | return 'replace'; |
59 | return 'replace'; |
60 | }
|
60 | }
|
61 | 61 | ||
62 | function getXml() |
62 | function getXml() |
63 | {
|
63 | {
|
64 | return $this->_params; |
64 | return $this->_params; |
65 | }
|
65 | }
|
66 | }
|
66 | }
|
67 | ?>
|
67 | ?>
|