phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Source for file call_plugin.php

Documentation is available at call_plugin.php

  1. <?php
  2. /**
  3.  * This file gets used to access {@link Plugin} methods that are marked to be accessible this
  4.  * way. See {@link Plugin::GetSrvcMethods()}.
  5.  *
  6.  * This file is part of Quam Plures - {@link http://quamplures.net/}
  7.  * See also {@link https://launchpad.net/quam-plures}.
  8.  *
  9.  * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
  10.  * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
  11.  *  Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  12.  *
  13.  *  {@internal License choice
  14.  *  - If you have received this file as part of a package, please find the license.txt file in
  15.  *    the same folder or the closest folder above for complete license terms.
  16.  *  - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  17.  *    then you must choose one of the following licenses before using the file:
  18.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  19.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  20.  *  }}}
  21.  *
  22.  *  {@internal Open Source relicensing agreement:
  23.  *  Daniel HAHLER grants Francois PLANQUE the right to license
  24.  *  Daniel HAHLER's contributions to this file and the b2evolution project
  25.  *  under any OSI approved OSS license (http://www.opensource.org/licenses/).
  26.  *  }}}
  27.  *
  28.  *  {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  29.  * @author fplanque: Francois PLANQUE
  30.  * @author blueyed: Daniel HAHLER
  31.  *
  32.  * @package pond
  33.  */
  34.  
  35.  
  36. /**
  37.  * Initialize:
  38.  * TODO: Don't do a full init!
  39.  */
  40. require_once dirname(__FILE__).'/../qp_config/_config.php';
  41. require_once $inc_path.'_main.inc.php';
  42.  
  43.  
  44. param'plugin_ID''integer'true );
  45. param'method''string''' );
  46. param'params''string'null )// serialized
  47.  
  48. ifis_null($params) )
  49. // Default:
  50.     $params array();
  51. }
  52. else
  53. // params given. This may result in "false", but this means that unserializing failed.
  54.     $params @unserialize($params);
  55. }
  56.  
  57. if$plugin_ID )
  58. {
  59.     $Plugin $Plugins->get_by_ID$plugin_ID );
  60.  
  61.     if$Plugin )
  62.     {
  63.         debug_die'Invalid Plugin!' );
  64.     }
  65.  
  66.     ifin_array$method$Plugin->GetSrvcMethods() ) )
  67.     {
  68.         debug_die'Call to non-srvc Plugin method!' );
  69.     }
  70.     elseifmethod_exists$Plugin'srvc_'.$method ) )
  71.     {
  72.         debug_die'srvc method does not exist!' );
  73.     }
  74.  
  75.     // Call the method:
  76.     $Plugins->call_method$Plugin->ID'srvc_'.$method$params );
  77. }
  78.  
  79.  
  80. ?>