| Revision 3731:3770620079d4,
1.1 KB
checked in by franck <carnet.franck.paul@…>, 8 years ago
(diff) |
|
Simplify licence block at the beginning of each file
|
| Rev | Line | |
|---|
| [0] | 1 | <?php |
|---|
| [3731] | 2 | /** |
|---|
| 3 | * @brief Dotclear REST server extension |
|---|
| 4 | * |
|---|
| 5 | * This class extends restServer to handle dcCore instance in each rest method call. |
|---|
| 6 | * Instance of this class is provided by dcCore $rest. |
|---|
| 7 | * |
|---|
| 8 | * @package Dotclear |
|---|
| 9 | * @subpackage Core |
|---|
| 10 | * |
|---|
| 11 | * @copyright Olivier Meunier & Association Dotclear |
|---|
| 12 | * @copyright GPL-2.0-only |
|---|
| 13 | */ |
|---|
| 14 | |
|---|
| [3730] | 15 | if (!defined('DC_RC_PATH')) {return;} |
|---|
| [0] | 16 | |
|---|
| 17 | class dcRestServer extends restServer |
|---|
| 18 | { |
|---|
| [3730] | 19 | public $core; ///< dcCore instance |
|---|
| [2566] | 20 | |
|---|
| [3730] | 21 | /** |
|---|
| 22 | Object constructor. |
|---|
| [2566] | 23 | |
|---|
| [3730] | 24 | @param core <b>dcCore</b> dcCore instance |
|---|
| 25 | */ |
|---|
| 26 | public function __construct($core) |
|---|
| 27 | { |
|---|
| 28 | parent::__construct(); |
|---|
| [2566] | 29 | |
|---|
| [3730] | 30 | $this->core = &$core; |
|---|
| 31 | } |
|---|
| [2566] | 32 | |
|---|
| [3730] | 33 | /** |
|---|
| 34 | Rest method call. |
|---|
| [2566] | 35 | |
|---|
| [3730] | 36 | @param name <b>string</b> Method name |
|---|
| 37 | @param get <b>array</b> GET parameters copy |
|---|
| 38 | @param post <b>array</b> POST parameters copy |
|---|
| 39 | @return <b>mixed</b> Rest method result |
|---|
| 40 | */ |
|---|
| 41 | protected function callFunction($name, $get, $post) |
|---|
| 42 | { |
|---|
| 43 | if (isset($this->functions[$name])) { |
|---|
| 44 | return call_user_func($this->functions[$name], $this->core, $get, $post); |
|---|
| 45 | } |
|---|
| 46 | } |
|---|
| [0] | 47 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.