Skip to content

Commit

Permalink
merged branch superhaggis/master (PR fabpot-graveyard#29)
Browse files Browse the repository at this point in the history
Commits
-------

4ea35e4 Edited README grammar and standardised message formatting.

Discussion
----------

Grammatical tweaks

Please note: you will need to update the screenshots in your online documentation to reflect the changes in this PR.
  • Loading branch information
fabpot committed Aug 26, 2011
2 parents c4dec41 + 4ea35e4 commit e2a1fed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ setup PEAR channel servers in a matter of minutes. Pirum is best suited when
you want to create small PEAR channels for a few packages written by a few
developers.

Pirum consists of just one file, a command line tool, written in PHP. There is
no external dependencies, no not need for a database, and nothing need to be
Pirum consists of just one file: a command line tool written in PHP. There are
no external dependencies, no need for a database, and nothing needs to be
installed or configured.

More information on the official [website](http://www.pirum-project.org/).
More information can be found on the official [website](http://www.pirum-project.org/).
50 changes: 25 additions & 25 deletions pirum
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class Pirum_CLI

$command = $this->options[1];
if (!$this->isCommand($command)) {
echo $this->formatter->formatSection('ERROR', sprintf('"%s" is not a valid command', $command));
echo $this->formatter->formatSection('ERROR', sprintf('"%s" is not a valid command.', $command));

return 1;
}

echo $this->formatter->format(sprintf("Running the %s command:\n", $command), 'COMMENT');

if (!isset($this->options[2]) || !is_dir($this->options[2])) {
echo $this->formatter->formatSection('ERROR', "You must give the root dir of the PEAR channel server");
echo $this->formatter->formatSection('ERROR', "You must give the root directory of the PEAR channel server.");

return 1;
}
Expand All @@ -82,7 +82,7 @@ class Pirum_CLI
}

if (0 == $ret) {
echo $this->formatter->formatSection('INFO', sprintf("Command %s run successfully", $command));
echo $this->formatter->formatSection('INFO', sprintf("Command %s run successfully.", $command));
}
} catch (Exception $e) {
echo $this->formatter->formatSection('ERROR', sprintf("%s (%s, %s)", $e->getMessage(), get_class($e), $e->getCode()));
Expand Down Expand Up @@ -124,19 +124,19 @@ class Pirum_CLI
protected function runRemove($target)
{
if (!isset($this->options[3])) {
echo $this->formatter->formatSection('ERROR', "You must pass a PEAR package name");
echo $this->formatter->formatSection('ERROR', "You must pass a PEAR package name.");

return 1;
}

if (!preg_match(Pirum_Package::PACKAGE_FILE_PATTERN, $this->options[3])) {
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" filename is badly formatted', $this->options[3]));
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" filename is badly formatted.', $this->options[3]));

return 1;
}

if (!is_file($target.'/get/'.basename($this->options[3]))) {
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" does not exist in this channel', $this->options[3]));
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" does not exist in this channel.', $this->options[3]));

return 1;
}
Expand All @@ -150,19 +150,19 @@ class Pirum_CLI
protected function runAdd($target)
{
if (!isset($this->options[3])) {
echo $this->formatter->formatSection('ERROR', "You must pass a PEAR package file path");
echo $this->formatter->formatSection('ERROR', "You must pass a PEAR package file path.");

return 1;
}

if (!is_file($this->options[3])) {
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" does not exist', $this->options[3]));
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" does not exist.', $this->options[3]));

return 1;
}

if (!preg_match(Pirum_Package::PACKAGE_FILE_PATTERN, $this->options[3])) {
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" filename is badly formatted', $this->options[3]));
echo $this->formatter->formatSection('ERROR', sprintf('The PEAR package "%s" filename is badly formatted.', $this->options[3]));

return 1;
}
Expand Down Expand Up @@ -215,7 +215,7 @@ class Pirum_Builder
public function __construct($targetDir, $formatter = false)
{
if (!file_exists($targetDir.'/pirum.xml')) {
throw new InvalidArgumentException('You must create a "pirum.xml" file at the root of the target dir.');
throw new InvalidArgumentException('You must create a pirum.xml configuration file in the root of the target directory.');
}

if (!is_dir($targetDir.'/get')) {
Expand All @@ -225,7 +225,7 @@ class Pirum_Builder
$this->server = simplexml_load_file($targetDir.'/pirum.xml');

if (!$this->server) {
throw new InvalidArgumentException('Invalid pirum.xml (you must have a <server> tag).');
throw new InvalidArgumentException('Your pirum.xml configuration is invalid - <server> tag missing.');
}

$emptyFields = array();
Expand All @@ -240,7 +240,7 @@ class Pirum_Builder
}

if (!empty($emptyFields)) {
throw new InvalidArgumentException(sprintf('You must fill required tags in your pirum.xml: %s.', implode(', ', $emptyFields)));
throw new InvalidArgumentException(sprintf('You must fill required tags in your pirum.xml configuration file: %s.', implode(', ', $emptyFields)));
}

$this->formatter = $formatter;
Expand Down Expand Up @@ -298,7 +298,7 @@ class Pirum_Builder

protected function updateTargetDir()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Updating PEAR server files");
$this->formatter and print $this->formatter->formatSection('INFO', "Updating PEAR server files.");

$this->updateChannel();
$this->updateIndex();
Expand Down Expand Up @@ -341,7 +341,7 @@ class Pirum_Builder

protected function buildFeed()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building feed");
$this->formatter and print $this->formatter->formatSection('INFO', "Building feed.");

$entries = '';
foreach ($this->packages as $package) {
Expand Down Expand Up @@ -424,7 +424,7 @@ EOF;

protected function buildIndex()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building index");
$this->formatter and print $this->formatter->formatSection('INFO', "Building index.");

$version = Pirum_CLI::version();

Expand Down Expand Up @@ -515,7 +515,7 @@ pear install <?php echo $this->server->alias ?>/package_name-beta</code></pre>

protected function buildReleasePackages()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building releases");
$this->formatter and print $this->formatter->formatSection('INFO', "Building releases.");

mkdir($this->buildDir.'/rest/r', 0777, true);

Expand All @@ -528,7 +528,7 @@ pear install <?php echo $this->server->alias ?>/package_name-beta</code></pre>

protected function buildReleasePackage($dir, $package)
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building releases for {$package['name']}");
$this->formatter and print $this->formatter->formatSection('INFO', "Building releases for {$package['name']}.");

$url = strtolower($package['name']);

Expand Down Expand Up @@ -613,7 +613,7 @@ EOF

protected function buildRelease($dir, $package, $release)
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building release {$release['version']} for {$package['name']}");
$this->formatter and print $this->formatter->formatSection('INFO', "Building release {$release['version']} for {$package['name']}.");

$url = strtolower($package['name']);

Expand Down Expand Up @@ -669,7 +669,7 @@ EOF

protected function buildPackages()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building packages");
$this->formatter and print $this->formatter->formatSection('INFO', "Building packages.");

mkdir($this->buildDir.'/rest/p', 0777, true);

Expand All @@ -693,7 +693,7 @@ EOF

protected function buildPackage($dir, $package)
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building package {$package['name']}");
$this->formatter and print $this->formatter->formatSection('INFO', "Building package {$package['name']}.");

$url = strtolower($package['name']);

Expand Down Expand Up @@ -755,7 +755,7 @@ EOF

protected function buildCategories()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building categories");
$this->formatter and print $this->formatter->formatSection('INFO', "Building categories.");

mkdir($this->buildDir.'/rest/c/Default', 0777, true);

Expand Down Expand Up @@ -846,7 +846,7 @@ EOF

protected function buildMaintainers()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building maintainers");
$this->formatter and print $this->formatter->formatSection('INFO', "Building maintainers.");

mkdir($dir = $this->buildDir.'/rest/m/', 0777, true);

Expand Down Expand Up @@ -887,7 +887,7 @@ EOF;

protected function buildChannel()
{
$this->formatter and print $this->formatter->formatSection('INFO', "Building channel");
$this->formatter and print $this->formatter->formatSection('INFO', "Building channel.");

$suggestedalias = '';
if (!empty($this->server->alias)) {
Expand Down Expand Up @@ -954,7 +954,7 @@ EOF;
}

foreach ($packages as $file => $package) {
$this->formatter and print $this->formatter->formatSection('INFO', sprintf('Parsing package %s for %s', $package->getVersion(), $package->getName()));
$this->formatter and print $this->formatter->formatSection('INFO', sprintf('Parsing package %s for %s.', $package->getVersion(), $package->getName()));

if ($package->getChannel() != $this->server->name) {
throw new Exception(sprintf('Package "%s" channel (%s) is not %s.', $package->getName(), $package->getChannel(), $this->server->name));
Expand Down Expand Up @@ -1073,7 +1073,7 @@ class Pirum_Package
{
$this->archive = $archive;
if (!preg_match(self::PACKAGE_FILE_PATTERN, $filename = basename($archive), $match)) {
throw new InvalidArgumentException(sprintf('The archive "%s" does not follow PEAR conventions', $filename));
throw new InvalidArgumentException(sprintf('The archive "%s" does not follow PEAR conventions.', $filename));
}

$this->name = $match['name'];
Expand Down

0 comments on commit e2a1fed

Please sign in to comment.