change function headers to K&R style

Another huge change, for PEAR code standards compliance. Function
headers have to be in K&R style (opening brace on its own line),
instead of having the opening brace on the same line as the function
and parameters. So, a little perl magic found all the function
definitions and move the opening brace to the next line (properly
indented... usually).

darcs-hash:20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz
This commit is contained in:
Evan Prodromou
2008-12-23 14:33:23 -05:00
parent eb2f9c98ac
commit 04ef1ba8ee
291 changed files with 7292 additions and 3123 deletions

View File

@@ -23,7 +23,8 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Memcached_DataObject extends DB_DataObject
{
function &staticGet($cls, $k, $v=null) {
function &staticGet($cls, $k, $v=null)
{
if (is_null($v)) {
$v = $k;
# XXX: HACK!
@@ -44,7 +45,8 @@ class Memcached_DataObject extends DB_DataObject
}
}
function &pkeyGet($cls, $kv) {
function &pkeyGet($cls, $kv)
{
$i = Memcached_DataObject::multicache($cls, $kv);
if ($i) {
return $i;
@@ -62,12 +64,14 @@ class Memcached_DataObject extends DB_DataObject
}
}
function insert() {
function insert()
{
$result = parent::insert();
return $result;
}
function update($orig=null) {
function update($orig=null)
{
if (is_object($orig) && $orig instanceof Memcached_DataObject) {
$orig->decache(); # might be different keys
}
@@ -78,7 +82,8 @@ class Memcached_DataObject extends DB_DataObject
return $result;
}
function delete() {
function delete()
{
$this->decache(); # while we still have the values!
return parent::delete();
}
@@ -100,7 +105,8 @@ class Memcached_DataObject extends DB_DataObject
}
}
function keyTypes() {
function keyTypes()
{
global $_DB_DATAOBJECT;
if (!isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"])) {
$this->databaseStructure();
@@ -109,7 +115,8 @@ class Memcached_DataObject extends DB_DataObject
return $_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"];
}
function encache() {
function encache()
{
$c = $this->memcache();
if (!$c) {
return false;
@@ -133,7 +140,8 @@ class Memcached_DataObject extends DB_DataObject
}
}
function decache() {
function decache()
{
$c = $this->memcache();
if (!$c) {
return false;
@@ -158,7 +166,8 @@ class Memcached_DataObject extends DB_DataObject
}
}
function multicache($cls, $kv) {
function multicache($cls, $kv)
{
ksort($kv);
$c = Memcached_DataObject::memcache();
if (!$c) {
@@ -170,7 +179,8 @@ class Memcached_DataObject extends DB_DataObject
}
}
function getSearchEngine($table) {
function getSearchEngine($table)
{
require_once INSTALLDIR.'/lib/search_engines.php';
static $search_engine;
if (!isset($search_engine)) {