7 days of WordPress plugins, themes & templates - for free!* Unlimited asset downloads! Start 7-Day Free Trial

Next lesson playing in 5 seconds

  • Overview
  • Transcript

2.1 Getting Started

To get the most out of this course, you’re only going to need three things: PHP 5.6, the FrontYAML library and Git. In this lesson, I’ll show you how to set up these dependencies and run your code using PHP’s built-in web server.

Related Links

2.1 Getting Started

To get the most out of this course, you're only going to need three things. These are PHP 5.6, the FrontYaml Library and Git. Unlike a lot of other courses, you don't need a host of external dependencies or services to complete this one. Let's look at these dependencies in turn, starting with PHP. To be honest, you can actually use any version of PHP, starting from at least PHP 5.2, but I've sent PHP 5.6, because I want to encourage you to use at least the latest version. Which is 5.6 as I record this. However, the standard PHP library or SPL was added in PHP 5.0. But we're going to be using it in tandem with SPL file info. And this was only added to the SPL in PHP 5.2. So that's why I've said at least 5.2. One quick note, as of PHP 5.3.0, the SVL extension can no longer be disabled and is therefore always available. So my suggestion if you don't wanna go with PHP 5.6 is at least PHP 5.3. So then you don't have to do anything. It's there it's ready, ready to go, ready to use. Next we have a third party library which is a YAML front matter and marked down parser for PHP, called front YAML. You can find it at github.com/mnapoli/FrontYAML. It's an excellent library, one I've really enjoyed using, which makes retrieving and passing both YAML and marked end content almost painless. And it's essential to this course, as the sample code which we're creating and building upon throughout the course uses content stored in text files, which is a combination of markdown and yellow. I'll cover the file format a little bit later on in the course. Finally, you also going to need Git, and the reason why is to clean the source code, which we'll be building on throughout the course. Okay let's look at installing the required software. Starting with PHP depending on your operating system. You can use your native package manager such as APT or Yum assuming a Linux operating system. You can download and build the latest from source or you can download and install a Windows binary, if you're running Windows. The source in Windows binaries are all available at php.net/downloads.php. Next up is git. As with PHP, the simplest way to install it is using a packet manager of choice and once again, this is assuming you're running a Linux system. If you're not, or you wanna build from source, download a copy from Git-SEM.com and that, you can see here. On the right hand side of the set, you can see the latest source release. Click download and the version for your platform will begin downloading pretty much instantly. Finally, we have the front Yammer library. Gladly, there's nothing that you need to do because this is already configured in the source codes composed of .json file as an external dependency. Looking here in composer.json down in the require section you can see the line mnapoli/front-yaml set to version 1.5. And was we're here we'll have a look at the rest of the dependencies quickly, and note that a psr-4 auto loader has been set up for the name space which we'll be creating our code under during the course. Now let's look at running our code. To run the code we only need PHPs in the web server. You can use another one, such as Apache or EngineX if you wanted to, but the reason I chose to use the in-built web server is because no configuration is required. If you've already cloned the source, firstly run composer install to bring in all the external dependencies, and then after that you can run the application by executing php with the capital S switch. Then localhost:8000 then the -t switch specifying public, doing this from your terminal from the root of the project directory. What this does, if you're not familiar with the inbuilt web server, is to start the server on port 8000 using the public directory as the project's root. If you have done this, you can now view the application though it won't look like a lot. And you can see it at localhost:8000 and actually it should break, but that's to be accepted because there's only a band-minimum of code available. By the time the course is done, I am confident that you'll have the foundation you need to use PHP's SPL iterators to reduce the complexity, yet increase the power and flexibility of your applications. In respective to their legacy or greenfield projects. That's a bit of a bold claim but I'm intending to live up to that. That's it for this video. In the next video we're going to get an understanding of the application we'll be building on in the course.

Back to the top