PageRenderTime 42ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/src/install/templates/plugins/function.ini_get.php

https://github.com/squidjam/zed-core
PHP | 30 lines | 14 code | 3 blank | 13 comment | 3 complexity | c310ea36101603cfa5f5392201d273db MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1, GPL-3.0, LGPL-3.0, MIT
  1. <?php
  2. /**
  3. * Copyright Zikula Foundation 2009 - Zikula Application Framework
  4. *
  5. * This work is contributed to the Zikula Foundation under one or more
  6. * Contributor Agreements and licensed to You under the following license:
  7. *
  8. * @license GNU/LGPLv3 (or at your option, any later version).
  9. * @package Zikula
  10. *
  11. * Please see the NOTICE file distributed with this source code for further
  12. * information regarding copyright and licensing.
  13. */
  14. function smarty_function_ini_get($params, &$smarty)
  15. {
  16. if (!isset($params['varname'])) {
  17. $smarty->trigger_error("ini_get: parameter 'varname' required");
  18. return false;
  19. }
  20. // check if the file exists
  21. $result = ini_get($params['varname']);
  22. if (isset($params['assign'])) {
  23. $smarty->assign($params['assign'], $result);
  24. } else {
  25. return $result;
  26. }
  27. }