svn: /pear/pearweb/trunk/cron/ find-documentation.php

[email protected] ("Daniel O'Connor") Thu, 09 Sep 2010 07:56:13 +0000
Newsgroups php.pear.cvs,php.pear.core
Message-ID <[email protected]>
clockwerx                                Thu, 09 Sep 2010 07:56:13 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=303207

Log:
Render to stdout when the regex fails

Changed paths:
    U   pear/pearweb/trunk/cron/find-documentation.php

Modified: pear/pearweb/trunk/cron/find-documentation.php
===================================================================
--- pear/pearweb/trunk/cron/find-documentation.php	2010-09-09 07:53:57 UTC (rev 303206)
+++ pear/pearweb/trunk/cron/find-documentation.php	2010-09-09 07:56:13 UTC (rev 303207)
@@ -92,6 +92,11 @@
                 preg_match("/<title>\s*(\w+)\s*<\/title>/s", $content, $matches1);
                 preg_match("/<book.*?xml:id\=\"(.*?)\"\s*>/s", $content, $matches2);

+                if (empty($matches2)) {
+                    print "Unable to match /<book.*?xml:id\=\"(.*?)\"\s*>/s for " . $path . ", skipping";
+                    continue;
+                }
+
                 $url = '/manual/en/' . $matches2[1] . '.php';

                 $request = new HTTP_Request2($host . $url);