]> granicus.if.org Git - php/commitdiff
* support platform-specific files
authorStig Bakken <ssb@php.net>
Sun, 19 May 2002 06:19:26 +0000 (06:19 +0000)
committerStig Bakken <ssb@php.net>
Sun, 19 May 2002 06:19:26 +0000 (06:19 +0000)
pear/PEAR/Installer.php

index 0bbea5365a1770c7157288d8ebc56e293b1406d0..4341ea186422fee7a82138e4f36784caf118f3f8 100644 (file)
@@ -139,6 +139,19 @@ class PEAR_Installer extends PEAR_Common
 
     function _installFile($file, $atts, $tmp_path)
     {
+        static $os;
+        if (isset($atts['platform'])) {
+            if (empty($os)) {
+                include_once "OS/Guess.php";
+                $os = new OS_Guess();
+            }
+            // return if this file is meant for another platform
+            if (!$os->matchSignature($atts['platform'])) {
+                $this->log(1, "skipped $file (meant for $atts[platform], we are ".$os->getSignature().")");
+                return;
+            }
+        }
+
         switch ($atts['role']) {
             case 'test': case 'data': case 'ext':
                 // don't install test files for now