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 | |
function saveCacheFile($file, $contents) | |
{ | |
$serialized = serialize($contents); | |
$len = strlen($serialized); | |
$cachefile_fp = @fopen($file, 'xb'); // x is the O_CREAT|O_EXCL mode | |
if ($cachefile_fp !== false) { // create file | |
if (fwrite($cachefile_fp, $serialized, $len) < $len) { | |
return PEAR::raiseError("Could not write $file."); |
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 DatabaseStatementBase extends PDOStatement { | |
public $dbh; | |
protected function __construct($dbh) { | |
$this->dbh = $dbh; | |
$this->setFetchMode(PDO::FETCH_OBJ); | |
} | |
public function fetchAllKeyed($key_index = 0, $value_index = 1) { |
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 DatabaseStatementBase extends PDOStatement { | |
public $dbh; | |
protected function __construct($dbh) { | |
$this->dbh = $dbh; | |
$this->setFetchMode(PDO::FETCH_OBJ); | |
} | |
} |
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
static __inline void do_cpuid(u_int ax, u_int *p) { | |
__asm __volatile("pushl %%ebx\n\t" | |
"cpuid\n\t" | |
"movl %%ebx, %%esi\n\t" | |
"popl %%ebx\n\t" | |
: "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) | |
: "a" (ax)); | |
} |
NewerOlder