PdoProfilerStorage
class PdoProfilerStorage implements ProfilerStorageInterface
Базовая PDO-хранилище для профилирования информации в базе данных PDO.
Методы
| __construct(string $dsn, string $username = '', string $password = '', int $lifetime = 86400) | ||
| array | find(string $ip, string $url, string $limit, string $method, int|null $start = null, int|null $end = null) Находит токены профиля по заданным критериям. | |
| Profile | read(string $token) Считывает данные, связанные с заданным токеном. | |
| bool | write(Profile $profile) Сохраняет профиль. | |
| purge() Очищает все данные из базы данных. |
Подробности
__construct(string $dsn, string $username = '', string $password = '', int $lifetime = 86400)
Параметры
| string | $dsn | Имя источника данных |
| string | $username | Имя пользователя базы данных |
| string | $password | Пароль для базы данных |
| int | $lifetime | Срок действия для очистки |
array find(string $ip, string $url, string $limit, string $method, int|null $start = null, int|null $end = null)
Находит токены профиля по заданным критериям.
Параметры
| string | $ip | IP-адрес |
| string | $url | URL |
| string | $limit | Максимальное количество токенов для возврата |
| string | $method | Метод запроса |
| int|null | $start | Дата начала поиска |
| int|null | $end | Дата окончания поиска |
Значение возврата
| array | Массив токенов |
Profile read(string $token)
Считывает данные, связанные с заданным токеном.
Метод возвращает false, если токен не существует в хранилище.
Параметры
| string | $token | Токен |
Значение возврата
| Profile | Профиль, связанный с токеном |
bool write(Profile $profile)
Сохраняет профиль.
Параметры
| Profile | $profile | Экземпляр Profile |
Значение возврата
| bool | Операция записи выполнена успешно |
purge()
Очищает все данные из базы данных.
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.html