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 | |
/** | |
* A runtime lexer generator which obtains the lexical rules from annotations. | |
* | |
* Copyright 2009 (c) Iván -DrSlump- Montes <[email protected]> | |
* Released to the Public Domain | |
* | |
* It supports the following annotations: | |
* | |
* - @lexer-mode |
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
/* | |
JSpec module which adds a new formatter (JSpec.formatters.jUnit) to generate an | |
xml document compatible with Hudson CI jUnit result browser. | |
(c) 2009 Iván -DrSlump- Montes <drslump _at_ pollinimini.net | |
Public Domain | |
*/ | |
JSpec.include({ | |
'formatters': { |
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 | |
/** | |
* Wraps an iterator allowing to obtain chunks of it as simple arrays | |
* | |
* It mimics the behaviour of the array_chunk() function. | |
* | |
* @license Public Domain | |
* @author Iván -DrSlump- Montes <drslump_at_pollinimini_dot_net> | |
*/ | |
class ChunkIterator implements Iterator, OuterIterator |
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
Index: include/template.php | |
=================================================================== | |
--- include/template.php (revision 1176) | |
+++ include/template.php (working copy) | |
@@ -256,3 +256,26 @@ | |
} | |
return $line; | |
} | |
+ | |
+ |
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 | |
/** | |
* Command building and execution | |
* | |
* Most methods implement a "fluent interface" for easy method call chaining. | |
* | |
* @see http://pollinimini.net/blog/php-command-runner/ | |
* @author Iván -DrSlump- Montes <[email protected]> | |
* @license BSD |
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 | |
// Escapes a string (if needed) using the concat function for its use | |
// in xpath expressions. | |
// Example: | |
// $xpath = '/*[@value=' . escape_string_xpath("this is "foo's\"!") . ']'; | |
// Becomes: | |
// /*[@value=concat('this is "foo', "'", 's"!')] | |
function escape_string_xpath($value) { |
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
function field() { | |
var type = 'string', | |
optional = false, | |
regexp = null, | |
custom = null; | |
return { | |
'string': function(){ type = 'string'; return this }, | |
'int': function(){ type = 'number'; return this }, | |
'optional': function(){ optional = true; return this }, |
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 | |
// Injects ZF Bootstrap resources in an object based on annotations | |
function InjectResources($obj) { | |
$obj = $this; | |
$reflObj = new \ReflectionObject($obj); | |
foreach ($reflObj->getProperties() as $prop) { | |
$doc = $prop->getDocComment(); | |
if (preg_match('/@resource(\s+(?<name>[A-Za-z_]+))?/', $doc, $m)) { | |
$name = empty($m['name']) |
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 | |
class My_Zend_Application_Bootstrap_LazyBootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
/** | |
* Bootstrap implementation | |
* | |
* This method may be overridden to provide custom bootstrapping logic. | |
* It is the sole method called by {@link bootstrap()}. | |
* |
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 | |
class DrupalClass { | |
static $instances = array(); | |
public function __construct() | |
{ | |
$class = get_class($this); | |
if (isset(self::$instances[$class])) return; |
OlderNewer