-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
17 lines (15 loc) · 707 Bytes
/
api.php
File metadata and controls
17 lines (15 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
namespace restapi;
# List of modules we accept and the classes that handle them.
# Class must be in ./src/controller named ControllerName.php.
$resource_list = array(
# src/controller/MyResourceController.php
'myresource' => 'MyResrourceController',
# src/controller/MyOtherResourceController.php
'myotherresource' => 'MyOtherResourceController',
);
// restapi/dispatch.php needs to include the classes referenced above.
// In case restapi is symlinked, this lets dispatch.php find the controllers.
$path = __DIR__ . DIRECTORY_SEPARATOR . 'src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
include join(DIRECTORY_SEPARATOR, array('.', 'restapi', 'dispatch.php'));