Taxonomy results for: PHP

Posted on , Development

Simple Cache buster for WordPress

Bust it by Design.

As with the Simple Cachebuster for Laravel I found myself needing a way to invalidate a WordPress sites assets. So as I did before, I opted to add a task to my gulpfile.js that will generate a file in the root of the site for me. /wp-cache-buster.php that simply contains a timestamp. The difference with…

Posted on , Development

Local workflow for private Composer packages

A simple symlink between the composer package and your project allows you to keep your core code all in one place.

I work on two rather large projects that follow two specific life cycles. I want to show you how easy it is to use and setup private Composer packages for use in Laravel. This does not need to be a private package and will work just the same with a public package that you might…

Posted on , Development

Using a private Composer package with Laravel and Docker.

Developing packages for use with laravel is reasonably straightforward. But we don’t all make the code for public consumption on Packagist. Adding a custom repository to your composer.json file will allow us to pull code straight from your Github account rather than Packagist. Now you should be able to add your package under require “adampatterson/app-core”:…

Posted on , Development

Full control over WordPress menus.

Sometimes you just need 100% control over your WordPress menus.

Calling wp_nav_menu() directly has its place, but typically your walker function that might generate a Bootstrap compatible main menu might not be ideal for a footer, location selection, or sidebar link list. Using wp_get_nav_menu_items() will give us access to every part of the menu object. Title, Link, Class name, and window location. Don’t forget to…

Posted on , Development

Simple Cache buster for Laravel

Caching busting with Laravel is super simple. It comes with something called Mix ( or Elixer ) that handles front-end processing. Unfortunately, my front-end requirements have some specific needs that prevent me from taking advantage of Mix. The site uses Docker and is also behind a proxy cache so there wasn’t a simple way that…

Posted on , Development

PHP Event API

A simple Event API with Event chaining and Triggers.

Events I tried a couple of existing plugin solutions most did 95% of what I needed and the other 5% was next to impossible to force. After wasting days I decided I would write my own, what follows is an overview of Tentacle event API. Contact me if you have any questions. Registering an event:…

Posted on , Development

Speed up your Composer installs

Prestissimo comes to the rescue.

Starting a new project can be exciting until you create your new project. Now sit back and wait a few minutes. Prestissimo comes to the rescue, Running with Prestissimo dropped my install time from about 75 seconds to around 21 seconds.

Posted on , Development

Using WordPress with Lumen

Lumen, WordPress, Python, and Django. Oh My!

At work, I needed a fast and flexible way to present structured data that can be consumed by Python. This was done using WordPress leveraging Custom Post Types and Advanced Custom Fields. Simply put. WordPress is the admin interface. To present the data I chose to use Laravel 5.0 and It took about an hour…

Posted on , Development

How I made my beefy VPS

How I configured my LAMP stack.

Building a VPS is a lot like planning the foundation to your home, you need to have everything done correctly before you can start building up. I chose a base install of Ubuntu Server 12.10, and knew that I needed at a minimum a LAMP server. But there are a number of other tools that are needed…

Posted on , Archived

Implemented Bcrypt to Hash Stored Passwords

If it's worth doing, it's worth over doing.

I made a large improvement to the way we hash our user passwords on Tentacle CMS. Originally Tentacle was using the default method of hashing passwords used in Dingo, This was a SHA1 hash. Still decent but not really up to newer standards. When a login is processed the username and password are submitted and…

Posted on , Archived

Dingo a Lightweight MVC PHP Framework

I have been using a small PHP MVC Framework called Dingo Framework. Dingo is a Rapid Development Application Framework written in PHP by Evan Byrme. Dingo allows you to create dynamically changing websites easily and quickly. Dingo is a relatively new full-featured framework at a compact size of 70KB, It supports Fancy URL’s, Access Control…

Posted on , Development

Php User Login With Sessions

This is a tutorial more or less on principles for sessions with PHP. It’s more about the big picture and meant as a stepping stone for further exploration. The principal behind a user login is simple, Don’t show private or secured information to non-members. By using sessions you can: Secure content from others. Show custom…