RE: pecl4win patches

php.internals

Gaetano Giunta

19 years ago
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>