anthony / Get caller class, function and line number
0 Kedvelések
0 forkok
1 fájlok
Utoljára aktív
1 | <?php |
2 | |
3 | /** |
4 | * Returns caller class/file name, function and line where current |
5 | * |
6 | * Potentially doesn't cover all cases, but is simple and pretty handy for use in frameworks. |
7 | * |
8 | * @param bool $as_array result as array or string in this format: `<file|class>:<func>():<line>` |
9 | * @return string|array |
10 | */ |
anthony / Interpreter helper to debug dockerized cli php scripts in NetBeans
0 Kedvelések
0 forkok
1 fájlok
Utoljára aktív
1 | #!/bin/bash |
2 | |
3 | # Welcome to amusement park! |
4 | |
5 | [[ "$1" = '--help' ]] || [[ "$1" = '-h' ]] && cat <<EOF && exit |
6 | NetBeans docker wrapper for php |
7 | =============================== |
8 | Anthony Axenov (c) 2023, The MIT License |
9 | https://axenov.dev |
10 | https://opensource.org/license/mit |
anthony / Real-time PHP-FPM Status
0 Kedvelések
0 forkok
1 fájlok
Utoljára aktív
Taken from https://gist.github.com/shakahl/9dab7d1e49c5d8d6a57a4633a702d23c
Real-time PHP-FPM Status
This gist will explain you how to enable an undocumented feature of PHP-FPM
which will give a real-time performance stats.
Everybody knows the famous phpinfo()
and the page it generates, right? Then the real-time PHP-FPM
status page design is very similar.
Some informations from the top are not displayed to avoid security issues.
Enable PHP-FPM Status
anthony / Simple dotenv loader
0 Kedvelések
0 forkok
1 fájlok
Utoljára aktív
1 | <?php |
2 | |
3 | /** |
4 | * Loads an environment variable |
5 | * |
6 | * @param string $name |
7 | * @param mixed|null $def |
8 | * @param bool $local |
9 | * @return array|mixed|string|null |
10 | */ |
anthony / Simple equivalents of Oracle functions
0 Kedvelések
0 forkok
2 fájlok
Utoljára aktív
For those who like perversions
1 | <?php |
2 | |
3 | /** |
4 | * Simple php equivalent of Oracle's decode() |
5 | * |
6 | * It can be used as simple oneline-alternative to switch or if operators in many |
7 | * cases without difficult logic. For example, get string mnemocode of some value: |
8 | * |
9 | * echo 'State: '.decode($state, 0, 'disabled', 1, 'enabled', 'unknown'); |
10 | * |
anthony / Работа с Asterisk по протоколу AMI (Yeastar TG400)
0 Kedvelések
0 forkok
1 fájlok
Utoljára aktív
1 | <?php |
2 | |
3 | /** |
4 | * Класс для работы с Asterisk по протоколу AMI через сокет. |
5 | * Реализовано: подключение, авторизация, отправка команд, отправка СМС, отключение. |
6 | * Успешно работало на проде в связке с Yeastar TG400. |
7 | * |
8 | * Class to work with Asterisk gateway throuth AMI protocol via socket. |
9 | * Features: connection, authorization, send commands, send SMS, disconnect. |
10 | * Successfully used in production with Yeastar TG400. |
Újabb
Régebbi