A Hello World API. Always returns “Hello World”.
Return “Hello World.” Always.
Make a GET request.
- Response 200 (text/plain)
<?php | |
// http://www.cplusplus.com/reference/queue/queue/ | |
class Queue { | |
private $_queue = array(); | |
public function size() { | |
return count($this->_queue); | |
} |
<?php | |
// http://www.cplusplus.com/reference/stack/stack/ | |
class Stack { | |
private $_stack = array(); | |
public function size() { | |
return count($this->_stack); | |
} |
<?php | |
class Node { | |
public $level = 1; | |
public $data = NULL; | |
public $left = NULL; | |
public $right = NULL; | |
public function __construct($data = NULL) { | |
$this->data = $data; |
unless Vagrant.has_plugin?("<PluginName>") | |
system('vagrant plugin install <PluginName>') | |
raise("Plugin installed. Run command again."); | |
end |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Input extends CI_Input { | |
protected $raw; | |
protected $delete; | |
protected $patch; | |
public function __construct() { | |
parent::__construct(); | |
int redPin = 11; | |
int greenPin = 10; | |
int bluePin = 9; | |
int r = 0; | |
int g = 0; | |
int b = 0; | |
void setup() { | |
pinMode(redPin, OUTPUT); |
{ | |
"element": "category", | |
"meta": { | |
"classes": [ | |
"api" | |
], | |
"title": "Hello World API" | |
}, | |
"content": [ | |
{ |
<?php | |
private function isFromTrustedProxy() { | |
return self::$trustedProxies&&IpUtils::checkIp($this->server->get(‘REMOTE_ADDR’), self::$trustedProxies); | |
} | |
?> |
<?php | |
if($forwardedFor=$request->headers->get(‘X_FORWARDED_FOR’)){ | |
$forwardedIps=explode(“, “,$forwarded_for); | |
foreach($forwardedIpsas$forwardedIp){ | |
if(\Symfony\Component\HttpFoundation\IpUtils::checkIp($forwardedIp,$proxyIps)){ | |
$proxyIps[]=$request->server->get(‘REMOTE_ADDR’); | |
break; |