}
// Adds a data row (array) to cache file and global cache array
- function addRow ($data) {
+ function addRow (array $data) {
// Is the pointe rvalid?
if (is_resource($this->pointer)) {
// Write every array element to cache file
}
// Unused method:
- function removeEntry ($search, $data, $array) {
+ function removeEntry ($search, array $data, array $array) {
if ($this->status[$this->name] == 'done') {
// Load cache into dummy array
$dummy = $this->getArrayFromCache();
}
}
- function writeArray ($array) {
+ function writeArray (array $array) {
if (is_resource($this->pointer)) {
- foreach ($array as $k => $v) {
- if (is_array($v)) {
+ foreach ($array as $key => $value) {
+ if (is_array($value)) {
// Multi line(s) found
- $LINE = '';
- foreach ($v as $k2 => $v2) {
+ $line = '';
+ foreach ($value as $key2 => $value2) {
// Put every array element in a row...
- $LINE .= $this->rewriteEntry($k, $v2);
+ $line .= $this->rewriteEntry($key, $value2);
} // END - foreach
} else {
// Single line found
- $LINE = $this->rewriteEntry($k, $v);
+ $line = $this->rewriteEntry($key, $value);
}
// Write line(s)
- $this->writeLine($LINE);
+ $this->writeLine($line);
} // END - foreach
} else {
// Cannot write array!
}
// Unused method
- function replaceEntry ($search, $replace, $search_key, $array) {
+ function replaceEntry ($search, $replace, $search_key, array $array) {
if ($this->status[$this->name] == 'done') {
// Load cache into dummy array
$dummy = $this->getArrayFromCache();
if ($key_found == TRUE) {
$key = $search_key;
// Key (hopefully) found?
- foreach ($dummy as $a => $v) {
+ foreach ($dummy as $a => $value) {
// So we can update all entries
if ($a == $search) {
// Update now...
function loadLibraries () {
// Init arrays
$__functions = [];
- $__libs = array(
+ $__libs = [
'stats',
'xml',
'callback',
'database',
'error',
'math',
- );
+ ];
// Init include file array as it follows same naming scheme
foreach ($__libs as $lib) {
} // END - foreach
// Add more libs (let's get rid of them slowly)
- foreach (array('filters') as $lib) {
+ foreach (['filters'] as $lib) {
// Add it
array_push($__functions, $lib);
} // END - foreach
}
// Adds a given entry to the database
-function memberAddEntries ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $columnIndex = NULL) {
+function memberAddEntries ($tableName, array $columns = [], array $filterFunctions = [], array $extraValues = [], array $timeColumns = [], $columnIndex = NULL) {
// Is it a member?
if (!isMember()) {
// Then abort here
}
// Edit rows by given id numbers
-function memberEditEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) {
+function memberEditEntriesConfirm ($tableName, array $columns = [], array $filterFunctions = [], array $extraValues = [], array $timeColumns = [], array $editNow = [FALSE], array $idColumn = ['id'], array $userIdColumn = ['userid'], array $rawUserId = ['userid'], array $cacheFiles = [], array $content = []) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
// Delete rows by given id numbers
-function memberDeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) {
+function memberDeleteEntriesConfirm ($tableName, array $columns = [], array $filterFunctions = [], array $extraValues = [], array $deleteNow = [FALSE], array $idColumn = ['id'], array $userIdColumn = ['userid'], array $rawUserId = ['userid'], array $cacheFiles = [], array $content = []) {
// Do this only for members
assert(isMember());
}
// "Getter" for an array from given one but only one index of it
-function getArrayFromArrayIndex ($array, $key) {
+function getArrayFromArrayIndex (array $array, $key) {
// Some simple validation
assert(isset($array[0][$key]));