Installing

Requirements

WordPress 4.7+ PHP 5.4+ (this is a must cut off as the library this project uses is 5.4+) Composer (Composer is required to install the dependencies for this plugin)

WordPress Setup

Download WordPress: You can download WordPress manually and follow the wonderful instructions on .org to figure out how to get a WordPress development environment up and running.

VVV: If you are a more experienced user or want to try something new, I highly recommend VVV. VVV comes with all of the tools you need. Essentially you install Vagrant and a VM. I like VirtualBox VM but Vagrant supports many others.

Chassis: Chassis is along the same line as VVV, but is more modular. It requires more set up than VVV in some ways but, is faster to boot and sometimes you don't need all of the bells and whistles. If you do need all of the bells and whistles there are some awesome extensions for Chassis.

Once you have WordPress installed and running you will want to clone this git repository or download the zip and install it in your WordPress installs plugins directory. Here is a great guide for installing plugins. This plugin is not yet ready for the WordPress.org plugin repository but one of the goals for this project is to make it compatible.

Using Composer

Composer comes with things like VVV and is why VVV is a great choice for running a developer environment. Composer is basically a tool that helps manage packages and dependencies for PHP projects. Composer is used for three things on this plugin: load WebOnyx GraphQL library, install PHPUnit for unit testing, and finally it will auto-load all of the necessary files for the plugin.

When you have composer running on your developer environment you will want to locate the directory for wp-graphql. Once you are in the wp-graphql directory you will want to enter:

composer install

This will install all of the dependencies for the project and add a vendor folder to the project containing these dependencies. When adding new files, you may notice that sometimes they are not being automattically loaded. If you follow the namespaces convention \BEForever\WPGraphQL\ already set up, you can easily load the new file by running:

composer dump-autoload

This will regenerate all of the auto loaded files bringing in the ones that are missing. The top level namespace is BEForever\WPGraphQL.

The plugin should now be functional!

Future Notes

Eventually this plugin will not require the use of composer or build tools to work and will be place on the WordPress.org plugin repository. Stay tuned for future developments.

results matching ""

    No results matching ""