diff options
author | rvelices <rv-github@modusoptimus.com> | 2013-06-20 03:38:47 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2013-06-20 03:38:47 +0000 |
commit | 6fc07742f8fca9d32db23243d374ea27e8ee4c1e (patch) | |
tree | bc7240c53a1c6bdff6c785153deb6306585c4062 /include/smarty/libs/internals/core.rm_auto.php | |
parent | 9843eb362dd7d1b9d762871777ef76fa84e8202a (diff) |
smarty 3 - first pass for tests
git-svn-id: http://piwigo.org/svn/trunk@23384 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/smarty/libs/internals/core.rm_auto.php | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/include/smarty/libs/internals/core.rm_auto.php b/include/smarty/libs/internals/core.rm_auto.php deleted file mode 100644 index b251f6491..000000000 --- a/include/smarty/libs/internals/core.rm_auto.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * Smarty plugin - * @package Smarty - * @subpackage plugins - */ - -/** - * delete an automagically created file by name and id - * - * @param string $auto_base - * @param string $auto_source - * @param string $auto_id - * @param integer $exp_time - * @return boolean - */ - -// $auto_base, $auto_source = null, $auto_id = null, $exp_time = null - -function smarty_core_rm_auto($params, &$smarty) -{ - if (!@is_dir($params['auto_base'])) - return false; - - if(!isset($params['auto_id']) && !isset($params['auto_source'])) { - $_params = array( - 'dirname' => $params['auto_base'], - 'level' => 0, - 'exp_time' => $params['exp_time'] - ); - require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); - $_res = smarty_core_rmdir($_params, $smarty); - } else { - $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']); - - if(isset($params['auto_source'])) { - if (isset($params['extensions'])) { - $_res = false; - foreach ((array)$params['extensions'] as $_extension) - $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']); - } else { - $_res = $smarty->_unlink($_tname, $params['exp_time']); - } - } elseif ($smarty->use_sub_dirs) { - $_params = array( - 'dirname' => $_tname, - 'level' => 1, - 'exp_time' => $params['exp_time'] - ); - require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); - $_res = smarty_core_rmdir($_params, $smarty); - } else { - // remove matching file names - $_handle = opendir($params['auto_base']); - $_res = true; - while (false !== ($_filename = readdir($_handle))) { - if($_filename == '.' || $_filename == '..') { - continue; - } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) { - $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']); - } - } - } - } - - return $_res; -} - -/* vim: set expandtab: */ - -?> |