Tagged with PHP

PHP programming

Sudo Mode with CakePHP Authorization Plugin

I’ve been working on content for my CakeFest workshop this year, and thought it would be interesting to see a commonly used authorization pattern implemented as an extension to CakePHP’s authorization system. The pattern I wanted to implement was ‘sudo mode’. Often this pattern is used in applications that have longer session duration.

Webauthn in CakePHP

I have been following the Webauthn standards and browser support since the early days of FIDO compatible keys. I strongly believe that hardware keys are our best path forward to provide phishing resistant, easy to operate authentication, that doesn’t compromise on privacy.

Getting started with Ajax Pagination & AlpineJs

I recently decided to go down a rabbit hole of wanting to learn a new client side library. I was interested in learning more about libraries that aimed to have a minimal footprint even at the cost of providing a more modest API. For this site I have simple requirements, and I wanted to see how simple the ‘simple’ abstractions are these days.

Using phive to install PHP tools

Modern PHP development generally means using a suite of tools to perform code formatting and static analysis. For a long time, I have been using composer to install theses developement tools. While using composer works great, when you’re working on multiple projects it results in duplicate copies of frequently used tools.

Testing SQLServer and PHP locally in 2021

I’ve recently been working on overhauling the test database fixture system in CakePHP . My goals are to separate fixture schema management from fixture data management. By doing this applications will more easily be able to use their existing schema management to generate their test database. This project has entailed fixing many differences between the database servers that CakePHP supports.

New TwigView Plugin

CakePHP ships with PHP based templates, and while this works for many people we’ve also recently re-launched the Twig plugin. For that past several years Wyrihaximus has maintained the excellent TwigView plugin. The CakePHP core team has joined forces with Wyrihaximus and taken over completing the 4.

Building Custom Builds for Stickler CI

Recently I shipped a new feature to Stickler CI that enables users to extend Javascript and Python builds with additional packages. Maintaining review tool dependencies can be a drain on your team’s time. Stickler CI helps solve this problem, but used to come with a tradeoff of not being able to fully customize your style rules.

Using Rector to Ease Upgrades

Upgrading major libraries that your application depends on can be a tedious and time consuming process. Dealing with deprecations and backwards incompatible changes can consume a significant amount of time and energy. In the past we’ve relied on manually updating code or using find and replace. But in last few years new techniques have emerged that make routine upgrades easier to do.

Building an iterator that can grow

A few weeks ago I ran into a tricky to solve issue in CakePHP. It involved an iterator that needs be grown during iteration, and nested loops over that same iterator. While infrequent, there are scenarios where you would want to grow an iterator as it is being iterated. My situation is the plugin registry for CakePHP. Plugins support a bootstrap hook method that is used to initialize a plugin.

Evolution of Container Usage in Stickler CI

Stickler CI is a software as a service application that automates a tedious part of code review; enforcing consistent style and preventing lint errors. By integrating with GitHub, Stickler checks each pull request for style errors and post review comments when an error is found. This helps your team align on coding standards and provide more valuable feedback. Stickler is free for public repositories; private repositories require a paid plan.

Introducing Stickler-CI

I’d like to introduce a project I’ve been working on over the past few months. Stickler-CI helps automate the tedious process of ensuring coding standards are followed during pull requests. Like many teams, FreshBooks uses pull requests as a way to solicit feedback from other developers, ensure consistent coding practices and catch bugs before they can cause real problems.