This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"results":[{"id":"1","iso":"AF","name":"AFGHANISTAN","nicename":"Afghanistan","iso3":"AFG","numcode":"4","phonecode":"93"},{"id":"2","iso":"AL","name":"ALBANIA","nicename":"Albania","iso3":"ALB","numcode":"8","phonecode":"355"},{"id":"3","iso":"DZ","name":"ALGERIA","nicename":"Algeria","iso3":"DZA","numcode":"12","phonecode":"213"},{"id":"4","iso":"AS","name":"AMERICAN SAMOA","nicename":"American Samoa","iso3":"ASM","numcode":"16","phonecode":"1684"},{"id":"5","iso":"AD","name":"ANDORRA","nicename":"Andorra","iso3":"AND","numcode":"20","phonecode":"376"},{"id":"6","iso":"AO","name":"ANGOLA","nicename":"Angola","iso3":"AGO","numcode":"24","phonecode":"244"},{"id":"7","iso":"AI","name":"ANGUILLA","nicename":"Anguilla","iso3":"AIA","numcode":"660","phonecode":"1264"},{"id":"8","iso":"AQ","name":"ANTARCTICA","nicename":"Antarctica","iso3":"ATA","numcode":"010","phonecode":"0"},{"id":"9","iso":"AG","name":"ANTIGUA AND BARBUDA","nicename":"Antigua and Barbuda","iso3":"ATG","numcode":"28","phonecode":"1268"},{"id": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In your github fork, you need to keep your master branch clean, by clean I mean without any changes, like that you can create at any time a branch from your master. Each time that you want to commit a bug or a feature, you need to create a branch for it, which will be a copy of your master branch. | |
When you do a pull request on a branch, you can continue to work on another branch and make another pull request on this other branch. | |
Before creating a new branch, pull the changes from upstream. Your master needs to be up to date. | |
Create the branch on your local machine and switch in this branch : | |
<pre>$ git checkout -b [name_of_your_new_branch]</pre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOW TO MAKE CUSTOM POST: | |
AppBundle/Controller/UserController.php: | |
<?php | |
namespace AppBundle\Controller; | |
use AppBundle\Entity\User; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find some custom route: bin/console debug:router | |
# example: api_countries_get_item | |
# Create a Controller/CountriesSpecial.php | |
<?php | |
namespace AppBundle\Controller; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"enabled_in_cluster": [# Vagrant | |
# Make sure that you are not listening ports that uses Vagrants: | |
lsof -i tcp:8000 | |
Make sure that is some other port used is closed. | |
If uses then Vagrant boxes will not start |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$serv=stream_socket_server("tcp://0.0.0.0:8000",$errno,$errstr) or die("create server failed"); | |
$base = event_base_new(); | |
$event = event_new(); | |
function read_cb($socket, $flag, $base) { | |
fread($socket); | |
fwrite("hello world\n"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ref: https://github.com/lexik/LexikJWTAuthenticationBundle | |
composer require lexik/jwt-authentication-bundle | |
Register in AppKernel: | |
public function registerBundles() | |
{ | |
return array( | |
// ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace AppBundle\Entity; | |
use ApiPlatform\Core\Annotation\ApiProperty; | |
use ApiPlatform\Core\Annotation\ApiResource; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
API PLATFORM | |
https://api-platform.com | |
https://github.com/api-platform/api-platform | |
### Install ### | |
composer create-project api-platform/api-platform bookshop-api | |
bin/console doctrine:database:create | |
bin/console server:run |