cvs: pear-core /PEAR Installer.php /PEAR/Installer/Role Common.php Data.php Doc.php Ext.php Php.php Script.php Test.php

From: Date: Sat, 23 Oct 2004 03:46:02 +0000
Subject: cvs: pear-core /PEAR Installer.php /PEAR/Installer/Role Common.php Data.php Doc.php Ext.php Php.php Script.php Test.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-1126@lists.php.net to get a copy of this message
cellog Fri Oct 22 23:46:02 2004 EDT Modified files: /pear-core/PEAR Installer.php /pear-core/PEAR/Installer/Role Common.php Data.php Doc.php Ext.php Php.php Script.php Test.php Log: add extra helpful message for extensions if an attempt is made to install them over extensions that are in use by the current PHP process

http://cvs.php.net/diff.php/pear-core/PEAR/Installer.php?r1=1.169&r2=1.170&ty=u Index: pear-core/PEAR/Installer.php diff -u pear-core/PEAR/Installer.php:1.169 pear-core/PEAR/Installer.php:1.170 --- pear-core/PEAR/Installer.php:1.169 Fri Oct 22 19:17:27 2004 +++ pear-core/PEAR/Installer.php Fri Oct 22 23:46:02 2004 @@ -19,7 +19,7 @@ // | Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.169 2004/10/22 23:17:27 cellog Exp $ +// $Id: Installer.php,v 1.170 2004/10/23 03:46:02 cellog Exp $ require_once 'PEAR/Downloader.php'; require_once 'PEAR/Task/Common.php'; @@ -377,7 +377,8 @@ } } // }}} - $this->addFileOperation("rename", array($dest_file, $final_dest_file)); + $this->addFileOperation("rename", array($dest_file, $final_dest_file, + $atts['role'] == 'ext')); // Store the full path where the file was installed for easy unistall $this->addFileOperation("installed_as", array($file, $installed_as, $save_destdir, dirname(substr($dest_file, strlen($save_destdir))))); @@ -511,7 +512,7 @@ } } // }}} - $this->addFileOperation("rename", array($dest_file, $final_dest_file)); + $this->addFileOperation("rename", array($dest_file, $final_dest_file, $role->isExtension())); // Store the full path where the file was installed for easy unistall $this->addFileOperation("installed_as", array($file, $installed_as, $save_destdir, dirname(substr($dest_file, strlen($save_destdir))))); @@ -528,7 +529,7 @@ * * @see startFileTransaction() * @param string $type This can be one of: - * - rename: rename a file ($data has 2 values) + * - rename: rename a file ($data has 3 values) * - backup: backup an existing file ($data has 1 value) * - removebackup: clean up backups created during install ($data has 1 value) * - chmod: change permissions on a file ($data has 2 values) @@ -538,7 +539,7 @@ * @param array $data For all file operations, this array must contain the * full path to the file or directory that is being operated on. For * the rename command, the first parameter must be the file to rename, - * the second its new name. + * the second its new name, the third whether this is a PHP extension. * * The installed_as operation contains 4 elements in this order: * 1. Filename as listed in the filelist element from package.xml @@ -646,8 +647,14 @@ case 'rename': $test = @unlink($data[1]); if (!$test && file_exists($data[1])) { + if ($data[2]) { + $extra = ', this extension must be installed manually. Rename to "' . + basename($data[1]) . '"'; + } else { + $extra = ''; + } $this->log(1, 'Could not delete ' . $data[1] . ', cannot rename ' . - $data[0]); + $data[0] . $extra); return false; } @rename($data[0], $data[1]); http://cvs.php.net/diff.php/pear-core/PEAR/Installer/Role/Common.php?r1=1.1&r2=1.2&ty=u Index: pear-core/PEAR/Installer/Role/Common.php diff -u pear-core/PEAR/Installer/Role/Common.php:1.1 pear-core/PEAR/Installer/Role/Common.php:1.2 --- pear-core/PEAR/Installer/Role/Common.php:1.1 Thu Sep 30 15:22:08 2004 +++ pear-core/PEAR/Installer/Role/Common.php Fri Oct 22 23:46:02 2004 @@ -29,6 +29,7 @@ 'honorsbaseinstall' => true, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); /** * This is used at startup to initialize the list of valid file roles, and what each role @@ -46,6 +47,7 @@ 'honorsbaseinstall' => true, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); } @@ -137,5 +139,10 @@ { return $this->_setup['installable']; } + + function isExtension() + { + return $this->_setup['phpextension']; + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear-core/PEAR/Installer/Role/Data.php?r1=1.1&r2=1.2&ty=u Index: pear-core/PEAR/Installer/Role/Data.php diff -u pear-core/PEAR/Installer/Role/Data.php:1.1 pear-core/PEAR/Installer/Role/Data.php:1.2 --- pear-core/PEAR/Installer/Role/Data.php:1.1 Thu Sep 30 15:22:08 2004 +++ pear-core/PEAR/Installer/Role/Data.php Fri Oct 22 23:46:02 2004 @@ -9,6 +9,7 @@ 'honorsbaseinstall' => false, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); function getInfo() { @@ -19,6 +20,7 @@ 'honorsbaseinstall' => false, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); } http://cvs.php.net/diff.php/pear-core/PEAR/Installer/Role/Doc.php?r1=1.1&r2=1.2&ty=u Index: pear-core/PEAR/Installer/Role/Doc.php diff -u pear-core/PEAR/Installer/Role/Doc.php:1.1 pear-core/PEAR/Installer/Role/Doc.php:1.2 --- pear-core/PEAR/Installer/Role/Doc.php:1.1 Thu Sep 30 15:22:08 2004 +++ pear-core/PEAR/Installer/Role/Doc.php Fri Oct 22 23:46:02 2004 @@ -9,6 +9,7 @@ 'honorsbaseinstall' => false, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); function getInfo() { @@ -19,6 +20,7 @@ 'honorsbaseinstall' => false, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); } http://cvs.php.net/diff.php/pear-core/PEAR/Installer/Role/Ext.php?r1=1.1&r2=1.2&ty=u Index: pear-core/PEAR/Installer/Role/Ext.php diff -u pear-core/PEAR/Installer/Role/Ext.php:1.1 pear-core/PEAR/Installer/Role/Ext.php:1.2 --- pear-core/PEAR/Installer/Role/Ext.php:1.1 Wed Oct 20 14:45:51 2004 +++ pear-core/PEAR/Installer/Role/Ext.php Fri Oct 22 23:46:02 2004 @@ -9,6 +9,7 @@ 'honorsbaseinstall' => true, 'phpfile' => false, 'executable' => false, + 'phpextension' => true, ); function getInfo() { @@ -19,6 +20,7 @@ 'honorsbaseinstall' => true, 'phpfile' => false, 'executable' => false, + 'phpextension' => true, ); } http://cvs.php.net/diff.php/pear-core/PEAR/Installer/Role/Php.php?r1=1.1&r2=1.2&ty=u Index: pear-core/PEAR/Installer/Role/Php.php diff -u pear-core/PEAR/Installer/Role/Php.php:1.1 pear-core/PEAR/Installer/Role/Php.php:1.2 --- pear-core/PEAR/Installer/Role/Php.php:1.1 Thu Sep 30 15:22:08 2004 +++ pear-core/PEAR/Installer/Role/Php.php Fri Oct 22 23:46:02 2004 @@ -9,6 +9,7 @@ 'honorsbaseinstall' => true, 'phpfile' => true, 'executable' => false, + 'phpextension' => false, ); function getInfo() { @@ -19,6 +20,7 @@ 'honorsbaseinstall' => true, 'phpfile' => true, 'executable' => false, + 'phpextension' => false, ); } http://cvs.php.net/diff.php/pear-core/PEAR/Installer/Role/Script.php?r1=1.1&r2=1.2&ty=u Index: pear-core/PEAR/Installer/Role/Script.php diff -u pear-core/PEAR/Installer/Role/Script.php:1.1 pear-core/PEAR/Installer/Role/Script.php:1.2 --- pear-core/PEAR/Installer/Role/Script.php:1.1 Thu Sep 30 15:22:08 2004 +++ pear-core/PEAR/Installer/Role/Script.php Fri Oct 22 23:46:02 2004 @@ -9,6 +9,7 @@ 'honorsbaseinstall' => true, 'phpfile' => false, 'executable' => true, + 'phpextension' => false, ); function getInfo() { @@ -19,6 +20,7 @@ 'honorsbaseinstall' => true, 'phpfile' => false, 'executable' => true, + 'phpextension' => false, ); } http://cvs.php.net/diff.php/pear-core/PEAR/Installer/Role/Test.php?r1=1.1&r2=1.2&ty=u Index: pear-core/PEAR/Installer/Role/Test.php diff -u pear-core/PEAR/Installer/Role/Test.php:1.1 pear-core/PEAR/Installer/Role/Test.php:1.2 --- pear-core/PEAR/Installer/Role/Test.php:1.1 Thu Sep 30 15:22:08 2004 +++ pear-core/PEAR/Installer/Role/Test.php Fri Oct 22 23:46:02 2004 @@ -9,6 +9,7 @@ 'honorsbaseinstall' => false, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); function getInfo() { @@ -19,6 +20,7 @@ 'honorsbaseinstall' => false, 'phpfile' => false, 'executable' => false, + 'phpextension' => false, ); }
« previous php.pear.core (#1126) next »