1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

For those of you who love PDO

Comments in 'Plugin Development' started by ServerKart_Rod, Jul 9, 2014.

  1. ServerKart_Rod

    ServerKart_Rod Active Member Plugin Developer

    Jul 7, 2014
    Minecraft User:
    So my first contribution to this forum and plugin development.
    I see sqlite is the main extension used for databases, well that's just not good enough for me, so I have added the PDO extensions and drivers for the current version of php used in alpha which is

    Do not worry the sqlite driver for PDO is there to ;)

    I think it should be mandatory for these to be included into pocketmine for the fact others may want to use them and its just very considerate to other programmers who use these things on a daily basis.

    anyways here is the php extensions that allow you to use PDO I also included the php_openssl and soap extensions but you can remove them if you do not want them.(just make sure to put a ; in front of the extension include in php.ini file

    I also included Ioncube loaders as all my plugins will be encoded and you will need this to run them I use 5.4 but 5.5 is for version 8 of ioncube and upwards visit there website for details you can also pay to encode files separate to the product you buy.

    these can be dropped into your bin/php directory super easy.

    I have a PDO class I will share with you all I hope you enjoy it, I will also include a base plugin based on the new api for you to get started straight away its not .phar so feel free to use and modify it i release it under the MIT license.

    so recap = extract contents into your bin/php directory overwrite your old php.ini ( remember to backup php.ini before hand)

    I will update with a linux version soon atm this is for windows based servers

    MyPlugin contains a simple plugin template and the db class working ;)

    and example of how to do a query would be like this
    $params = array(
    'username' => $username);
    $db->query("SELECT x,y,z,username FROM users WHERE username = :username",$params);

    Attached Files:

    Falk and PEMapModder like this.

Share This Page