A demo of the CheddarGetter API and PHP library as a simple service using the Yii framework and Vagrant with VirtualBox
If you don't already use them, download Vagrant and VirtualBox for your OS.
Clone the repo and vagrant up
. Better yet, fork and clone if you're
planning to contribute or if there's even the most remote possibility that you
will contribute improvements to the project. Pull requests welcome!
In a terminal:
$ cd cheddargetter-yii-demo
$ vagrant up
That'll take a few minutes. Once complete, you'll have a virtualized dev environment running. For the curious, here's a general overview of what vagrant is doing (FYI):
- Creates a virtual machine via VirtualBox: an Ubuntu 14.04 basic install.
- Creates a forwarded port from your host machine to the guest vm (8023 to 80). So, once provisioned, you can go to http://localhost:8023 to see the demo.
- Automatically install (via Puppet) all of the
software required to run the demo:
- PHP
- Composer
- Yii Framework
- CheddarGetter Client Library
- Apache
- MySQL
If you haven't done so already, signup for CheddarGetter. Create your product account and complete the quick-start wizard. It only takes a few minutes. If you have questions about how it works, CheddarGetter support is usually quick to respond.
Now have a coffee and relax.
Then, edit the main config file located in protected/config to pass your CheddarGetter API information to the CG component. You should have an array that looks something like:
'cheddar'=>array(
'class'=>'CheddarGetterClient',
'cgurl'=>'www.cheddargetter.com',
'cgemail'=>'you@youremail.com',
'cgpass'=>'hunter2',
'cgapp'=>'APP_NAME',
),
so we can make API calls to the proper account. You should also edit the db credentials to properly point to your preferred database.
Finally, run the SQL in protected/modules/user/data/schema.*.sql through your favorite SQL program so we can properly create and track users.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request