docker ps -a | awk '{ print $1,$2 }' | grep mariadb | awk '{print $1 }' | xargs -I {} docker rm {}Copied from https://linuxconfig.org/remove-all-containners-based-on-docker-image-name
| use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | |
| // Manually authenticate user in controller | |
| $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles()); | |
| $this->get('security.token_storage')->setToken($token); | |
| $this->get('session')->set('_security_main', serialize($token)); |
docker ps -a | awk '{ print $1,$2 }' | grep mariadb | awk '{print $1 }' | xargs -I {} docker rm {}Copied from https://linuxconfig.org/remove-all-containners-based-on-docker-image-name
| <?php | |
| namespace Acme\Form\Type; | |
| use Symfony\Component\Form\AbstractType; | |
| use Symfony\Component\Form\FormInterface; | |
| use Symfony\Component\Form\FormView; | |
| use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
| class DatalistType extends AbstractType | |
| { |
| function extract_emails($str){ | |
| // This regular expression extracts all emails from a string: | |
| $regexp = '/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i'; | |
| preg_match_all($regexp, $str, $m); | |
| return isset($m[0]) ? $m[0] : array(); | |
| } | |
| $test_string = 'This is a test string... |