Installing rabbitmq: https://bugzilla.mozilla.org/show_bug.cgi?id=561459#c0
$ rabbitmq-server +---+ +---+ | | | | | | | |
$ rabbitmq-server +---+ +---+ | | | | | | | |
open term | |
$ workon zamboni | |
$ pyman runserver 8888 | |
open term | |
$ rabbitmq-server | |
# if wont start, http://gist.github.com/472601 | |
open term | |
$ workon zamboni |
$ git co -b rss-versions | |
# make your branch visible for others | |
$ git push origin rss-versions |
<?php | |
/** | |
* array Util class | |
*/ | |
class Arr { | |
/** | |
* $array Can be either an Array or the string output of | |
* print_r($array, true); | |
*/ | |
public static function print_php($array) { |
#!/bin/bash | |
php52_so_path="/usr/local/php5/lib/libphp5.so" | |
# /usr/libexec/apache2/libphp5.so will be copied to | |
# $php53_so_path if $php53_so_path does not exist | |
php53_so_path="/usr/libexec/apache2/libphp5.so.apple" | |
# where apache thinks the php .so file is | |
apache_conf_php_so_path="/usr/libexec/apache2/libphp5.so" | |
switch_to_php=$php52_so_path |
L1 cache reference | 0.5 ns | |
Branch mispredict | 5 ns | |
L2 cache reference | 7 ns | |
Mutex lock/unlock | 25 ns | |
Main memory reference | 100 ns | |
Compress 1K bytes w/ cheap algorithm | 3,000 ns | |
Send 2K bytes over 1 Gbps network | 20,000 ns | |
Read 1 MB sequentially from memory | 250,000 ns | |
Round trip within same datacenter | 500,000 ns | |
Disk seek | 10,000,000 ns |
$ brew install -v php --with-apache --with-mysql | |
==> Build Environment | |
CC: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CXX: /usr/bin/c++ => /usr/bin/c++-4.2 | |
LD: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
CXXFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
CPPFLAGS: -I/usr/local/Cellar/gettext/0.17/include -I/usr/local/Cellar/libpng/1.2.44/include -I/usr/local/Cellar/libxml2/2.7.7/include | |
LDFLAGS: -L/usr/local/Cellar/gettext/0.17/lib -L/usr/local/Cellar/libpng/1.2.44/lib -L/usr/local/Cellar/libxml2/2.7.7/lib | |
MAKEFLAGS: -j2 |
<?php | |
/** | |
* AliasSyncDataObject | |
* This is a data object that allows models to be marshaled from Doctrine to Si | |
* and back again. | |
* It is mostly just coordinating field alias names and keeping their values in sync. | |
*/ | |
class AliasSyncDataObject { |
<?php | |
function spinner($speed=200000) | |
{ | |
static $counter; | |
$characters = array('|', '/', '-', '\\', '|', '-', '\\'); | |
$backspace = "\010"; | |
echo $characters[$counter % (count($characters)-1)]; | |
usleep($speed); | |
echo $backspace; | |
$counter++; |
This is not an article on the theoretical proper way to implement a testing policy and/or infrastructure. This is much more real world than that. This is about finding yourself in a situation were you need to refactor or add features to an existing substantial code base. Before undertaking such an adventure you would like to lay down some tests for regression purposes. The hitch is that the code is in a framework that hasn't put testing support first.
Many PHP frameworks qualify for the statement above but the one we will talk about in this article is Codeigniter. I wont use this article to debate the quality of the Codeigniter code base. It is what it is and finds itself used for a very many (in production) websites. What this article is about is addressing the situation that there are many developers out there that may find themselves working on a product utilizing a framework such as Codeigniter