Skip to content

Instantly share code, notes, and snippets.

@elstamey
Last active October 9, 2015 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elstamey/f7db218b43cdee8919b2 to your computer and use it in GitHub Desktop.
Save elstamey/f7db218b43cdee8919b2 to your computer and use it in GitHub Desktop.
Questions about setting up my phergie development environment

I began plugin development at the hackathon at PHPTek, and I installed my phergie environment using a tarred up thing. But I'm not having some problems running phergie locally. I cannot seem to figure it out, so here is a foundational bit that I cannot get from the documentation.

Should I composer install from the composer.json file on the readme?

{
    "require": {
        "phergie/phergie-irc-bot-react": "^1.3"
    }
}

If so, where do I put my plugin? If I try to include it in the composer.json file, nothing is being installed.

{
    "require": {
        "phergie/phergie-irc-bot-react": "^1.3",
        "phergie/phergie-irc-plugin-react-tableflip": "^1.0"
    }
}

This is what is actually installed:

evenement/evenement              v2.0.0 Événement is a very simple event dispatching library for PHP
monolog/monolog                  1.17.1 Sends your logs to files, sockets, inboxes, databases and various web services
phergie/phergie-irc-client-react 2.3.0  IRC client library built on React
phergie/phergie-irc-connection   2.0.0  Data structure for containing information about an IRC client connection
phergie/phergie-irc-event        1.0.2  PHP data structure for IRC event information
phergie/phergie-irc-generator    1.7.0  Generator for messages conforming to the IRC protocol
phergie/phergie-irc-parser       2.1.0  Parser for messages conforming to the IRC protocol
psr/log                          1.0.0  Common interface for logging libraries
react/cache                      v0.4.0 Async caching.
react/dns                        v0.4.1 Async DNS resolver.
react/event-loop                 v0.4.1 Event loop abstraction layer that libraries can use for evented I/O.
react/promise                    v2.2.1 A lightweight implementation of CommonJS Promises/A for PHP
react/socket                     v0.4.2 Library for building an evented socket server.
react/socket-client              v0.4.4 Async connector to open TCP/IP and SSL/TLS based connections.
react/stream                     v0.4.3 Basic readable and writable stream interfaces that support piping.

##So where does my plugin code belong?

@elazar
Copy link

elazar commented Oct 9, 2015

It looks like your plugin is requiring itself? Beyond that, the plugin composer.json file looks fine.

For your local bot instance, this looks like a reasonable composer.json file for that, as you showed above:

{
    "require": {
        "phergie/phergie-irc-bot-react": "^1.3",
        "phergie/phergie-irc-plugin-react-tableflip": "^1.0"
    }
}

From the directory containing that composer.json file, you should be able to run composer install and then run ./vendor/bin/phergie config.php from the same directory.

@elstamey
Copy link
Author

elstamey commented Oct 9, 2015

What I was saying is the documentation says to require the bot, but then HOW do i add my plugin? When I do it the way shown in the second example, it doesn't install anything. But with a composer.json file that looks like the first one, I do not have a /vendor/bin/phergie there is no bin at all.

@elstamey
Copy link
Author

elstamey commented Oct 9, 2015

{
"require": {
    "phergie/phergie-irc-bot-react": "^1.3",
    "phergie/phergie-irc-plugin-react-tableflip": "dev-master"
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/elstamey/phergie-irc-plugin-react-tableflip"
    }
]
}

local: phergie $ composer install

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating autoload files
local: phergie $ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Installing phergie/phergie-irc-plugin-react-tableflip (dev-master 2b0f0b7)
    Cloning 2b0f0b7b35e617e06eb33e3f13a08cfd827666b0
  • Installing phergie/phergie-irc-plugin-react-command (1.1.0)
    Downloading: 100%

phergie/phergie-irc-plugin-react-tableflip suggests installing phergie/phergie-irc-plugin-react-commandhelp (provides interactive help for commands)
Writing lock file
Generating autoload files
local: phergie $ ls vendor/
autoload.php bin composer evenement monolog phergie psr react
local: phergie $ ls vendor/phergie/phergie-irc-
phergie-irc-bot-react/ phergie-irc-connection/ phergie-irc-generator/ phergie-irc-plugin-react-command/
phergie-irc-client-react/ phergie-irc-event/ phergie-irc-parser/ phergie-irc-plugin-react-tableflip/

It's there now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment