progetto201 API
|
PLANS: manages plans (returns paths and names). More...
Functions | |
get_plans ($path) | |
Returns an array with plans data (plans are stored in "/static/img/maps"). More... | |
Variables | |
$response = array('errors' => array()) | |
Prepare default response array with no errors. More... | |
$mapspath = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "static" . DIRECTORY_SEPARATOR . "img" . DIRECTORY_SEPARATOR . "maps" | |
Plan's path (file system) More... | |
PLANS: manages plans (returns paths and names).
Client perspective:
The script calls get_plans() function to get the plans that are inside the plans folder
Error codes:
get_plans | ( | $path | ) |
Returns an array with plans data (plans are stored in "/static/img/maps").
The function finds the path of each file inside the maps folder and checks the mime type:
if a files is an SVG file it gets stored inside the maps array as an associative array with these properties:
Example: GET /api/plans/plans.php
Error codes:
string | $path | file system path with plans |
$mapspath = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "static" . DIRECTORY_SEPARATOR . "img" . DIRECTORY_SEPARATOR . "maps" |
Plan's path (file system)
$response = array('errors' => array()) |
Prepare default response array with no errors.