app_defaults.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * FusionPBX
  4. * Version: MPL 1.1
  5. *
  6. * The contents of this file are subject to the Mozilla Public License Version
  7. * 1.1 (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. * http://www.mozilla.org/MPL/
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. *
  16. * The Original Code is FusionPBX
  17. *
  18. * The Initial Developer of the Original Code is
  19. * Mark J Crane <[email protected]>
  20. * Portions created by the Initial Developer are Copyright (C) 2008-2024
  21. * the Initial Developer. All Rights Reserved.
  22. *
  23. * Contributor(s):
  24. * Mark J Crane <[email protected]>
  25. * Tim Fry <[email protected]>
  26. */
  27. if ($domains_processed == 1) {
  28. if (class_exists('framework')) {
  29. //use global config and database objects if available
  30. maintenance::app_defaults(framework::database());
  31. } else {
  32. global $database;
  33. if ($database === null) {
  34. $database = database::new();
  35. }
  36. //set the app information for database accounting
  37. $database->app_name = maintenance::APP_NAME;
  38. $database->app_uuid = maintenance::APP_UUID;
  39. //maintenance class handles setting app defaults
  40. maintenance::app_defaults($database);
  41. }
  42. }