Commit:    b6068a4014ebcb0287154c2c50aa2c470c73307b
Author:    Hannes Magnusson <[email protected]>         Mon, 20 Apr 2015 15:56:24 
-0700
Parents:   f37ad96be2127f15cd18d288b9adb66bd0c56a93
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=b6068a4014ebcb0287154c2c50aa2c470c73307b

Log:
Allow namespace\classname searches

Changed paths:
  M  include/manual-lookup.inc


Diff:
diff --git a/include/manual-lookup.inc b/include/manual-lookup.inc
index c6c612a..b2e6668 100644
--- a/include/manual-lookup.inc
+++ b/include/manual-lookup.inc
@@ -39,6 +39,13 @@ function tryprefix($lang, $keyword, $prefix)
         if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
     }
 
+    // Replace namespace sperators, and try that (if different)
+    $noul = str_replace("\\", "-", $keyword);
+    if ($noul != $keyword) {
+        $try = "/manual/${lang}/${prefix}${noul}.php";
+        if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
+    }
+
     // Nothing found
     return "";
 }
@@ -169,7 +176,7 @@ function find_manual_page($lang, $keyword)
         
             $stm = $dbh->prepare($SQL);
             if ($stm) {
-                $stm->execute(array($lang, $keyword, str_replace(' ', '', 
$keyword), str_replace(' ', '-', $keyword), str_replace('-', '', $keyword), 
$keyword));
+                $stm->execute(array($lang, $keyword, str_replace('\\', '-', 
$keyword), str_replace(' ', '', $keyword), str_replace(' ', '-', $keyword), 
str_replace('-', '', $keyword), $keyword));
             }
         }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to