PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/helpers/config.php

https://github.com/MilkZoft/zan
PHP | 31 lines | 31 code | 0 blank | 0 comment | 1 complexity | 2d375a74eed7aee25ecc7bbac6026038 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. if (!defined("ACCESS")) {
  3. die("Error: You don't have permission to access here...");
  4. }
  5. if (!function_exists("_get")) {
  6. function _get($var = null)
  7. {
  8. global $ZP;
  9. if ($var === "db") {
  10. include "www/config/database.php";
  11. return isset($ZP["db"]) ? $ZP["db"] : false;
  12. }
  13. return isset($ZP[$var]) ? $ZP[$var] : false;
  14. }
  15. }
  16. if (!function_exists("set")) {
  17. function set($var = null, $value = null)
  18. {
  19. global $ZP;
  20. if (is_null($var) or is_null($value)) {
  21. return false;
  22. }
  23. $ZP[$var] = $value;
  24. }
  25. }