Всего ~ 58 вопросов, 125 баллов. На отлично нужно набрать > 100
1 час 30 минут на весь тест. Это около 1.5 минуты на вопрос.
(function () { | |
'use strict'; | |
angular.module('myApp') | |
.controller('SomeCtrl', SomeCtrl); | |
SomeCtrl.$inject = ['$scope', '$http', ' alertService']; | |
function SomeCtrl($scope, $http, alertService) { | |
$http.put('http://some.url/user/44', { |
As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.
You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 :
function factorial($n) | |
{ | |
if ($n == 1) { | |
return $n; | |
} | |
return $n * factorial($n-1); | |
} | |
function tail_factorial($n, $acc = 1) | |
{ |
#!/usr/bin/env bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
# set -o xtrace | |
# Set magic variables for current file & dir | |
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")" |
apt-add-repository ppa:pakin/other | |
apt-get update | |
apt-get install libapache2-apachemobilefilter-perl |
FROM php:7.0-fpm | |
MAINTAINER ed <arsenal1988ed@gmail.com> | |
RUN apt-get update | |
# Install opcache | |
RUN docker-php-ext-install opcache | |
# Install APCu | |
RUN pecl install apcu |