View gist:5412216
This file contains 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
Include "/usr/local/zend/etc/sites.d/http/__default__/0/*.conf" | |
<Directory "/usr/local/zend/var/apps/http/__default__/0/"> | |
Allow From All | |
</Directory> |
View gist:5412240
This file contains 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
Include "/usr/local/zend/etc/sites.d/http/__default__/0/*.conf" | |
<Directory "/usr/local/zend/var/apps/http/__default__/0/"> | |
Allow From All | |
</Directory> |
View gist:5434032
This file contains 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 | |
/** | |
* String representation of this object | |
* @return string | |
*/ | |
public function __toString() | |
{ | |
try { | |
return (string) $this->name; |
View gist:5466324
This file contains 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
<pre> | |
<?php | |
// Host | |
$host = 'yourhostname.com'; | |
$port = 21; | |
$timeout = 90; | |
// Credentials | |
$username = 'yourusername'; |
View gist:5590689
This file contains 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 | |
class TestFixfilesController extends Controller | |
{ | |
public function on_before_render() | |
{ | |
$originalsDirectory = '/var/www/your-website.com/missing-files/'; | |
$originalFilenames = scandir($originalsDirectory); |
View gist:5985451
This file contains 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
CREATE TABLE `log` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
`priority` tinyint(1) NOT NULL, | |
`priorityName` varchar(5) CHARACTER SET ascii NOT NULL DEFAULT 'DEBUG', | |
`message` varchar(255) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; |
View gist:6040703
This file contains 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 | |
$directories = scandir('/some_directory'); | |
array_shift($dirs); | |
array_shift($dirs); | |
$baseDirectory = '/another_directory'; | |
foreach($directories as $directory) { | |
$filename = current(explode('.', $directory)); |
View gist:6130199
This file contains 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 | |
// Headings and rows | |
$headings = array('ID', 'Name', 'Colour'); | |
$array = array( | |
array(1, 'Apple', 'Green'), | |
array(2, 'Banana', 'Yellow'), | |
array(3, 'Orange', 'Orange'), | |
); |
View gist:6223818
This file contains 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 | |
/* | |
* "Late Static Binding" namespace | |
*/ | |
$class = get_called_class(); | |
$lastSlashPosition = strrpos($class, '\\'); | |
$namespace = substr($class, 0, $lastSlashPosition); |
View gist:6621005
This file contains 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
{ | |
"name": "andrewkirkpatrick/sample", | |
"description": "Sample project", | |
"homepage": "http://www.andrew-kirkpatrick.co.uk", | |
"repositories": [{ | |
"type": "package", | |
"package": { | |
"name": "andrewkirkpatrick/library", | |
"version": "0.1.0", | |
"source": { |
OlderNewer