Permalink
Browse files

Merge branch 'master' of github.com:joomla/joomla-platform into tests

  • Loading branch information...
2 parents d1650f6 + cc7e058 commit 2544048e2604ab84f1e4d9ea6e823a4a1275a01e @eddieajau committed Aug 19, 2011
View
@@ -3,3 +3,4 @@
/pdepend
/code-browser
/api
+/docs
View
@@ -0,0 +1,204 @@
+#!/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->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;
+ }
+
+ // 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('itemizedlist');
+ $doc->startElement('listitem');
+
+ $doc->startElement('para');
+
+ // Prepare the link to the pull.
+ $doc->text('[');
+ $doc->startElement('ulink');
+ $doc->writeAttribute('url', $issue->url);
+ $doc->writeAttribute('title', 'Closed '.$issue->closed_at);
+ $doc->text('#'.$issue->number);
+ $doc->endElement(); // ulink
+ $doc->text('] '.$issue->title.' (');
+
+ // Prepare the link to the author.
+ $doc->startElement('ulink');
+ $doc->writeAttribute('url', $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');
@@ -98,5 +98,18 @@
</sect2>
+ <sect2>
+ <title>Known Issues</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>There is currently an issue with running the Code Sniffer on the Simplepie library.
+ Running from inside the Joomla folder will avoid this issue.</para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
</sect1>
</appendix>
@@ -673,13 +673,14 @@ public function login($credentials, $options = array())
// Get the global JAuthentication object.
jimport('joomla.user.authentication');
- $response = JAuthentication::authenticate($credentials, $options);
+ $authenticate = JAuthentication::getInstance();
+ $response = $authenticate->authenticate($credentials, $options);
if ($response->status === JAuthentication::STATUS_SUCCESS)
{
// validate that the user should be able to login (different to being authenticated)
// this permits authentication plugins blocking the user
- $authorisations = JAuthentication::authorise($response, $options);
+ $authorisations = $authenticate->authorise($response, $options);
foreach ($authorisation as $authorisation)
{
$denied_states = Array(JAuthentication::STATUS_EXPIRED, JAuthentication::STATUS_DENIED);
Oops, something went wrong.

0 comments on commit 2544048

Please sign in to comment.