Dotclear

source: inc/core/class.dc.rest.php @ 3731:3770620079d4

Revision 3731:3770620079d4, 1.1 KB checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

Simplify licence block at the beginning of each file

Line 
1<?php
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
15if (!defined('DC_RC_PATH')) {return;}
16
17class dcRestServer extends restServer
18{
19    public $core; ///< dcCore instance
20
21    /**
22    Object constructor.
23
24    @param    core        <b>dcCore</b>        dcCore instance
25     */
26    public function __construct($core)
27    {
28        parent::__construct();
29
30        $this->core = &$core;
31    }
32
33    /**
34    Rest method call.
35
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    }
47}
Note: See TracBrowser for help on using the repository browser.

Sites map