Exemplo n.º 1
0
 public function main()
 {
     $packagexml = new PEAR_PackageFileManager();
     $e = $packagexml->setOptions(array('version' => '0.5', 'state' => 'alpha', 'notes' => 'Preview release.', 'pathtopackagefile' => $this->packageFileDir, 'packagedirectory' => $this->baseFilesDir, 'baseinstalldir' => 'phocoa', 'simpleoutput' => true, 'filelistgenerator' => 'file', 'ignore' => array(), 'installexceptions' => array('phpdocs' => '/*'), 'dir_roles' => array('phpdocs' => 'doc')));
     if (PEAR::isError($e)) {
         echo $e->getMessage();
         return;
     }
     $e = $packagexml->writePackageFile();
     if (PEAR::isError($e)) {
         echo $e->getMessage();
     }
 }
 /**
  * Main entry point.
  *
  * @throws BuildException
  * @return void
  */
 public function main()
 {
     if ($this->dir === null) {
         throw new BuildException("You must specify the \"dir\" attribute for PEAR package task.");
     }
     if ($this->package === null) {
         throw new BuildException("You must specify the \"name\" attribute for PEAR package task.");
     }
     $this->pkg = new PEAR_PackageFileManager();
     $this->setOptions();
     $e = $this->pkg->writePackageFile();
     if (PEAR::isError($e)) {
         throw new BuildException("Unable to write package file.", new Exception($e->getMessage()));
     }
 }
Exemplo n.º 3
0
XML_Serializer serializes complex data structures like arrays or object as XML documents.
This class helps you generating any XML document you require without the need for DOM.
Furthermore this package can be used as a replacement to serialize() and unserialize() as it comes with a matching XML_Unserializer that is able to create PHP data structures (like arrays and objects) from XML documents, if type hints are available.
If you use the XML_Unserializer on standard XML files, it will try to guess how it has to be unserialized. In most cases it does exactly what you expect it to do.
Try reading a RSS file with XML_Unserializer and you have the whole RSS file in a structured array or even a collection of objects, similar to XML_RSS.

Since version 0.8.0 the package is able to treat XML documents similar to the simplexml extension of PHP 5.
EOT;
$package = new PEAR_PackageFileManager();
$result = $package->setOptions(array('package' => 'XML_Serializer', 'summary' => 'Swiss-army knife for reading and writing XML files. Creates XML files from data structures and vice versa.', 'description' => $description, 'version' => $version, 'state' => $state, 'license' => 'BSD License', 'filelistgenerator' => 'cvs', 'ignore' => array('package.php', 'package.xml', 'package2.xml'), 'notes' => $notes, 'simpleoutput' => true, 'baseinstalldir' => 'XML', 'packagedirectory' => './', 'dir_roles' => array('docs' => 'doc', 'examples' => 'doc', 'tests' => 'test')));
if (PEAR::isError($result)) {
    echo $result->getMessage();
    die;
}
$package->addMaintainer('schst', 'lead', 'Stephan Schmidt', '*****@*****.**');
$package->addMaintainer('ashnazg', 'lead', 'Chuck Burgess', '*****@*****.**');
$package->addGlobalReplacement('package-info', '@package_version@', 'version');
$package->addDependency('php', '4.2.0', 'ge', 'php', false);
$package->addDependency('PEAR', '', 'has', 'pkg', false);
$package->addDependency('XML_Parser', '1.2.6', 'ge', 'pkg', false);
$package->addDependency('XML_Util', '1.1.1', 'ge', 'pkg', false);
if (isset($_GET['make']) || isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'make') {
    $result = $package->writePackageFile();
} else {
    $result = $package->debugPackageFile();
}
if (PEAR::isError($result)) {
    echo $result->getMessage();
    die;
}
echo "\n\nNOTICE:\n" . "  After using 'pear convert' to generate package2.xml,\n" . "  you must update the developers' <active> tags\n" . "  and verify the new <api> tag is correct.\n\n";
Exemplo n.º 4
0
}
$e = $packagexml->addMaintainer('jsweat', 'helper', 'Jason Sweat', '*****@*****.**');
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    exit;
}
$e = $packagexml->addMaintainer('pp11', 'helper', 'Perrick Penet', '*****@*****.**');
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    exit;
}
$e = $packagexml->addMaintainer('shpikat', 'helper', 'Constantine Shpikat', '*****@*****.**');
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    exit;
}
$e = $packagexml->addMaintainer('demianturner', 'helper', 'Demian Turner', '*****@*****.**');
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    exit;
}
// note use of {@link debugPackageFile()} - this is VERY important
if (isset($_GET['make']) || isset($_SERVER['argv'][2]) && $_SERVER['argv'][2] == 'make') {
    $e = $packagexml->writePackageFile();
} else {
    $e = $packagexml->debugPackageFile();
}
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    die;
}
}
$e = $test->addReplacement('pear-phpdoc.bat', 'pear-config', '@PHP-BIN@', 'php_bin');
if (PEAR::isError($e)) {
    echo $e->getMessage();
    exit;
}
// hack until they get their shit in line with docroot role
$test->addRole('tpl', 'php');
$test->addRole('png', 'php');
$test->addRole('gif', 'php');
$test->addRole('jpg', 'php');
$test->addRole('css', 'php');
$test->addRole('js', 'php');
$test->addRole('ini', 'php');
$test->addRole('inc', 'php');
$test->addRole('afm', 'php');
$test->addRole('pkg', 'doc');
$test->addRole('cls', 'doc');
$test->addRole('proc', 'doc');
$test->addRole('sh', 'script');
if (isset($_GET['make'])) {
    $e = $test->writePackageFile();
} else {
    $e = $test->debugPackageFile();
}
if (PEAR::isError($e)) {
    echo $e->getMessage();
}
if (!isset($_GET['make'])) {
    echo '<a href="' . $_SERVER['PHP_SELF'] . '?make=1">Make this file</a>';
}
Exemplo n.º 6
0
# -- Options
$e = $pkgxml->setOptions(array('baseinstalldir' => '/', 'package' => 'Blogmarks', 'version' => '0.1', 'summary' => 'Stop bookmarking, start blogmarking', 'description' => 'Soon to come...', 'license' => 'GPL', 'packagedirectory' => $pkg_dir, 'filelistgenerator' => 'cvs', 'state' => 'beta', 'notes' => 'first try', 'ignore' => array('make_pkg.php'), 'installexceptions' => array(), 'dir_roles' => array('Blogmarks/tutorials' => 'doc'), 'exceptions' => array()));
# -- Roles
$pkgxml->addRole('ini', 'php');
$pkgxml->addRole('dist', 'php');
# -- Maintainers
$pkgxml->addMaintainer('mbertier', 'lead', 'Tristan Rivoallan', '*****@*****.**');
$pkgxml->addMaintainer('benfle', 'developer', 'Benoit Fleury', '*****@*****.**');
# -- Dépendances
$pkgxml->addDependency('DB_DataObject', '1.5.3', 'ge', 'pkg');
$pkgxml->addDependency('HTTP_Request', '1.2', 'ge', 'pkg');
if (PEAR::isError($e)) {
    echo "*** Erreur: " . $e->getMessage() . "\n";
    exit;
}
/*
$e = $pkgxml->debugPackageFile( false );

if ( PEAR::isError($e) ) {
    echo "*** Erreur: ". $e->getMessage() . "\n";
    exit;
}
*/
$e = $pkgxml->writePackageFile();
if (PEAR::isError($e)) {
    echo "*** Erreur: " . $e->getMessage() . "\n";
    exit;
}
echo ">>> {$pkg_dir}/package.xml a été généré :)\n";
echo ">>> Il reste à valider package.xml et à créer le package :\n";
echo ">>> pear package-validate && pear package\n";
Exemplo n.º 7
0
<?php

/**
 * Net_growl package generator
 * @package Net_Growl
 */
require_once 'PEAR/PackageFileManager.php';
$version = '0.7.0';
$notes = <<<EOT
Initial release
EOT;
$description = <<<EOT
Growl is a MACOSX application that listen to notifications sent by 
applications and displays them on the desktop using different display 
styles. Net_Growl offers the possibility to send notifications to Growl 
from your PHP application through network communication using UDP.
EOT;
$package = new PEAR_PackageFileManager();
$e = $package->setOptions(array('package' => 'Net_Growl', 'summary' => 'Send notifications to Growl from PHP on MACOSX', 'description' => $description, 'version' => $version, 'state' => 'beta', 'license' => 'BSD', 'filelistgenerator' => 'file', 'ignore' => array('package.php', 'package.xml'), 'notes' => $notes, 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => 'Net', 'packagedirectory' => '/Volumes/doc/Dev/trunk/Bindings/php/Net_Growl'));
if (PEAR::isError($e)) {
    echo $e->getMessage();
    exit;
}
$package->addMaintainer('mansion', 'lead', 'Bertrand Mansion', '*****@*****.**');
$package->addDependency('PEAR', '1.3.3', 'ge', 'pkg', false);
$e = $package->writePackageFile();
if (PEAR::isError($e)) {
    echo $e->getMessage();
    exit;
}
echo "package.xml generated successfully!\n";
Exemplo n.º 8
0
// hack (apparently)
$PPFM->addRole('tpl', 'php');
$PPFM->addRole('png', 'php');
$PPFM->addRole('gif', 'php');
$PPFM->addRole('jpg', 'php');
$PPFM->addRole('css', 'php');
$PPFM->addRole('js', 'php');
$PPFM->addRole('ini', 'php');
$PPFM->addRole('inc', 'php');
$PPFM->addRole('afm', 'php');
$PPFM->addRole('pkg', 'doc');
$PPFM->addRole('cls', 'doc');
$PPFM->addRole('proc', 'doc');
$PPFM->addRole('sh', 'script');
ob_start();
$status = $PPFM->writePackageFile(false);
$output = ob_get_contents();
ob_end_clean();
// Hacks to handle PPFM output
$start = strpos($output, "<?xml");
if ($start != 0) {
    $errors = substr($output, 0, $start - 1);
    $output = substr($output, $start);
    $errors = explode("\n", $errors);
    foreach ($errors as $error) {
        fwrite(STDERR, $error . "\n");
    }
}
fwrite(STDOUT, $output);
if (PEAR::isError($status)) {
    fwrite(STDERR, $status->getMessage());