jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/276968 )

Change subject: Add composer.json
......................................................................


Add composer.json

Add phplint to composer.

Add required package openid/php-openid to composer because this extension
needs it.

Bump version to 4.5 to indicate a big change and also update README file.

Bug: T129744
Change-Id: I0da4e5f0673f8534298ff64da28a5b286980ba1c
---
M .gitignore
M OpenID.php
M README
A composer.json
4 files changed, 38 insertions(+), 28 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.gitignore b/.gitignore
index 3f2efdc..b40e77a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
-.svn
 *~
 *.kate-swp
 .*.swp
 Auth/
 php-openid/
+vendor/**
+node_modules/**
diff --git a/OpenID.php b/OpenID.php
index 7ca1ce7..900f4c2 100644
--- a/OpenID.php
+++ b/OpenID.php
@@ -29,7 +29,15 @@
        exit( 1 );
 }
 
-define( 'MEDIAWIKI_OPENID_VERSION', '4.4.0 20140401' );
+if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI == true ) {
+       if ( file_exists(  __DIR__ . '/../../vendor/autoload.php' ) ) {
+               include_once __DIR__ . '/../../vendor/autoload.php';
+       }
+} elseif ( file_exists(  __DIR__ . '/vendor/autoload.php' ) ) {
+       include_once __DIR__ . '/vendor/autoload.php';
+}
+
+define( 'MEDIAWIKI_OPENID_VERSION', '4.5.0 20160312' );
 
 $path = dirname( __FILE__ );
 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . 
get_include_path() );
@@ -401,9 +409,6 @@
 # UI class
 $wgAutoloadClasses['OpenIDProvider'] = $dir . 'OpenIDProvider.body.php';
 
-# Gets stored in the session, needs to be verified before our setup
-$wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = 
OpenID::OpenIDGetServerPath();
-
 $wgAutoloadClasses['MediaWikiOpenIDDatabaseConnection'] = $dir . 
'DatabaseConnection.php';
 $wgAutoloadClasses['MediaWikiOpenIDMemcachedStore'] = $dir . 
'MemcachedStore.php';
 
@@ -537,19 +542,6 @@
                }
 
                return $trust_root;
-
-       }
-
-       static function OpenIDGetServerPath() {
-               $rel = 'Auth/OpenID/Server.php';
-
-               foreach ( explode( PATH_SEPARATOR, get_include_path() ) as $pe 
) {
-                       $full = $pe . DIRECTORY_SEPARATOR . $rel;
-                       if ( file_exists( $full ) ) {
-                               return $full;
-                       }
-               }
-               return $rel;
 
        }
 
diff --git a/README b/README
index 7a057f8..258d3bb 100644
--- a/README
+++ b/README
@@ -82,29 +82,33 @@
 
 See https://www.mediawiki.org/wiki/Extension:OpenID#Installation
 
-The software currently depends on having all its code in the /OpenID
-sub-directory; renaming it to "OpenID-Test" or something else won't work!
+Download from 
https://www.mediawiki.org/wiki/Special:ExtensionDistributor/OpenID
+
+Save it in the folder OpenID inside extensions folder.
+
+Looks like this mediawiki directory then extensions/OpenID/
 
 In your MediaWiki LocalSettings.php, add the following line some place towards
 the bottom of the file:
 
    require_once( "$IP/extensions/OpenID/OpenID.php" );
 
-Install the Auth subdirectory of the required OpenID PHP library in
-$IP/extensions/OpenID/Auth as explained in the following.
+Then run composer update from inside OpenID folder.
 
 Run the update.php script in in your MediaWiki maintenance folder
 $IP/maintenance to create a new table in the MediaWiki database which is used
 by the OpenID extension:
 
-cd $IP/extensions/OpenID
-git clone git://github.com/openid/php-openid.git
-mv php-openid/Auth/ Auth
-rm -r php-openid
-cd $IP/maintenance# php update.php
-
 It should work out of the box, but perhaps you want to fine-tune the extension.
 
+== Upgrade from OpenID versions before 4.5 ==
+
+You must install version 4.5 first to do the next step.
+
+You will have to do composer update from within this folder OpenID.
+
+If you don't the extension will now fail since it wont look for the Auth 
folder anymore.
+
 == Upgrade from OpenID versions before 3.x ==
 
 '''This is an incompatible upgrade to the previous version of the MediaWiki
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..42507ef
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,13 @@
+{
+       "require": {
+               "openid/php-openid": "2.3.0"
+       },
+       "require-dev": {
+               "jakub-onderka/php-parallel-lint": "0.9.2"
+       },
+       "scripts": {
+               "test": [
+                       "parallel-lint . --exclude vendor"
+               ]
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/276968
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0da4e5f0673f8534298ff64da28a5b286980ba1c
Gerrit-PatchSet: 16
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to