|
1 | 1 | # PHP API for Party and Friends |
2 | | -A library for Party and Friends ([the free version for BungeeCord](https://www.spigotmc.org/resources/party-and-friends-for-bungeecord.9531/), [the extended version for Bungeecord](https://www.spigotmc.org/resources/party-and-friends-extended-for-spigot-supports-1-7-1-16-5.11633/) and [the extended version for Spigot](https://www.spigotmc.org/resources/party-and-friends-extended-for-spigot-supports-1-7-1-16-5.11633/)) to use its data in PHP scripts. |
| 2 | + |
| 3 | +A PHP composer library for Party And |
| 4 | +Friends ([Free for Bungeecord](https://www.spigotmc.org/resources/party-and-friends-for-bungeecord-supports-1-7-x-to-1-19-x.9531/) |
| 5 | +, [Extended For Bungeecord/Velocity](https://www.spigotmc.org/resources/party-and-friends-extended-edition-for-bungeecord-velocity-supports-1-7-1-19.10123/) |
| 6 | +, [Extended For Spigot](https://www.spigotmc.org/resources/party-and-friends-extended-for-spigot-supports-1-7-1-19.11633/) ( |
| 7 | +you need to use MySQL as a data source), |
| 8 | +or [Free For Velocity](https://forums.papermc.io/threads/party-and-friends-for-velocity-version-1-0-89.317/)), which |
| 9 | +allows developers to access Party And Friends data in PHP. |
| 10 | + |
3 | 11 | ## Requirements |
4 | | -* PHP 7.4 or later |
5 | | -* An installation of Party and Friends ([the free version for BungeeCord](https://www.spigotmc.org/resources/party-and-friends-for-bungeecord.9531/), [the extended version for Bungeecord](https://www.spigotmc.org/resources/party-and-friends-extended-for-spigot-supports-1-7-1-16-5.11633/) or [the extended version for Spigot](https://www.spigotmc.org/resources/party-and-friends-extended-for-spigot-supports-1-7-1-16-5.11633/)) with MySQL used as database |
| 12 | + |
| 13 | +* PHP 7.4 or higher |
| 14 | +* [Composer](https://getcomposer.org/) |
| 15 | +* A MySQL server containing the Party And |
| 16 | + Friends ([Free for Bungeecord](https://www.spigotmc.org/resources/party-and-friends-for-bungeecord-supports-1-7-x-to-1-19-x.9531/) |
| 17 | + , [Extended For Bungeecord/Velocity](https://www.spigotmc.org/resources/party-and-friends-extended-edition-for-bungeecord-velocity-supports-1-7-1-19.10123/) |
| 18 | + , [Extended For Spigot](https://www.spigotmc.org/resources/party-and-friends-extended-for-spigot-supports-1-7-1-19.11633/) ( |
| 19 | + you need to use MySQL as a data source), |
| 20 | + or [Free For Velocity](https://forums.papermc.io/threads/party-and-friends-for-velocity-version-1-0-89.317/)) data |
| 21 | + which should be accessed |
6 | 22 |
|
7 | 23 | ## Installation |
8 | | -* Put this library into your web directory folder |
9 | | -* Enter your MySQL data into the "PAFLib/config.php" file |
10 | | -* Test if everything works by opening the website %YOUR_HOST%/PAFLib/test/index.php |
| 24 | + |
| 25 | +Add the following lines to your composer file: |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "repositories": [ |
| 30 | + { |
| 31 | + "type": "vcs", |
| 32 | + "url": "https://github.com/Simonsator/PartyAndFriends-PHP-Lib" |
| 33 | + } |
| 34 | + ], |
| 35 | + "require": { |
| 36 | + "simonsator/party-and-friends-php-lib": "@dev" |
| 37 | + } |
| 38 | +} |
| 39 | +``` |
| 40 | + |
11 | 41 | ## Where to start |
12 | | -If you don't know how to use this library have a look at the ["test/index.php"](https://github.com/Simonsator/PartyAndFriends-PHP-Lib/blob/master/PAFLib/test/index.php) and ["test/playerdatashow.php"](https://github.com/Simonsator/PartyAndFriends-PHP-Lib/blob/master/PAFLib/test/playerdatashow.php) |
| 42 | + |
| 43 | +A demo project can be found [here](https://github.com/Simonsator/PartyAndFriends-PHP-Lib-Demo). To get started, you |
| 44 | +should call the constructor of the class `Simonsator\PartyAndFriends\PAFPlayerManager`. You need to provide the table |
| 45 | +prefix used by Party And Friends and a PDO object with an active connection to the MySQL database which is used by Party |
| 46 | +And Friends. Using the methods of the `PAFPlayerManager` you can `PAFPlayer` objects, with which you can access data of |
| 47 | +players. |
0 commit comments