Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| <?php | |
| use Swagger\Annotations as SWG; | |
| /** | |
| * @SWG\Swagger( | |
| * basePath="/v1", | |
| * host="api.local", | |
| * schemes={"http"}, | |
| * produces={"application/json"}, |
| // Add a 401 response interceptor | |
| window.axios.interceptors.response.use(function (response) { | |
| return response; | |
| }, function (error) { | |
| if (401 === error.response.status) { | |
| swal({ | |
| title: "Session Expired", | |
| text: "Your session has expired. Would you like to be redirected to the login page?", | |
| type: "warning", | |
| showCancelButton: true, |
This example will help you create custom Sonata Admin page and also explain how to make a statistics admin.
You can read more here
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| <?php | |
| namespace YourBundle\Provider; | |
| use Sonata\MediaBundle\Provider\FileProvider; | |
| class ImageProvider extends FileProvider | |
| { | |
| } |
| version: '2.1' | |
| networks: | |
| monitor-net: | |
| driver: bridge | |
| volumes: | |
| prometheus_data: {} | |
| grafana_data: {} |
| <?php | |
| if (!function_exists('interface_exists')) { | |
| die('PHP version too old'); | |
| } | |
| $throwables = listThrowableClasses(); | |
| $throwablesPerParent = splitInParents($throwables); | |
| printTree($throwablesPerParent); | |
| if (count($throwablesPerParent) !== 0) { | |
| die('ERROR!!!'); |
| //Замеряем время выполнения Javascript кода | |
| var time = performance.now(); | |
| //некий код | |
| time = performance.now() - time; | |
| console.log('Время выполнения = ', time); |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <definitions name="Organization" | |
| targetNamespace="urn:Organization" | |
| xmlns:tns="urn:Organization" | |
| xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
| xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" | |
| xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" | |
| xmlns="http://schemas.xmlsoap.org/wsdl/"> |