From a6cb25020bb5200cc3c00ecc941ddb751644fbcc Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 6 Dec 2015 23:12:37 +0100 Subject: add missing smarty files --- .../sysplugins/smarty_internal_runtime_foreach.php | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php (limited to 'library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php') diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php new file mode 100644 index 000000000..87bb0cf4a --- /dev/null +++ b/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php @@ -0,0 +1,44 @@ +getIterator()); + } elseif ($value instanceof Iterator) { + 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; + } +} -- cgit v1.2.3