diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-12-18 15:48:49 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-12-18 15:48:49 +0100 |
commit | 439d41b194073285ab97be94253b3f4cb4395e43 (patch) | |
tree | 272d4c64ea2d766235ecb41009117b5269f8cdfd /library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php | |
parent | 08a8f195e749a120642f6c486c1dad62a73924d1 (diff) | |
download | volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.gz volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.bz2 volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.zip |
install smarty via composer and update other php libs
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php')
-rw-r--r-- | library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php deleted file mode 100644 index 689636adb..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/** - * Foreach Runtime Methods count - * - * @package Smarty - * @subpackage PluginsInternal - * @author Uwe Tews - * - **/ -class Smarty_Internal_Runtime_Foreach -{ - /** - * [util function] counts an array, arrayAccess/traversable or PDOStatement object - * - * @param mixed $value - * - * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 - * for empty elements - */ - public function count($value) - { - if (is_array($value) === true || $value instanceof Countable) { - return count($value); - } elseif ($value instanceof IteratorAggregate) { - // Note: getIterator() returns a Traversable, not an Iterator - // thus rewind() and valid() methods may not be present - return iterator_count($value->getIterator()); - } elseif ($value instanceof Iterator) { - if ($value instanceof Generator) { - return 1; - } - return iterator_count($value); - } elseif ($value instanceof PDOStatement) { - return $value->rowCount(); - } elseif ($value instanceof Traversable) { - return iterator_count($value); - } elseif ($value instanceof ArrayAccess) { - if ($value->offsetExists(0)) { - return 1; - } - } elseif (is_object($value)) { - return count($value); - } - return 0; - } -} |