In this lab, you will install Composer, the PHP Dependency Manager, onto your Mac. We use Composer in our library videos for the basic plugin which includes Kint and Whoops. In your projects, you will Composer to package up your project as well as load and manage dependencies for you and autoload your files.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Introduction to Kint
In this video, you will play around with Kint and discover how it will help you to debug your code.
Introduction to PHP Object-Oriented Programming (OOP) for WordPress
Object-oriented programming (OOP) seeks to emulate real objects through code. In life, objects have both characteristics, those attributes that define it, and behavior. OOP is a completely different approach to programming than procedural. As such, its actual implementation is often misapplied and misunderstood. In this hands-on lab, you will get an introduction to OOP. You’ll explore how to implement it for your WordPress plugins and theme.
Wrap it Up
Congratulations! You now have all of the components installed for your local development environment. Tune Your Local Development Environment Want to continue tuning your local development environment? Follow this path to get the most out of your workflow.
PhpStorm – Installation
Recorded: February 27, 2018 PhpStorm is a professional integrated development environment (IDE) which is specifically made for PHP-powered projects. Right out of the box, you get the WordPress Coding Standard and WordPress Core documentation built right into the environment. There are no plugins you need to install and you get full control of the key mappings. PhpStorm is packed with productive and automated workflow features that will save you a ton of time, frustrations, and money. For example: With one keystroke, bam, you can reformat an entire file to the WordPress Coding Standard or whatever standard you define in your […]
Atom – Text Editor
Recorded: March 27, 2018 You always need a text editor. For me I use it for things like commit messages, formatting HTML output that I’ve grabbed from the browser, viewing text files, and more. I use my text editor for that specific task: editing text. It complements my preferred professional integrated development environment (IDE), i.e. PhpStorm. In this episode, let’s install Atom and get it setup. We’ll also configure it as the editor for git.
Gulp – Task Runner
Recorded: March 27, 2018 We want to automate redundant tasks to save ourselves time and money. Tools like gulp let us automate various tasks such as compiling Sass or LESS in CSS, optimizing images, svgs, fonts, etc., error checking our CSS and JavaScript code against known standards, and minifying the final files. These tasks are perfect candidates for a JavaScript-powered task runner. Gulp is my favorite, though Grunt is still popular too. In this episode, you and I will install gulp.
Node.js and npm – JavaScript Package Manager
Recorded: March 27, 2018 Node.js and npm are the package managers for front-end assets as well as tasks. Using npm, we can automate tasks for optimizing, processing, and compiling front-end resources like sprites, images, fonts, svgs, JavaScript files, converting Sass or LESS into CSS, and more. In this episode, you and I will install both. To install, navigate to https://nodejs.org/en/ and click the download button. After it downloads, click the file to run it. The installer GUI opens up. The installer will install both Node.js and npm. Simply follow the prompts. When it’s done, open git bash. Then type node -v […]
Composer – PHP Dependency Manager
Recorded: March 27, 2018 Composer is our dependency manager for PHP. It gives a standardized and globally accepted tool to import different packages into our projects as well as run different tasks. In order to globally install it on a Windows machine, you need to install PHP and Visual C++ Redistributable. Don’t worry. I’ll walk you through the entire process. Helpful Commands A few helpful commands for you: composer -h – view the help information composer -V – view the version that is installed on your machine composer [script name] – to run a script that is defined in your […]
What is a Package Manager?
Throughout your training, you will learn to design your code into reusable modules. These modules can then be packaged as dependencies, making them portable and modular. You then add the dependencies to your project, thereby adding them to your application. How do you add these packages? How can you add external packages, such as Zurb’s Foundation or Carbon to your project? You use a package manager. What are the Benefits? When your project depends upon a package/module/library, i.e. some external piece of software, a package manager loads the packages as well as each dependency into your local project. For example, let’s say you need […]