code_junkie

Possible Multi-Instanced Object Problem in PHP

Nov 13th, 2011
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. // require our common files
  2. require("modules/module.php");
  3. require("registry/objects/datetime.class.php");
  4. require("registry/objects/page.class.php");
  5.  
  6.  
  7. // load in all the objects
  8. $datetime = new dateandtime;
  9. $page = new page;
  10. $module = new module;
  11.  
  12. require("template.class.php");
  13. $template = new template($php_path . "controllers/themes/adm/" . $page . ".html");
  14.  
  15. // Place in both commonly used language and page specific language
  16. $template->language($php_path . "controllers/language/en/adm/common.php");
  17. $template->language($php_path . "controllers/language/en/adm/" . $page . ".php");
  18.  
  19. // Tell the page's module to load in data it needs
  20. $module->process_data("module_" . $page);
  21.  
  22. // Output the final result
  23. $template->output();
  24.  
  25. class module {
  26.  
  27. public function process_data ($child) {
  28. require($child . ".php");
  29. read_data();
  30. return true;
  31. }
  32. }
Add Comment
Please, Sign In to add comment