Permalink
Browse files

Merge remote-tracking branch 'upstream/master' into behavior

  • Loading branch information...
2 parents 456c817 + 7840802 commit 3b81e68c4be5d956af5397449adeb86ab2542db7 @realityking realityking committed Aug 28, 2011
Showing 311 changed files with 123,449 additions and 2,408 deletions.
View
@@ -3,3 +3,4 @@
/pdepend
/code-browser
/api
+/docs
View
@@ -0,0 +1,216 @@
+#!/usr/bin/php
+<?php
+/**
+ * @package Joomla.Build
+ *
+ * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+// We are a valid Joomla entry point.
+define('_JEXEC', 1);
+
+// Setup the path related constants.
+define('JPATH_BASE', dirname(__FILE__));
+
+// Bootstrap the application.
+require '../libraries/import.php';
+
+jimport('joomla.application.cli');
+
+/**
+ * The command line application.
+ *
+ * @package NewLifeInIT
+ * @subpackage cron
+ */
+class Changelog extends JCli
+{
+ /**
+ * Execute the application.
+ *
+ * @return void
+ *
+ * @since 11.3
+ */
+ public function execute()
+ {
+ // Import dependancies.
+ jimport('joomla.client.http');
+
+ try
+ {
+ // Get a list of the merged pull requests.
+ $merged = $this->getMergedPulls();
+
+ $doc = new XMLWriter;
+ $doc->openMemory();
+ $doc->setIndent(true);
+ $doc->setIndentString("\t");
+ $doc->startDocument('1.0', 'utf-8');
+
+ $doc->startElement('appendix');
+ $doc->writeAttribute('version', '5.0');
+ $doc->writeAttribute('xmlns', 'http://docbook.org/ns/docbook');
+ $doc->writeAttribute('xml:id', 'preface');
+ $doc->writeAttribute('xmlns:ns', 'http://docbook.org/ns/docbook');
+ $doc->writeAttribute('xmlns:ns2', 'http://www.w3.org/1999/xlink');
+ $doc->writeAttribute('xmlns:ns3', 'http://www.w3.org/1998/Math/MathML');
+ $doc->writeAttribute('xmlns:ns4', 'http://www.w3.org/2000/svg');
+ $doc->writeAttribute('xmlns:ns5', 'http://www.w3.org/1999/xhtml');
+
+ $doc->startElement('section');
+
+ $cutoff = 10;
+ $page = 1;
+
+ while ($cutoff--)
+ {
+ // Get a page of issues.
+ $issues = $this->getIssues($page++);
+
+ // Check if we've gone past the last page.
+ if (empty($issues))
+ {
+ break;
+ }
+
+ $doc->startElement('itemizedlist');
+
+ // Loop through each pull.
+ foreach ($issues as $issue)
+ {
+ // Check if the issue has been merged.
+ if (empty($issue->pull_request->html_url))
+ {
+ continue;
+ }
+
+ // Check if the pull has been merged.
+ if (!in_array($issue->number, $merged))
+ {
+ continue;
+ }
+
+ $doc->startElement('listitem');
+
+ $doc->startElement('para');
+
+ // Prepare the link to the pull.
+ $doc->text('[');
+ $doc->startElement('link');
+ $doc->writeAttribute('ns2:href', $issue->url);
+ $doc->writeAttribute('ns2:title', 'Closed '.$issue->closed_at);
+ $doc->text('#'.$issue->number);
+ $doc->endElement(); // ulink
+ $doc->text('] '.$issue->title.' (');
+
+ // Prepare the link to the author.
+ $doc->startElement('link');
+ $doc->writeAttribute('ns2:href', $issue->user->url);
+ $doc->text($issue->user->login);
+ $doc->endElement(); // ulink
+ $doc->text(')');
+
+ $doc->endElement(); // para
+
+ if (trim($issue->body))
+ {
+ $doc->startElement('para');
+ $doc->text($issue->body);
+ $doc->endElement(); // para
+ }
+
+ $doc->endElement(); // listitem
+ }
+
+ $doc->endElement(); // itemizedlist
+ }
+
+ $doc->endElement(); // section
+ $doc->endElement(); // appendix
+
+ // Write the file.
+ if (!is_dir('./docs'))
+ {
+ mkdir('./docs');
+ }
+
+ file_put_contents('./docs/changelog.xml', $doc->outputMemory());
+ }
+ catch (Exception $e)
+ {
+ $this->out($e->getMessage());
+ $this->close($e->getCode());
+ }
+
+ // Close normally.
+ $this->close();
+ }
+
+ /**
+ * Get a page of issue data.
+ *
+ * @param integer The page number.
+ *
+ * @return array
+ *
+ * @since 11.3
+ */
+ protected function getIssues($page)
+ {
+ $http = new JHttp;
+ $r = $http->get(
+ 'https://api.github.com/repos/joomla/joomla-platform/issues?state=closed&sort=updated&direction=desc&page='.$page.'&per_page=100'
+ );
+
+ return json_decode($r->body);
+ }
+
+ /**
+ * Gets a list of the merged pull numbers.
+ *
+ * @param integer The pull/issue number.
+ *
+ * @return array
+ *
+ * @since 11.3
+ */
+ protected function getMergedPulls()
+ {
+ $cutoff = 10;
+ $page = 1;
+ $merged = array();
+
+ while ($cutoff--)
+ {
+ $http = new JHttp;
+
+ $r = $http->get(
+ 'https://api.github.com/repos/joomla/joomla-platform/pulls?state=closed&page='.$page++.'&per_page=100'
+ );
+
+ $pulls = json_decode($r->body);
+
+ // Check if we've gone past the last page.
+ if (empty($pulls))
+ {
+ break;
+ }
+
+ // Loop through each of the pull requests.
+ foreach ($pulls as $pull)
+ {
+ // If merged, add to the white list.
+ if ($pull->merged_at)
+ {
+ $merged[] = $pull->number;
+ }
+ }
+ }
+
+ return $merged;
+ }
+}
+
+JCli::getInstance('Changelog')->execute();
@@ -65,17 +65,17 @@ class Joomla_Sniffs_Commenting_ClassCommentSniff extends Joomla_Sniffs_Commentin
'category' => array(
'required' => false,
'allow_multiple' => false,
- 'order_text' => 'follow @version (if used)',
+ 'order_text' => 'must follow @version (if used)',
),
'package' => array(
'required' => true,
'allow_multiple' => false,
- 'order_text' => 'follows @category',
+ 'order_text' => 'must follow @category (if used)',
),
'subpackage' => array(
'required' => false,
'allow_multiple' => false,
- 'order_text' => 'follows @package',
+ 'order_text' => 'must follow @package',
),
'author' => array(
'required' => false,
@@ -85,32 +85,32 @@ class Joomla_Sniffs_Commenting_ClassCommentSniff extends Joomla_Sniffs_Commentin
'copyright' => array(
'required' => false,
'allow_multiple' => true,
- 'order_text' => 'follows @author (if used) or @subpackage (if used) or @package',
+ 'order_text' => 'must follow @author (if used) or @subpackage (if used) or @package',
),
'license' => array(
'required' => false,
'allow_multiple' => false,
- 'order_text' => 'follows @copyright',
+ 'order_text' => 'must follow @copyright (if used)',
),
'link' => array(
'required' => false,
'allow_multiple' => true,
- 'order_text' => 'follows @version',
+ 'order_text' => 'must follow @version (if used)',
),
'see' => array(
'required' => false,
'allow_multiple' => true,
- 'order_text' => 'follows @link',
+ 'order_text' => 'must follow @link (if used)',
),
'since' => array(
'required' => true,
'allow_multiple' => false,
- 'order_text' => 'follows @see (if used) or @link',
+ 'order_text' => 'must follow @see (if used) or @link (if used)',
),
'deprecated' => array(
'required' => false,
'allow_multiple' => false,
- 'order_text' => 'follows @since (if used) or @see (if used) or @link',
+ 'order_text' => 'must follow @since (if used) or @see (if used) or @link (if used)',
),
);
@@ -79,47 +79,47 @@ class Joomla_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
'package' => array(
'required' => true,
'allow_multiple' => false,
- 'order_text' => 'follows, if used, @category',
+ 'order_text' => 'must follows @category (if used)',
),
'subpackage' => array(
'required' => false,
'allow_multiple' => false,
- 'order_text' => 'follows @package',
+ 'order_text' => 'must follow @package',
),
'author' => array(
'required' => false,
'allow_multiple' => true,
- 'order_text' => 'follows, if used, @subpackage or @package',
+ 'order_text' => 'must follow @subpackage (if used) or @package',
),
'copyright' => array(
'required' => true,
'allow_multiple' => true,
- 'order_text' => 'follows, if used, @author, @subpackage or @package',
+ 'order_text' => 'must follow @author (if used), @subpackage (if used) or @package',
),
'license' => array(
'required' => true,
'allow_multiple' => false,
- 'order_text' => 'follows @copyright',
+ 'order_text' => 'must follow @copyright',
),
'link' => array(
'required' => false,
'allow_multiple' => true,
- 'order_text' => 'follows @license',
+ 'order_text' => 'must follow @license',
),
'see' => array(
'required' => false,
'allow_multiple' => true,
- 'order_text' => 'follows, if used, @link or @license',
+ 'order_text' => 'must follow @link (if used) or @license',
),
'since' => array(
'required' => false,
'allow_multiple' => false,
- 'order_text' => 'follows, if used, @see, @link (if used) or @license',
+ 'order_text' => 'must follows @see (if used), @link (if used) or @license',
),
'deprecated' => array(
'required' => false,
'allow_multiple' => false,
- 'order_text' => 'follows, if used, @since, @see, @link or @license',
+ 'order_text' => 'must follow @since (if used), @see (if used), @link (if used) or @license',
),
);
@@ -348,7 +348,7 @@ protected function processParams($commentStart)
$errorPos = ($param->getLine() + $commentStart);
// Make sure that there is only one space before the var type.
- // Joomla change: 3 spaces to make it line up with e @return tag with a 2 space gap.
+ // Joomla change: 3 spaces to make it line up with the @return tag with a 2 space gap.
if ($param->getWhitespaceBeforeType() !== ' ') {
$error = 'Expected 3 spaces before variable type';
$this->currentFile->addError($error, $errorPos, 'BeforeParamType');
@@ -83,14 +83,14 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
// Closing bracket is on the same line as a condition.
$error = 'Closing parenthesis of a multi-line IF statement must be on a new line';
$phpcsFile->addError($error, $i, 'CloseBracketNewLine');
- $expectedIndent = ($statementIndent + 4);
+ $expectedIndent = ($statementIndent + 1);
} else {
// Closing brace needs to be indented to the same level
// as the function.
$expectedIndent = $statementIndent;
}
} else {
- $expectedIndent = ($statementIndent + 4);
+ $expectedIndent = ($statementIndent + 1);
}
// We changed lines, so this should be a whitespace indent token.
View
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="joomla-platform-manual" default="docs" basedir=".">
+
+ <target name="docs">
+ <exec
+ command="xsltproc --xinclude xsl/xhtml/docbook.xsl manual/book.xml > ../build/docs/joomla-platform-manual.html" />
+
+ <exec
+ command="xsltproc --xinclude xsl/xhtml/docbook.xsl coding-standards/book.xml > ../build/docs/joomla-platform-coding-standards.html" />
+ </target>
+
+</project>
Oops, something went wrong.

0 comments on commit 3b81e68

Please sign in to comment.