Pieces of Auth

register now

June 2017

Presented by Chris Cornutt (@enygma)

Date: June 22, 2017
Time: 20:00 CDT

18:00 PDT, 3:00 CEST (June 23), 2:00 BST (June 23)
Not sure of the time in your area? Check it on timeanddate.com

There’s a lot to consider when it comes to the authentication and authorization methods your site uses. Let me guide you through some of the major (and minor) decisions you’ll need to make and how to find the right fit for your needs. Topics covered will include both traditional and advanced authentication methods, access control systems, credential storage and effective logging practices to help identify threats as they happen.

Chris Cornutt

For the last 10+ years, Chris has been involved in the PHP community in one way or another. These days he’s the Senior Editor of PHPDeveloper.org and curator of @phpquickfix, @jsquickfix and @websecquickfix. He’s written for several PHP publications and has spoken at conferences in both the U.S. and Europe and publishes security articles on his site Websec.io. He’s also an organizer of the Dallas PHP User Group and the Lone Star PHP Conference.

 

Transforming PHP

register now

June 2017

Presented by Christopher Pitt (@assertchris)

Date: DATE
Time: 20:00 CEST

19:00 BST, 13:00 CDT, 11:00 PDT
Not sure of the time in your area? Check it on timeanddate.com

If you use other languages, you’ve probably found features that you wish PHP had. Perhaps you miss that bit of C# class accessor syntax. Or perhaps you’d really like to use JS arrow functions…

You can have those things, and you don’t even have to write C to do it.

I’m going to introduce you to a library that will allow you to use preprocessor macros, to turn your desired bit of syntax into valid PHP syntax. Then I’m going to show you a few libraries that use those macros to bring fresh and interesting new syntax to everyday PHP applications.

Christopher Pitt

Christopher Pitt

I am a developer and writer, working at io.co.za. I usually work on application architecture, though sometimes I build compilers or robots.

 

How do I install PHPUnit?

PHPUnit is an essential tool for every PHP developers. It is one of those tools that every PHP developer should have installed in their development environment. The problems most first time PHPUnit developers run into are where to install it and how to install it. This quick guide will walk you through the process and answer both questions.

How do I install PHPUnit

The Easy Way

In your project’s root directory use this command.

composer require --dev phpunit/phpunit ^6.0

This command adds PHPUnit to your project as a development dependency. This is the absolute best way to install PHPUnit. It is the best way because this way the version of PHPUnit does not change unless you change it. We specified ^6.0 as the version which means we’ll get all the updates to the 6.0 branch but not 6.1. While BC breaks don’t happen often in PHPUnit, they have happened. If you have a globally installed version of PHPUnit and you upgrade it to a version that breaks BC, you have to go update all of your tests immediately. This is a lot of hassle if you have a lot of projects with a lot of tests. Keeping a copy of PHPUnit installed as a dev requirement in each project means that each project has its own copy that can be upgraded as necessary.

The Hard Way

In a command prompt regardless of where you are in your file system, use this command.

composer global require phpunit/phpunit ^6.0

On MacOS and Linux machines, this will install PHPUnit in ~/.composer/vendor/bin. If you add this directory to your path, then from any project, you can execute PHPUnit. However, as noted above, if you ever upgrade your globally installed packages then you will have problems.

composer global update

Run that when there is a new version of PHPUnit, it will be installed, regardless of whether this will break your existing unit tests on one or more of your projects. Windows users will need to locate the .composer/vendor/bin directory in your user’s home directory.

The “ZOMG why would you do it this way” Way

Here is the old-school use wget and move it into the correct position manually. You can do it this way, but you will have to take care of all upgrades manually as well. If you only have a single project on the computer and you never ever plan on changing the version of PHPUnit….nope, still better to use composer require --dev.

wget https://phar.phpunit.de/phpunit-6.0.phar
chmod +x phpunit-6.0.phar
sudo mv phpunit-6.0.phar /usr/local/bin/phpunit
phpunit --version

These instructions are of course for MacOS or Linux. Windows user won’t need to do chmod or sudo but will need a BAT file.

That’s it. One of those commands should get you a working copy of PHPUnit on your computer.

Resources: