A Hello World API. Always returns “Hello World”.
Return “Hello World.” Always.
Make a GET request.
- Response 200 (text/plain)
# Start with the offical image for PHP 5.6 | |
FROM php:5.6 | |
# Install additonal packages | |
RUN apt-get update | |
RUN apt-get install -y git unzip libmcrypt-dev libmemcached-dev libz-dev | |
RUN pecl install memcached | |
# Install/Enable PHP extensions | |
RUN docker-php-ext-install pcntl mcrypt |
<?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; |
<?php | |
private function isFromTrustedProxy() { | |
return self::$trustedProxies&&IpUtils::checkIp($this->server->get(‘REMOTE_ADDR’), self::$trustedProxies); | |
} | |
?> |
{ | |
"element": "category", | |
"meta": { | |
"classes": [ | |
"api" | |
], | |
"title": "Hello World API" | |
}, | |
"content": [ | |
{ |
int redPin = 11; | |
int greenPin = 10; | |
int bluePin = 9; | |
int r = 0; | |
int g = 0; | |
int b = 0; | |
void setup() { | |
pinMode(redPin, OUTPUT); |
<?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(); | |
unless Vagrant.has_plugin?("<PluginName>") | |
system('vagrant plugin install <PluginName>') | |
raise("Plugin installed. Run command again."); | |
end |
<?php | |
class Node { | |
public $level = 1; | |
public $data = NULL; | |
public $left = NULL; | |
public $right = NULL; | |
public function __construct($data = NULL) { | |
$this->data = $data; |
<?php | |
// http://www.cplusplus.com/reference/stack/stack/ | |
class Stack { | |
private $_stack = array(); | |
public function size() { | |
return count($this->_stack); | |
} |