Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
piphone-front
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
piphone
piphone-front
Commits
863b5c0c
Commit
863b5c0c
authored
Nov 22, 2014
by
Mindiell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fake REST API in order to be able to work
parent
ed7760e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletion
+55
-1
app/RestApi.php
app/RestApi.php
+44
-0
app/routes.ini
app/routes.ini
+11
-1
No files found.
app/RestApi.php
0 → 100644
View file @
863b5c0c
<?php
// Fake REST API from Campaign module
class
RestApi
{
function
campaign
(
$f3
,
$args
)
{
echo
'{
"title": "Piphone Demo\'s campaign",
"description": "This is a demo campaign used to illustrate how the piphone works. This campaign does not grants you the possibility to contact anyone, it\'s just an ilustration of how it works.",
"start_date": "2014-01-01",
"end_date": "2014-12-31",
"default_language": "en"
}'
;
}
function
contacts
(
$f3
,
$args
)
{
// List of contacts
}
function
contact
(
$f3
,
$args
)
{
if
(
$f3
->
exists
(
'PARAMS.contact'
))
{
// Specified contact
}
else
{
// Random contact
}
}
function
groups
(
$f3
,
$args
)
{
// List of groups available
}
function
categories
(
$f3
,
$args
)
{
// List of feedback categories
}
function
feedback_add
(
$f3
,
$args
)
{
// List of contacts
}
function
arguments
(
$f3
,
$args
)
{
// List of arguments
}
};
app/routes.ini
View file @
863b5c0c
[routes]
; Main site
GET
@home:/=Main->show
GET
@home:/=Main->home
; Fake REST API
GET
/restapi/campaign/@
id
=
RestApi->campaign
GET
/restapi/campaign/@id/
contacts
=
RestApi->contacts
GET
/restapi/campaign/@id/
contact
=
RestApi->contact
GET
/restapi/campaign/@id/contact/@
contact
=
RestApi->contact
GET
/restapi/campaign/@id/
groups
=
RestApi->groups
GET
/restapi/campaign/@id/feedback/
categories
=
RestApi->categories
POST
/restapi/campaign/@id/feedback/
add
=
RestApi->feedback_add
GET
/restapi/campaign/@id/arguments/@
lang
=
RestApi->arguments
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment