Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.2.3-pear
Fetching contributors…

Cannot retrieve contributors at this time

executable file 133 lines (113 sloc) 3.066 kb
#!/usr/bin/env php
<?php
ini_set('date.timezone', 'Europe/Berlin');
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$api_version = '0.2.0';
$api_state = 'alpha';
$release_version = '0.2.3';
$release_state = 'alpha';
$release_notes = "Bugfix (error handling)";
$description = "An API wrapper for the NYTimes APIs.";
$package = new PEAR_PackageFileManager2();
$package->setOptions(
array(
'filelistgenerator' => 'file',
'simpleoutput' => true,
'baseinstalldir' => '/',
'packagedirectory' => './',
'dir_roles' => array(
'src' => 'php',
'tests' => 'test',
'docs' => 'doc',
),
'exceptions' => array(
'README.md' => 'doc',
),
'ignore' => array(
'.git*',
'generate-package.php',
'*.tgz',
'*.tar',
'*.zip',
'phpunit.xml',
'package_compatible.xml',
'packagexmlsetup.php',
'composer.*',
'vendor/',
'.travis.yml',
'RELEASE*',
'API*',
'CREDITS',
)
)
);
$package->setPackage('PEAR2_Services_NYTimes');
$package->setSummary($description);
$package->setDescription($description);
$package->setChannel('easybib.github.com/pear');
$package->setPackageType('php');
$package->setLicense(
'BSD',
'http://www.opensource.org/licenses/bsd-license.php'
);
$package->setNotes($release_notes);
$package->setReleaseVersion($release_version);
$package->setReleaseStability($release_state);
$package->setAPIVersion($api_version);
$package->setAPIStability($api_state);
$package->addMaintainer(
'lead',
'till',
'Till Klampaeckel',
'till@php.net'
);
/**
* Generate the list of files in {@link $GLOBALS['files']}
*
* @param string $path
*
* @return void
*/
function readDirectory($path) {
foreach (glob($path . '/*') as $file) {
if (!is_dir($file)) {
$GLOBALS['files'][] = $file;
} else {
readDirectory($file);
}
}
}
$files = array();
readDirectory(__DIR__ . '/src');
/**
* @desc Strip this from the filename for 'addInstallAs'
*/
$base = __DIR__ . '/';
foreach ($files as $file) {
$file2 = str_replace($base, '', $file);
$package->addReplacement(
$file2,
'package-info',
'@package_version@',
'version'
);
$file2 = str_replace($base, '', $file);
$package->addInstallAs($file2, str_replace('src/', '', $file2));
}
$package->setPhpDep('5.3.0');
$package->addPackageDepWithChannel(
'required',
'HTTP_Request2',
'pear.php.net'
);
$package->addExtensionDep('required', 'spl');
$package->setPearInstallerDep('1.9.4');
$package->generateContents();
if ( isset($_GET['make'])
|| (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')
) {
$package->writePackageFile();
} else {
$package->debugPackageFile();
}
Jump to Line
Something went wrong with that request. Please try again.