Skip to content

Instantly share code, notes, and snippets.

📚
Writing the docs

Raphael Stolt raphaelstolt

View GitHub Profile
@raphaelstolt
raphaelstolt / homebrew-php-to-phpbrew-migration.md
Last active Apr 16, 2018
Short guide on migrating from homebrew-php to phpbrew
View homebrew-php-to-phpbrew-migration.md

#Migrating from homebrew-php to phpbrew

After installing phpbrew it's time to install a set of chosen PHP versions. My picks at the time of this writing were:

sudo phpbrew install php-5.5.0 +default+dbs+mb+apxs2=/usr/sbin/apxs
sudo phpbrew install php-5.4.17 +default+dbs+mb+apxs2=/usr/sbin/apxs
sudo phpbrew install php-5.3.27 +default+dbs+mb+apxs2=/usr/sbin/apxs

When not sure where apxs is located on your system, whereis apxs is quite chatty.

@raphaelstolt
raphaelstolt / php54_php53_pear_macports.markdown
Created May 17, 2012
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts
View php54_php53_pear_macports.markdown

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@raphaelstolt
raphaelstolt / gist:2028006
Created Mar 13, 2012
Only apply JSONP(adding) via a Silex after filter on configured routes
View gist:2028006
$app->after(function (Request $request, Response $response) {
$appl = $request->attributes->get('app');
if ($request->get('jsonp_callback') !== null
&& $request->getMethod() === 'GET')
{
/**
* Configured via ConfigServiceProvider (https://github.com/igorw/ConfigServiceProvider)
* Example:
*
@raphaelstolt
raphaelstolt / pre-commit-phing
Created Apr 22, 2011
A Git pre-commit hook rejecting no-descriptive Phing and Ant build files
View pre-commit-phing
#!/usr/bin/php
<?php
define('DEPENDENT_EXTENSION', 'SimpleXML');
if (!extension_loaded(DEPENDENT_EXTENSION)) {
$consoleMessage = sprintf(
"Skipping build file checks as the '%s' extension isn't available.",
DEPENDENT_EXTENSION
);
echo $consoleMessage . PHP_EOL;
@raphaelstolt
raphaelstolt / BuildhawkLogger.php
Created Nov 20, 2010
A Phing logger providing data for the buildhawk gem
View BuildhawkLogger.php
<?php
/*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@raphaelstolt
raphaelstolt / pre-commit
Created Sep 20, 2010
A pre-commit for running PHPUnit
View pre-commit
#!/usr/bin/php
<?php
printf("%sGit pre-commit hook %1\$s", PHP_EOL);
$projectName = basename(getcwd());
exec('phpunit --configuration phpunit.xml', $output, $returnCode); // Assuming cwd here
if ($returnCode !== 0) {
$minimalTestSummary = array_pop($output);
printf("Test suite for %s failed: ", $projectName);
printf("( %s ) %s%2\$s", $minimalTestSummary, PHP_EOL);
return false; // exit(1);
@raphaelstolt
raphaelstolt / redis-glue-test.php
Created May 15, 2010
Redis installation test script
View redis-glue-test.php
<?php
define('TEST_KEY', 'are_we_glued');
$redis = new Redis();
try {
$redis->connect('localhost', 6379);
$redis->set(TEST_KEY, 'yes');
$glueStatus = $redis->get(TEST_KEY);
if ($glueStatus) {
$testKey = TEST_KEY;
echo "Glued with the Redis key value store:" . PHP_EOL;
@raphaelstolt
raphaelstolt / GitHubTicketListener.php
Created Jan 19, 2010
A PHPUnit ticket listener that interacts with the GitHub issue API
View GitHubTicketListener.php
<?php
/**
* PHPUnit
*
* Copyright (c) 2002-2010, Sebastian Bergmann <sb@sebastian-bergmann.de>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@raphaelstolt
raphaelstolt / PHPUnit_Extension_TicketListener.diff
Created Jan 19, 2010
An 'exploratory' patch for the PHPUnit_Extension_TicketListener class
View PHPUnit_Extension_TicketListener.diff
Index: TicketListener.php
===================================================================
--- TicketListener.php
+++ TicketListener.php
@@ -207,14 +207,16 @@ abstract class PHPUnit_Extensions_TicketListener implements PHPUnit_Framework_Te
} else {
$adjustTicket = TRUE;
}
+
+ $ticketInfo = $this->getTicketInfo($ticket);
You can’t perform that action at this time.