cvs: pear /PEAR_PackageFileManager PackageFileManager2.php

From: Date: Wed, 19 Oct 2005 04:55:24 +0000
Subject: cvs: pear /PEAR_PackageFileManager PackageFileManager2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-35705@lists.php.net to get a copy of this message
cellog Wed Oct 19 00:55:24 2005 EDT Modified files: /pear/PEAR_PackageFileManager PackageFileManager2.php Log: global replacements should occur before other tasks http://cvs.php.net/diff.php/pear/PEAR_PackageFileManager/PackageFileManager2.php?r1=1.13&r2=1.14&ty=u Index: pear/PEAR_PackageFileManager/PackageFileManager2.php diff -u pear/PEAR_PackageFileManager/PackageFileManager2.php:1.13 pear/PEAR_PackageFileManager/PackageFileManager2.php:1.14 --- pear/PEAR_PackageFileManager/PackageFileManager2.php:1.13 Tue Oct 18 20:53:25 2005 +++ pear/PEAR_PackageFileManager/PackageFileManager2.php Wed Oct 19 00:55:24 2005 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: PackageFileManager2.php,v 1.13 2005/10/19 00:53:25 cellog Exp $ + * @version CVS: $Id: PackageFileManager2.php,v 1.14 2005/10/19 04:55:24 cellog Exp $ * @link http://pear.php.net/package/PEAR_PackageFileManager * @since File available since Release 1.6.0 */ @@ -851,6 +851,10 @@ */ function addPostinstallTask($task, $path) { + // necessary for validation + $this->addFile('', $path, array('role' => 'php', 'name' => $path)); + $this->setPackagefile($this->_options['packagedirectory'] . + DIRECTORY_SEPARATOR . $this->_options['packagefile']); if (is_array($res = $task->validate())) { return $this->raiseError(PEAR_PACKAGEFILEMANAGER2_INVALID_POSTINSTALLSCRIPT, $res[1]); @@ -1149,13 +1153,13 @@ $atts = array('role' => $myrole); $diradd = dirname($files['path']); $this->addFile($diradd == '.' ? '/' : $diradd, $files['file'], $atts); - if (isset($replacements[$files['path']])) { - foreach ($replacements[$files['path']] as $task) { + if (isset($globalreplacements)) { + foreach ($globalreplacements as $task) { $this->addTaskToFile($files['path'], $task); } } - if (isset($globalreplacements)) { - foreach ($globalreplacements as $task) { + if (isset($replacements[$files['path']])) { + foreach ($replacements[$files['path']] as $task) { $this->addTaskToFile($files['path'], $task); } } @@ -1241,13 +1245,13 @@ } $diradd = dirname($files['path']); $this->addFile($diradd == '.' ? '/' : $diradd, $files['file'], $atts); - if (isset($replacements[$files['path']])) { - foreach ($replacements[$files['path']] as $task) { + if (isset($globalreplacements)) { + foreach ($globalreplacements as $task) { $this->addTaskToFile($files['path'], $task); } } - if (isset($globalreplacements)) { - foreach ($globalreplacements as $task) { + if (isset($replacements[$files['path']])) { + foreach ($replacements[$files['path']] as $task) { $this->addTaskToFile($files['path'], $task); } }

« previous php.pear.cvs (#35705) next »