You need a copy of the starter plugin. In this episode, you’ll Fork the plugin to your personal GitHub account Clone your copy of the plugin into your local project, i.e. onto your computer Test out that it’s wired to GitHub with git statusand git remote -v At this point, make sure you have the git aliases setup on your machine. If you haven’t already done Git Productive lab, you can grab the aliases for your .gitconfig file in this gist.
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.
Setup the Local Environment
Let’s setup a local environment on your development machine. Creating a local project within your favorite localhost tool, e.g. Local by Flywheel, VVV, DesktopServer, etc. Open the project in your favorite editor Launch the site, switch to https, and set the permalinks Install and activate Debug Toolkit plugin Add the debug constants to the project’s config.php file. You can find the code here in the Help Center or in this gist.
Data Store – Project Setup
Before we start the project, you need to setup the project’s environment. You’ll use this environment and workflow throughout the series to plan, build, test, and validate the data store. You’ll fork the starter plugin, clone it to your local machine, run the starter test suite, and walk through the plugin’s architecture and setup.
Simulate Store and Get
It’s very helpful to visualize what it is that you will be building in order to see (in your mind) how it will work and how you interact with it. Visualization is a very handy tool to help you plan out what to build. In this episode, you’ll walk through a visual simulation to see store and get in action and to better understand the relationship of items in the store to a unique identifier.
Defining the Container: Data Type & Retain
Let’s define the container’s data type and how to retain the items in the container. There are different strategies: JSON file database in-memory cache – such as Redis in-memory using a PHP data type We’ll discuss the problems and strengths of each. If you’d like to learn more about in-memory PHP data type, checkout the Array Data Type in the PHP Docx.
Identifying Items in the Store
Let’s discuss strategies for identifying the items in the data store. In this episode, you’ll: Figure out all of the important attributes for our identifiers Come up with a naming convention that supports those attributes More Information If you are interested in learning more about identifies, an Array Data Type in the PHP Docx is a great place to go. Check out the “Understanding the Keys” section to discover more about unique identifiers, which in this case is called a key.
Document the Basics
Let’s document the basic attributes and functionality we discussed in the last episode. Here’s what you’ll be doing: Get overview of markdown. Here’s a link to a Markdown Cheatsheet. Add a docs/requirements/basics.md file to the plugin. Create a new branch with git. Commit the changes into the branch. Note: If you don’t have the git aliases set up yet on your machine, then stop here and go do the Git Productive lab. It will speed up your workflow.
Defining the Basics of a Data Store
Let’s define the basic attributes and functionality of the data store. You’ll walk through the internal characteristics of the store as well as how to interact with it externally. Topics covered: Put items into the store Get items out of the store Within the store: Container to hold the items Retain the items in the container Store is data agnostic, meaning it doesn’t care what kind of data is stored in the container Items within the store have a unique identifier, i.e. so we can find and interact with each item in the store
Lab Introduction
Data Store – Build, Test, & Validate the Advanced Features
This is part 4 of the series. In this hands-on coding lab, you’ll build, test, and validate more advanced features for the data store, thereby extending its functionality and utility.