# pecl4win patches

- Thread: https://externals.io/message/29873
- Original archive: https://news-web.php.net/php.internals/29873
- Started by Gaetano Giunta on 2007-05-29T15:48:34+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #29873 — Gaetano Giunta — 2007-05-29T15:48:34+00:00

URL: https://externals.io/message/29873#29873

Here's one more little patch: add extension name and link to pecl site on
the pecl4win page listing a single extension (the underlying assumption is
files are named after extensions...)

--- ext.php    Tue May 29 17:40:20 2007
+++ ext2.php    Tue May 29 17:41:25 2007
@@ -7,7 +7,17 @@

 $args = explode("/", $_SERVER['PATH_INFO']);

-$q = safe_sql_str("select fname, branch, pversion, updated, filesize,
downloads from ext where updated in (select max(updated) from ext as maxext
where fname=!s GROUP BY branch) order by branch", $args[1]);
+if (preg_match('|^php[_56]([a-zA-Z0-9_-]*).dll$|', @$args[1], $matches)) {
+  $fname = $args[1];
+  $extname = $matches(1);
+}
+else {
+  $fname = '';
+  $extname = '';
+}
+
+
+$q = safe_sql_str("select fname, branch, pversion, updated, filesize,
downloads from ext where updated in (select max(updated) from ext as maxext
where fname=!s GROUP BY branch) order by branch", $fname);
 $res = $DB->query($q);
 $files = array();

@@ -21,7 +31,10 @@
 $layout->setTitle('The PECL Windows Repository');
 $layout->header();
 ?>
-<h2>Browse Extensions</h2>
+<h2>Browse Extensions: <?php echo htmlspecialchars($extname); ?></h2>
+<?php if (count($files)) { ?>
+Extension home page: <a href="http://pecl.php.net/packages/<?php echo
urlencode($extname); ?>">http://pecl.php.net/packages/<?php echo
htmlspecialchars($extname); ?></a>
+<?php } ?>
 <table id="packageList" border="0">
 <tbody><tr>
 <th class="form-label_left">#</th
