Chapters
26 Chapters
|
2:18:26
|
This course is archived!
This tutorial uses a deprecated micro-framework called Silex. The fundamentals of REST are still ?valid, but the code we use can't be used in a real application.
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
19.
Hypermedia vs. Media (Buzzwords!)
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This tutorial uses a deprecated micro-framework called Silex. The fundamentals of REST are still ?valid, but the code we use can't be used in a real application.
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"silex/silex": "~1.0", // v1.3.2
"symfony/twig-bridge": "~2.1", // v2.7.3
"symfony/security": "~2.4", // v2.7.3
"doctrine/dbal": "^2.5.4", // v2.5.4
"monolog/monolog": "~1.7.0", // 1.7.0
"symfony/validator": "~2.4", // v2.7.3
"symfony/expression-language": "~2.4", // v2.7.3
"jms/serializer": "~0.16", // 0.16.0
"willdurand/hateoas": "~2.3" // v2.3.0
},
"require-dev": {
"behat/mink": "~1.5", // v1.5.0
"behat/mink-goutte-driver": "~1.0.9", // v1.0.9
"behat/mink-selenium2-driver": "~1.1.1", // v1.1.1
"behat/behat": "~2.5", // v2.5.5
"behat/mink-extension": "~1.2.0", // v1.2.0
"phpunit/phpunit": "~5.7.0", // 5.7.27
"guzzle/guzzle": "~3.7" // v3.9.3
}
}
2 Comments
Hey Ryan,
This strange error has just popped up and I can't figure out where it's coming from, any idea what's happening here?!
POST: http://localhost:8000/api/tokens
Fatal error: Uncaught InvalidArgumentException: Identifier "api.response_factory" is not defined. in /Users/shaunthornburgh/Documents/Development/code-battle-3/vendor/pimple/pimple/lib/Pimple.php:78
Stack trace:
#0 /Users/shaunthornburgh/Documents/Development/code-battle-3/src/KnpU/CodeBattle/Application.php(286): Pimple->offsetGet('api.response_fa...')
#1 /Users/shaunthornburgh/Documents/Development/code-battle-3/vendor/pimple/pimple/lib/Pimple.php(126): KnpU\CodeBattle\Application->KnpU\CodeBattle\{closure}(Object(KnpU\CodeBattle\Application))
#2 /Users/shaunthornburgh/Documents/Development/code-battle-3/vendor/pimple/pimple/lib/Pimple.php(83): Pimple::{closure}(Object(KnpU\CodeBattle\Application))
#3 /Users/shaunthornburgh/Documents/Development/code-battle-3/vendor/silex/silex/src/Silex/Provider/SecurityServiceProvider.php(399): Pimple->offsetGet('security.entry_...')
#4 /Users/shaunthornburgh/Documents/Development/code-battle-3/vendor/pimple/pimple/lib/Pimple.php(126): Silex\Provider\SecurityServiceProvider->Silex\Pro in /Users/shaunthornburgh/Documents/Development/code-battle-3/vendor/pimple/pimple/lib/Pimple.php on line 78
Here is my repo... https://github.com/shauntho...
Hey Shaun T.!
Ah, I think it's an easy fix :). For some reason, I don't see your
api.response_factorydefined: we created it here: https://knpuniversity.com/screencast/rest-ep2/centralizing-error-response-creation#creating-an-api-response-factory-service. Did you maybe just miss that part somehow?Cheers!
"Houston: no signs of life"
Start the conversation!