cvs: pear-core /PEAR/Task Replace.php
| From: | Greg Beaver | Date: | Tue, 26 Oct 2004 19:46:07 +0000 |
| Subject: | cvs: pear-core /PEAR/Task Replace.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-25261@lists.php.net to get a copy of this message | ||
cellog Tue Oct 26 15:46:07 2004 EDT
Modified files:
/pear-core/PEAR/Task Replace.php
Log:
remove pointless php-const replacement type
http://cvs.php.net/diff.php/pear-core/PEAR/Task/Replace.php?r1=1.3&r2=1.4&ty=u
Index: pear-core/PEAR/Task/Replace.php
diff -u pear-core/PEAR/Task/Replace.php:1.3 pear-core/PEAR/Task/Replace.php:1.4
--- pear-core/PEAR/Task/Replace.php:1.3 Sat Oct 2 00:46:57 2004
+++ pear-core/PEAR/Task/Replace.php Tue Oct 26 15:46:07 2004
@@ -30,14 +30,7 @@
if (!isset($xml['attribs']['from'])) {
return array(PEAR_TASK_ERROR_MISSING_ATTRIB, 'from');
}
- if ($xml['attribs']['type'] == 'php-const') {
- if (preg_match('/^[a-z0-9_]+$/i', $xml['attribs']['to']))
{
- return true;
- } else {
- return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE,
$xml['attribs']['type'],
- array('/^[a-z0-9_]+$/i'));
- }
- } elseif ($xml['attribs']['type'] == 'pear-config') {
+ if ($xml['attribs']['type'] == 'pear-config') {
if (!in_array($xml['attribs']['to'], $config->getKeys())) {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to',
$xml['attribs']['to'],
$config->getKeys());
@@ -58,7 +51,7 @@
}
} else {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'type',
$xml['attribs']['type'],
- array('php-const', 'pear-config', 'package-info'));
+ array('pear-config', 'package-info'));
}
}
@@ -88,14 +81,7 @@
foreach ($this->_replacements as $a) {
$a = $a['attribs'];
$to = '';
- if ($a['type'] == 'php-const') {
- if (preg_match('/^[a-z0-9_]+$/i', $a['to'])) {
- eval("\$to = $a[to];");
- } else {
- $this->installer->log(0, "invalid php-const replacement:
$a[to]");
- return false;
- }
- } elseif ($a['type'] == 'pear-config') {
+ if ($a['type'] == 'pear-config') {
if ($a['to'] == 'master_server') {
$chan = $this->registry->getChannel($pkg->getChannel());
if ($chan) {
@@ -111,7 +97,7 @@
$this->installer->log(0, "invalid pear-config replacement:
$a[to]");
return false;
}
- } elseif ($a['type'] == 'package-info') {
+ } else {
if ($t = $pkg->packageInfo($a['to'])) {
$to = $t;
} else {