-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from hamstar/22-curl2requests
Use Requests library instead of Curl
- Loading branch information
Showing
9 changed files
with
225 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
wikimate_cookie.txt | ||
nbproject/private | ||
vendor |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,32 +6,22 @@ It consists of two classes currently: | |
|
||
## Installation | ||
|
||
* **Note:** *The commands below apply to Ubuntu. You might need to adjust them for other systems.* | ||
**Requirements: [PHP](http://php.net), and [Composer](http://getcomposer.org).** | ||
|
||
Before anything else, since Wikimate is written in PHP, a server-side language, | ||
you will need a web server such as Apache to run it (and of course, PHP). | ||
you will need to have PHP installed to run it. Install it with your preferred | ||
package management tool (for example, on Ubuntu Linux you can run: | ||
`sudo apt-get install php5`) | ||
|
||
sudo apt-get install apache2 php5 | ||
Install Composer by following the instructions at https://getcomposer.org/doc/00-intro.md | ||
|
||
You will also need cURL; Install it if you don't have it yet. | ||
Then, download Wikimate, and initialise it by running `composer install` (or | ||
`composer.bat install` if you're on Windows). | ||
|
||
sudo apt-get install curl php5-curl | ||
|
||
Then, download Wikimate. | ||
To make sure the [curl wrapper submodule](http://github.com/shuber/curl) | ||
is also downloaded, use git's `--recursive` option: | ||
|
||
git clone --recursive [email protected]:hamstar/Wikimate.git | ||
|
||
Now you need to allow the server to write to the cookie file. | ||
Create a `wikimate_cookie.txt` file in the same directory as the wikimate files | ||
and give the server write access to that. | ||
If you don't do this you won't be able to login, and Wikimate will throw an exception. | ||
|
||
cd Wikimate | ||
touch wikimate_cookie.txt | ||
sudo chown www-data wikimate_cookie.txt | ||
To use Wikimate within another project, you can add it as a composer dependency | ||
by adding the following to your `composer.json` file: | ||
|
||
"hamstar/Wikimate": "0.10.0" | ||
|
||
## Usage | ||
|
||
|
@@ -232,6 +222,10 @@ Both methods return an array of the MediaWiki API result. | |
|
||
## Changelog | ||
|
||
### Version 0.10.0 | ||
|
||
* Switched to using the *Requests* library instead of Curl | ||
|
||
### Version 0.5 | ||
|
||
* Removed the use of constants in favour of constructor arguments | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
{ | ||
"name" : "hamstar/Wikimate", | ||
"type" : "library", | ||
"description" : "Wikimate is a wrapper for the MediaWiki API that aims to be very easy to use.", | ||
|
||
"authors" : [ | ||
"name": "hamstar/wikimate", | ||
"type": "library", | ||
"description": "Wikimate is a wrapper for the MediaWiki API that aims to be very easy to use.", | ||
"license": "MIT", | ||
"homepage": "https://github.com/hamstar/Wikimate", | ||
"authors": [ | ||
{ | ||
"homepage" : "https://github.com/hamstar" | ||
"name": "Robert McLeod", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/hamstar" | ||
} | ||
], | ||
|
||
"autoload" : { | ||
"classmap" : [ | ||
"autoload": { | ||
"classmap": [ | ||
"Wikimate.php" | ||
] | ||
}, | ||
|
||
"require" : { | ||
"shuber/curl" : "dev-master" | ||
"require": { | ||
"rmccue/requests": "1.*" | ||
} | ||
} | ||
} |
Oops, something went wrong.