The base composer package for the "Fun with Code" series
Before you start, please have a quick read about the following technologies:
- Git:
- Setting up Git - according to Github.com - this is a quick guide to set up a Git repository on your localhost (you won't need to do this, but it helps understanding it when you start playing with these repositories)
- Git Tutorial for Beginners 1 What is Git Introduction - This video series is for those of you who are like I am - I'd rather watch the video than read :)
- The cool thing about that video list is, it's a list - so there's much more down the line than just introduction. Have a bit of a browse around.
- Composer
- Composer, in a few words, is a "package manager". Most of you are familiar with linux, so you do things like "yum" or "apt-get" to install software. Think of composer as being yum or apt-get, but for PHP.
- It's as easy telling it that your project will be using something specific, and runnnig an installation for it. You can then start to use those classes and libraries in your code.
- Read more about it here: Introduction to Composer
You'll have to Fork this project (because you won't have access to submit y our code to my repository). Then you'll have to Clone it to your local machine. Then you'll have to install all the dependencies with composer, so that you can actually start work on it.
- Forking:
- My repository is read-only to you, so you'll have to "copy" it. In github terms it's called forking.
- Read up about forking here
- Cloning:
- You can't work directly on github (well, you can, but you can't run your code there) - so you'll have to copy it down to your local machine. In github / git terms that's called cloning.
- Read up about cloning here
- Installing your dependencies:
- Just run
php bin/composer installinside your directory on localhost where you cloned it, and you should see a ton of stuff being installed.
- Just run
If you run this:
php play.php
And you get the output:
It worked! Try giving your own value! :)
It means it's working perfectly :)
Please chat to me or one of the devs if you need more help, and we'll give you a nudge in the right direction.