Simple and safe random getters to copy-paste
string randomBytes( int $length )
int randomInt ( int $min , int $max )
string randomUuid ( void )
# Custom docker image which exposes 8080 | |
image: lafayette/hoth:5.5 | |
services: | |
- selenium/standalone-chrome:latest | |
before_script: | |
# Use 0.0.0.0 instead of localhost to allow external connections | |
- php -S 0.0.0.0:8080 -t ../ &> /dev/null & |
#!/bin/bash | |
# Install dependencies only for Docker. | |
[[ ! -e /.dockerinit ]] && exit 0 | |
set -xe | |
# Update packages and install composer and PHP dependencies. | |
apt-get update -yqq | |
apt-get install git libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev phpunit -yqq |
The API we are creating in this gist will follow these rules :
password
Grant Type only (no need for Authorization pages and such).v1.api.example.com
)The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :
<?php | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity() | |
* @ORM\Table(name="user") | |
*/ | |
class User |