Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #28 from boenrobot/addCat

Added category to the main file template
  • Loading branch information...
commit 14365de072568de5bb651ac7623b2209ad624c94 2 parents bd72b72 + 7d19c17
@saltybeagle saltybeagle authored
View
4 data/pear2skeleton/src/Main.php
@@ -4,7 +4,7 @@
*
* PHP version 5.3
*
- * @category Yourcategory
+ * @category __CATEGORY__
* @package __PACKAGE__
* @author Your Name <handle@php.net>
* @copyright __YEAR__ Your Name
@@ -16,7 +16,7 @@
/**
* Main class for __PACKAGE__
*
- * @category Yourcategory
+ * @category __CATEGORY__
* @package __PACKAGE__
* @author Your Name <handle@php.net>
* @copyright __YEAR__ Your Name
View
8 src/Pyrus/Developer/PackageFile/Commands.php
@@ -682,7 +682,9 @@ public function pear2Skeleton($frontend, array $args, array $options)
*/
public static function parsePackageName($package, $channel)
{
- $ret = array();
+ $ret = array(
+ '__CATEGORY__' => 'default'
+ );
$package = explode('_', $package);
if ($channel == 'pear2.php.net') {
if ($package[0] != 'PEAR2') {
@@ -699,6 +701,9 @@ public static function parsePackageName($package, $channel)
$ret['__REPO__'] = 'http://github.com/pear2/' .
implode('_', $package);
+ if (count($package) > 2) {
+ $ret['__CATEGORY__'] = $package[1];
+ }
} else {
$ret['__REPO__'] = 'http://' . $channel . '/' .
implode('_', $package);
@@ -710,6 +715,7 @@ public static function parsePackageName($package, $channel)
$ret['__MAIN_PATH__'] = implode('/', $package);
$ret['__MAIN_CLASS__'] = array_pop($package);
$ret['__MAIN_NAMESPACE__'] = implode('\\', $package);
+
ksort($ret);
return $ret;
}
Please sign in to comment.
Something went wrong with that request. Please try again.