packages: rpm/rpm-php-requires.php - efficent function use

glen glen at pld-linux.org
Wed Dec 2 14:37:58 CET 2009


Author: glen                         Date: Wed Dec  2 13:37:58 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- efficent function use

---- Files affected:
packages/rpm:
   rpm-php-requires.php (1.8 -> 1.9) 

---- Diffs:

================================================================
Index: packages/rpm/rpm-php-requires.php
diff -u packages/rpm/rpm-php-requires.php:1.8 packages/rpm/rpm-php-requires.php:1.9
--- packages/rpm/rpm-php-requires.php:1.8	Wed Oct 22 17:01:21 2008
+++ packages/rpm/rpm-php-requires.php	Wed Dec  2 14:37:53 2009
@@ -7,6 +7,9 @@
  * Paweł Gołaszewski <blues at pld-linux.org> (Perl version)
  * Michał Moskal <malekith at pld-linux.org> (Perl version)
  * Elan Ruusamäe <glen at pld-linux.org>
+ *
+ * Requires: php-pear-PHP_CompatInfo
+ * Requires: php-pcre
  */
 
 /**
@@ -34,7 +37,7 @@
 			$file_dir = null;
 		}
 
-		foreach (explode(PHP_EOL, file_get_contents($f)) as $line) {
+		foreach (file($f) as $line) {
 			// skip comments
 			if (preg_match('/^\s*(#|\/\/|\*|\/\*)/', $line)) {
 				continue;
@@ -100,7 +103,7 @@
 		if (array_key_exists($f, $files)) {
 			continue;
 		}
-		print "pear($f)\n";
+		echo "pear($f)\n";
 	}
 }
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpm/rpm-php-requires.php?r1=1.8&r2=1.9&f=u



More information about the pld-cvs-commit mailing list