$ git config --global init.defaultBranch main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
error_reporting(E_ALL & ~E_DEPRECATED & ~E_WARNING); | |
// money_format() format specification string elements | |
$fillChar = '(=.){0,1}'; | |
$suppressGroupingChars = '(\^){0,1}'; | |
$posNegFormatStyle = '(\+|\(){0,1}'; | |
$suppressCurrencySymbol = '(!){0,1}'; | |
$leftJustify = '(-){0,1}'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!make | |
########################## Variables ##################### | |
HERE := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) | |
########################################################## | |
# I encountered this idea from my colleague Roman Basayev | |
.PHONY: | |
default: help |
This is really short, but it saved the day, okay?
You're migrating from PHP 5 to PHP 7 - about time, isn't it? - and you're replacing $php_errormsg
with error_clear_last()
and error_get_last()
, but you realize the newer functions are PHP 7 only, and you can't deploy the updated code to your
thousands of servers all at once, because you live in the real world.
This particular application has to run under both PHP 5 and PHP 7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// analyse-codebase.php | |
// Runs several PHP static analysis tools; assumes *.phar names | |
// This could be done with a shell/batch script, instead of php. | |
// If running under Windows, use paths like 'C:\desired\path\to\file' | |
// If running under *nix, use paths like '/desired/path/to/file' | |
// If PHP binary is not in your command path, you need to specify path to it. | |
// const PHP_EXE = '/the/path/to/your/PHP/executable'; |
Setup instructions for "PHP Dependency Management with Composer" workshop
The main thing you'll want is for Composer to be installed; we'll do this during the session, if needed.
Goal is for you to use your existing laptop dev environment:
- No special VM to download
- Friendly to conference Wi-fi
- Windows
- https://getcomposer.org/Composer-Setup.exe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# On Windows, using Gitbash and Zend Studio PHP binary. This file not be needed for *nix with PHP truly "installed." | |
# Kind of lame, but I use this to run php scripts: | |
# $ ./php.sh update-all-my-qa-tools.php | |
/c/Program\ Files/Zend/Zend\ Studio\ 13.0.0/plugins/com.zend.php.debug.debugger.php56.win32_13.0.1.v20151112-2045/resources/php56/php "$@" |
I hereby claim:
- I am clarkphp on github.
- I am clarkeveretts (https://keybase.io/clarkeveretts) on keybase.
- I have a public key whose fingerprint is 268F 71BA E744 AF06 9A36 A95E 49F8 FF51 DFAD DFAA
To claim this, I am signing this object: