Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use PSR-0 SplClassLoader and Integrate with PEAR. #6

Open
wants to merge 3 commits into from

2 participants

@c9s
  • let this library can be built as a PEAR package, through onion.phar builder.
  • since the simple package.ini is defined, we can use onion.phar bundler to install PEAR dependencies into vendor directory.
  • can run ./vendor.sh script to install PSR-0 Spl classloader into vendor/pear.
  • tests/bootstrap.php loads the Spl classloader to run tests.
  • defined a basic phpunit.xml
  • need a PEAR channel to distribute this PEAR package.
  • the information in package.ini might need to change.

Hope you like it. :-)

c9s added some commits
@c9s c9s Use PSR-0 SplClassLoader and Integrate with PEAR.
- let this library can be built as a PEAR package, through onion.phar
  builder.
- since the simple package.ini is defined, we can use onion.phar bundler
  to install PEAR dependencies into vendor directory.
- can run ./vendor.sh script to install PSR-0 Spl classloader into
  vendor/pear.
- tests/bootstrap.php loads the Spl classloader to run tests.
- defined a basic phpunit.xml
- need a PEAR channel to distribute this PEAR package.
- the information in package.ini might need to change.
291aaca
@c9s c9s Add vendor.sh
00886bb
@c9s c9s Fxi package info
8af7720
@csrui

Please leave PEAR alone, this is fine as it is.

@c9s

Hi,

PEAR is the most usual way to distribute/install a package, why not PEAR ? many vendors distribute their packages with PEAR too.

If you still hate PEAR, you can skip the PEAR stuff, this pull request also contains namespaces,which makes name collisions less likely and autoloading easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 10, 2012
  1. @c9s

    Use PSR-0 SplClassLoader and Integrate with PEAR.

    c9s authored
    - let this library can be built as a PEAR package, through onion.phar
      builder.
    - since the simple package.ini is defined, we can use onion.phar bundler
      to install PEAR dependencies into vendor directory.
    - can run ./vendor.sh script to install PSR-0 Spl classloader into
      vendor/pear.
    - tests/bootstrap.php loads the Spl classloader to run tests.
    - defined a basic phpunit.xml
    - need a PEAR channel to distribute this PEAR package.
    - the information in package.ini might need to change.
  2. @c9s

    Add vendor.sh

    c9s authored
Commits on Jan 18, 2012
  1. @c9s

    Fxi package info

    c9s authored
This page is out of date. Refresh to see the latest.
View
2  README.txt
@@ -1,3 +1,5 @@
OAuth2 Server now implements draft 20 of OAuth 2.0
The client is still only draft-10.
+
+
View
11 package.ini
@@ -0,0 +1,11 @@
+[package]
+name = OAuth2
+version = 0.2.0
+desc = OAuth2 server and OAuth2 client
+author = Tim Ridgely <tim@opendining.net>
+channel = private-pear.corneltek.com
+
+[require]
+php = 5.3
+pearinstaller = 1.4
+pear.corneltek.com/Universal = 0
View
12 phpunit.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated by PHP Project Wizard (PPW) 1.1.0-dev on Sat Mar 12 12:47:10 CET 2011 -->
+
+<phpunit bootstrap="tests/bootstrap.php"
+ backupGlobals="false"
+ verbose="true">
+ <testsuites>
+ <testsuite name="PHPUnit">
+ <directory suffix="Test.php">tests</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
View
0  lib/IOAuth2GrantClient.php → src/IOAuth2GrantClient.php
File renamed without changes
View
0  lib/IOAuth2GrantCode.php → src/IOAuth2GrantCode.php
File renamed without changes
View
0  lib/IOAuth2GrantExtension.php → src/IOAuth2GrantExtension.php
File renamed without changes
View
0  lib/IOAuth2GrantImplicit.php → src/IOAuth2GrantImplicit.php
File renamed without changes
View
0  lib/IOAuth2GrantUser.php → src/IOAuth2GrantUser.php
File renamed without changes
View
0  lib/IOAuth2RefreshTokens.php → src/IOAuth2RefreshTokens.php
File renamed without changes
View
0  lib/IOAuth2Storage.php → src/IOAuth2Storage.php
File renamed without changes
View
3  lib/OAuth2.php → src/OAuth2.php
@@ -1,7 +1,4 @@
<?php
-require 'OAuth2ServerException.php';
-require 'OAuth2AuthenticateException.php';
-require 'OAuth2RedirectException.php';
/**
* @mainpage
* OAuth 2.0 server in PHP, originally written for
View
0  lib/OAuth2AuthenticateException.php → src/OAuth2AuthenticateException.php
File renamed without changes
View
0  lib/OAuth2Client.php → src/OAuth2Client.php
File renamed without changes
View
0  lib/OAuth2Exception.php → src/OAuth2Exception.php
File renamed without changes
View
0  lib/OAuth2RedirectException.php → src/OAuth2RedirectException.php
File renamed without changes
View
3  lib/OAuth2ServerException.php → src/OAuth2ServerException.php
@@ -2,7 +2,6 @@
/**
* OAuth2 errors that require termination of OAuth2 due to
* an error.
- *
*/
class OAuth2ServerException extends Exception {
@@ -78,4 +77,4 @@ protected function sendHeaders() {
public function __toString() {
return json_encode($this->errorData);
}
-}
+}
View
4 tests/OAuth2OutputTest.php
@@ -1,8 +1,4 @@
<?php
-require __DIR__ . '/../lib/OAuth2.php';
-require __DIR__ . '/../lib/IOAuth2Storage.php';
-require __DIR__ . '/../lib/IOAuth2GrantCode.php';
-
/**
* OAuth2 test cases that invovle capturing output.
*/
View
4 tests/OAuth2Test.php
@@ -1,8 +1,4 @@
<?php
-require __DIR__ . '/../lib/OAuth2.php';
-require __DIR__ . '/../lib/IOAuth2Storage.php';
-require __DIR__ . '/../lib/IOAuth2GrantCode.php';
-
/**
* OAuth2 test case.
*/
View
5 tests/bootstrap.php
@@ -0,0 +1,5 @@
+<?php
+# require 'tests/helpers.php';
+require 'vendor/pear/Universal/ClassLoader/BasePathClassLoader.php';
+$loader = new \Universal\ClassLoader\BasePathClassLoader( array('src','vendor/pear'));
+$loader->register();
View
3  vendor.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+curl -O https://github.com/c9s/Onion/raw/master/onion.phar
+php onion.phar -d bundle
Something went wrong with that request. Please try again.