Permalink
Browse files

Moving package xml into package.php so package.xml gets generated fro…

…m now on. Also, you can now optionally specify the repo, to make local testing easier. See https://hub.boxuk.com/projects/boxuk-pear/wiki/Creating_your_own_PEAR_packages for documentation
  • Loading branch information...
1 parent f3f9ddb commit 1010c57460b2231a9acd609441e23f6c3f2c43ee Gavin Davies committed Oct 24, 2011
Showing with 58 additions and 57 deletions.
  1. +0 −57 PHP/package.xml
  2. +58 −0 package.php
View
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.9.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
- http://pear.php.net/dtd/tasks-1.0.xsd
- http://pear.php.net/dtd/package-2.0
- http://pear.php.net/dtd/package-2.0.xsd">
- <name>codingstandards</name>
- <channel>pear.boxuk.net</channel>
- <summary>PHP Coding Standards</summary>
- <description>-</description>
- <lead>
- <name>Open</name>
- <user>Source</user>
- <email>opensource@boxuk.com</email>
- <active>yes</active>
- </lead>
- <date>2011-06-20</date>
- <time>16:00:00</time>
- <version>
- <release>1.0.2</release>
- <api>1.0.2</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.opensource.org/licenses/mit-license.php">MIT</license>
- <notes>-</notes>
- <contents>
- <dir baseinstalldir="/PHP/CodeSniffer/Standards/" name="/">
- <dir name="BoxUK">
- <file name="ruleset.xml" role="php" />
- <dir name="Sniffs">
- <dir name="CodeAnalysis">
- <file name="LongMethodSniff.php" role="php" />
- <file name="PPrefixSniff.php" role="php" />
- <file name="SingletonAccessSniff.php" role="php" />
- </dir>
- <dir name="Commenting">
- <file name="FunctionCommentSniff.php" role="php" />
- <file name="PackageAnnotationSniff.php" role="php" />
- </dir>
- </dir>
- </dir>
- </dir>
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.3.0</min>
- </php>
- <pearinstaller>
- <min>1.9.0</min>
- </pearinstaller>
- </required>
- </dependencies>
- <phprelease />
-</package>
View
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Package file for creating PEAR packages. This file defines how the PEAR
+ * package should be constructed.
+ *
+ * usage: php package.php VERSION
+ *
+ * @author Box UK <opensource@boxuk.com>
+ * @copyright Copyright (c) 2011, Box UK
+ * @license http://opensource.org/licenses/mit-license.php MIT License and http://www.gnu.org/licenses/gpl.ht$
+ * @link http://github.com/boxuk/describr
+ * @since 1.0.3
+ */
+
+require_once( 'PEAR/PackageFileManager2.php' );
+require_once( 'PEAR/PackageFileManager/File.php' );
+
+@list( $IGNORE, $version, $channel ) = $_SERVER['argv'];
+
+if ( !$version ) {
+ echo "usage: php package.php VERSION\n";
+ exit( 1 );
+}
+if( !$channel ) {
+ $channel = 'pear.boxuk.net';
+}
+define( 'BOXUK_PEAR_CHANNEL', $channel );
+
+$aFilesToIgnore = array();
+
+$packagexml = new PEAR_PackageFileManager2;
+$packagexml->addPackageDepWithChannel('package', 'Autoload', BOXUK_PEAR_CHANNEL, '1.0.1');
+
+$packagexml->setOptions(array(
+ 'packagedirectory' => 'PHP',
+ 'baseinstalldir' => '/PHP/CodeSniffer/Standards/',
+));
+
+$packagexml->setPackage( 'codingstandards' );
+$packagexml->setSummary( 'PHP Coding Standards' );
+$packagexml->setDescription( 'Box UK\'s PHP coding standards, to be used with PHPCodesniffer' );
+$packagexml->setChannel( BOXUK_PEAR_CHANNEL );
+$packagexml->setAPIVersion( $version );
+$packagexml->setReleaseVersion( $version );
+$packagexml->setReleaseStability( 'stable' );
+$packagexml->setAPIStability( 'stable' );
+$packagexml->setNotes( "-" );
+$packagexml->setPackageType( 'php' );
+
+// prevent ruleset.xml from being put in the data dir status
+$packagexml->addRole('xml', 'php');
+
+$packagexml->setPhpDep( '5.3.0' );
+$packagexml->setPearinstallerDep( '1.9.0' );
+$packagexml->addMaintainer( 'lead', 'boxuk', 'boxuk', 'opensource@boxuk.com' );
+$packagexml->setLicense( 'MIT License', 'http://www.opensource.org/licenses/mit-license.php' );
+$packagexml->generateContents();
+$packagexml->writePackageFile();

0 comments on commit 1010c57

Please sign in to comment.