Plugin dependencies check,php

From Jomres v4 manual

Jump to: navigation, search

This file is an example of a dependencies check to ensure that the plugin cannot be installed without another plugin being installed first. In this example, this plugin would be dependant on the plugin "dummy_third_party_plugin_handler"

The test result is set to true because although we want to demonstrate how the dependencies check works, it's likely that a developer will install this dummy plugin to see what it does, and returning false will stop it from installing. If you genuinely want to check for a dependancy, then comment out the below lines and uncomment the two that set "$this->test_result = false;"

  1. class plugin_check_dependencies
  2. {
  3. function plugin_check_dependencies()
  4. {
  5. $this->test_result = true;
  6. $this->dependencies = array ( "dummy_third_party_plugin_handler" );
  7. foreach ($this->dependencies as $p)
  8. {
  9. if (!file_exists(JOMRESPATH_BASE."/remote_plugins/".$p."/plugin_info.php") )
  10. $this->test_result = true;
  11.  
  12. //if (!file_exists(JOMRESPATH_BASE."/remote_plugins/".$p."/plugin_info.php") )
  13. // $this->test_result = false;
  14. }
  15. }
  16. }
Personal tools