Skip to content

Instantly share code, notes, and snippets.

@zymsys
zymsys / DIP.php
Created April 8, 2012 15:53
SOLID Sample Code
<?php
class FooControllerConventional
{
function indexView() {
$model = new FooModel();
$viewData = $model->fetchAll();
$view = new FooView();
$view->render($viewData);
}
}
@zymsys
zymsys / LSPExampleViolation.php
Created March 8, 2012 03:11
Rectangle / Square LSP Example Violation in PHP
<?php
class Rectangle
{
private $_width;
private $_height;
public function getWidth()
{
return $this->_width;
@zymsys
zymsys / fiddle.response.json
Created January 23, 2012 00:53
Demo JSON data
[
{
"name":"Tanner Young",
"phones":[
{
"name": "home",
"number": "1-802-826-8704"
},
{
"name": "fax",
@zymsys
zymsys / gist:1595001
Created January 11, 2012 14:52
How I build PHP 5.4 on OSX from source
I had to run find to figure out where bz2.so was:
$ sudo find / -name bz2.so
...
Should turn something up - I hope. Change the eclipse path below to whatever you find. If you can't find anything you might have to install Zend Studio or figure out another source. Then from the PHP source folder:
$ ./configure --enable-mysqlnd --with-gd --enable-mbstring --with-bz2=/Applications/eclipse/plugins/org.zend.php.debug.debugger.macosx_5.3.7.v20091124/resources/php5/ext/ --with-zlib --with-curl --with-curlwrappers
$ make