PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/vdl-include/vdl-core/core_main.class.php

https://github.com/ivansoriasolis/Vidali
PHP | 53 lines | 31 code | 7 blank | 15 comment | 1 complexity | 51da9d4f8422ed2c56e3f76c8089e162 MD5 | raw file
Possible License(s): AGPL-3.0
  1. <?php
  2. /* Vidali, Social Network Open Source.
  3. This file is part of Vidali.
  4. Vidali is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. Vidali is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with Foobar. If not, see <http://www.gnu.org/licenses/>.*/
  14. require_once 'core_db.class.php';
  15. class CORE_MAIN extends CORE_DB{
  16. private $_connection;
  17. public function __construct (){
  18. parent::__construct();
  19. date_default_timezone_set("Europe/London");
  20. }
  21. public function __destruct(){
  22. unset($this->_conection);
  23. }
  24. public function load (){
  25. $this->_connection = parent::connect();
  26. $query = "SELECT * FROM vdl_config ORDER BY config_id";
  27. if(!$result = $this->_connection->query($query)){
  28. printf("Error: %s\n", $this->_connection->error);
  29. parent::close($this->_connection);
  30. return false;
  31. }
  32. else{
  33. while($row = $result->fetch_assoc()){
  34. define ($row["config_name"],$row["config_value"]);
  35. }
  36. return true;
  37. }
  38. }
  39. public function load_lang(){
  40. include ("vdl-lang/lang_" . LANG . ".conf.php");
  41. }
  42. }
  43. ?>