Skip to content

Commit

Permalink
Merge pull request #27 from gggeek/php53
Browse files Browse the repository at this point in the history
Move branch php53 into master
  • Loading branch information
gggeek committed Jul 12, 2015
2 parents 31d3ced + 5e0dcb0 commit bd40482
Show file tree
Hide file tree
Showing 121 changed files with 16,477 additions and 18,543 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/.idea
composer.phar

composer.lock
/vendor/*
/tests/coverage/*
/build/*
49 changes: 38 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
language: php

php:
- 5.2
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

matrix:
# current versions of hhvm do fail one test... see https://github.com/facebook/hhvm/issues/4837
allow_failures:
- php: hhvm

before_install:
# This is mandatory or the 'apt-get install' calls following will fail
- sudo apt-get update -qq
- sudo apt-get install -y apache2 libapache2-mod-fastcgi
- sudo apt-get install -y privoxy

install:
# NB: the lib does not declare dependencies for now. Also, composer will not run on php 5.2
- if [ $TRAVIS_PHP_VERSION != "5.2" ]; then composer self-update && composer install; fi
- composer self-update && composer install

before_script:
# Disable xdebug. NB: this should NOT be done for hhvm...
- if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then phpenv config-rm xdebug.ini; fi
# Disable xdebug for speed.
# NB: this should NOT be done for hhvm and php 7.0.
# Also we use the php 5.6 run to generate code coverage reports, and we need xdebug for that
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" -a "$TRAVIS_PHP_VERSION" != "7.0" -a "$TRAVIS_PHP_VERSION" != "5.6" ]; then phpenv config-rm xdebug.ini; fi

# TODO: we should set up an Apache instance inside the Travis VM and test it.
# But it looks a bit complex, esp. as it seems that php has to be set up differently (cgi vs fpm) depending on version
# So for now we just take an easy way out using a known remote server.
# See: https://gist.github.com/roderik/3123962
# See: http://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
# Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./tests/ci/travis/setup_php_fpm.sh; ./tests/ci/travis/setup_apache.sh; fi
- if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then ./tests/ci/travis/setup_hhvm.sh; ./tests/ci/travis/setup_apache_hhvm.sh; fi
- ./tests/ci/travis/setup_privoxy.sh

script:
php -d "include_path=.:./lib:./test" test/testsuite.php LOCALSERVER=gggeek.altervista.org URI=/sw/xmlrpc/demo/server/server.php HTTPSSERVER=gggeek.ssl.altervista.org HTTPSURI=/sw/xmlrpc/demo/server/server.php NOPROXY=1
# Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
# to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
vendor/bin/phpunit --coverage-clover=coverage.clover tests LOCALSERVER=localhost URI=/demo/server/server.php HTTPSSERVER=localhost HTTPSURI=/demo/server/server.php PROXY=localhost:8080 HTTPSVERIFYHOST=0 HTTPSIGNOREPEER=1 SSLVERSION=3 DEBUG=1

after_failure:
# Save as much info as we can to help developers
- cat apache_error.log
- cat apache_access.log
#- cat /var/log/hhvm/error.log
#- if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then php -i; fi

after_script:
# Upload code-coverage to Scrutinizer
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
# Upload code-coverage CodeClimate
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then CODECLIMATE_REPO_TOKEN=7fa6ee01e345090e059e5e42f3bfbcc8692feb8340396382dd76390a3019ac13 ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi
15 changes: 14 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@ NB: All recent commits are available online.
This file will not be updated further.
See https://github.com/gggeek/phpxmlrpc/commits/master

2014-05-26 - G. Giunta ([email protected])

2014-02-3 - G. Giunta ([email protected])
* removed bundled phpunit
* converted all tabs to spaces in php files and removed closing tags

2014-05-12 - Samu Voutilainen ([email protected])

* removed obsolete xml.so open; dl() is deprecated and removed from 5.3.0
* removed deprecated xmlEntities
* removed deprecated xmlrpc_backslash
* converted $GLOBALS to internal class. This makes testing much easier and should be more flexible regarding other projects
* changed verifyhost from 1 to 2. This makes modern php versions work properly.
* split off each class in its own file

2014-02-03 - G. Giunta ([email protected])

* bumped up requirements to php 5.1.0

Expand Down
38 changes: 0 additions & 38 deletions INSTALL

This file was deleted.

88 changes: 88 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
XMLRPC for PHP
==============

Requirements
------------

The following requirements should be met prior to using 'XMLRPC for PHP':

* PHP 5.3.0 or later

* the php "curl" extension is needed if you wish to use SSL or HTTP 1.1 to
communicate with remote servers

The php "xmlrpc" native extension is not required, but if it is installed,
there will be no interference with the operation of this library.


Installation instructions
-------------------------

Installation of the library is quite easy:

1. Via Composer (highly recommended):

1. Install composer if you don't have it already present on your system.
Depending on how you install, you may end up with a composer.phar file in your directory.
In that case, no worries! Just substitute 'php composer.phar' for 'composer' in the commands below.

2. If you're creating a new project, create a new empty directory for it.

3. Open a terminal and use Composer to grab the library.

$ composer require phpxmlrpc/phpxmlrpc:4.0

4. Write your code.
Once Composer has downloaded the component(s), all you need to do is include the vendor/autoload.php file that
was generated by Composer. This file takes care of autoloading all of the libraries so that you can use them
immediately, including phpxmlrpc:

// File example: src/script.php

// update this to the path to the "vendor/" directory, relative to this file
require_once __DIR__.'/../vendor/autoload.php';

use PhpXmlRpc\Value;
use PhpXmlRpc\Request;
use PhpXmlRpc\Client;

$client = new Client('http://some/server');
$response = $client->send(new Request('method', array(new Value('parameter'))));

5. IMPORTANT! Make sure that the vendor/phpxmlrpc directory is not directly accessible from the internet,
as leaving it open to access means that any visitor can trigger execution of php code such as
the built-in debugger.


2. Via manual download and autoload configuration

1. copy the contents of the src/ folder to any location required by your
application (it can be inside the web server root or not).

2. configure your app autoloading mechanism so that all classes in the PhpXmlRpc namespace are loaded
from that location: any PSR-4 compliant autoloader can do that, if you don't have any there is one
available in src/Autoloader.php

3. Write your code.

// File example: script.php

require_once __DIR__.'my_autoloader.php';

use PhpXmlRpc\Value;
use PhpXmlRpc\Request;
use PhpXmlRpc\Client;

$client = new Client('http://some/server');
$response = $client->send(new Request('method', array(new Value('parameter'))));

5. IMPORTANT! Make sure that the vendor/phpxmlrpc directory is not directly accessible from the internet,
as leaving it open to access means that any visitor can trigger execution of php code such as
the built-in debugger.

Tips
----

Please note that usage of the 'pake' command is not required for installation of the library.
At this moment it is only useful to build the html and pdf versions of the documentation, and the tarballs
for distribution of the library.
122 changes: 0 additions & 122 deletions Makefile

This file was deleted.

Loading

0 comments on commit bd40482

Please sign in to comment.