- Install librairies/bundle:
$ composer require sroze/messenger-enqueue-transport enqueue/sqs- Enable
EnqueueAdapterBundlebundle:
// config/bundles.php
<?php| <?php | |
| declare(strict_types=1); | |
| namespace MyPackage\Validator\Constraints\Vat; | |
| use Psr\Log\LoggerInterface; | |
| use Symfony\Component\Validator\Constraint; | |
| use Symfony\Component\Validator\ConstraintValidator; | |
| use Symfony\Component\Validator\Exception\UnexpectedTypeException; |
$ composer require sroze/messenger-enqueue-transport enqueue/sqsEnqueueAdapterBundle bundle:// config/bundles.php
<?php| namespace :cachetool do | |
| task :run, :command do |t, args| | |
| args.with_defaults(:command => :list) | |
| on release_roles(fetch(:cachetool_roles)) do | |
| within fetch(:cachetool_working_dir) do | |
| execute :cachetool, args[:command], *args.extras | |
| end | |
| end | |
| end |
| $ brew install php56 --with-gmp --with-homebrew-apxs --with-homebrew-curl --with-homebrew-libressl --with-homebrew-libxml2 --with-homebrew-libxslt --with-imap --with-mssql --with-postgresql --without-apache | |
| ==> Installing php56 from homebrew/homebrew-php | |
| ==> Downloading https://php.net/get/php-5.6.14.tar.bz2/from/this/mirror | |
| Already downloaded: /Library/Caches/Homebrew/php56-5.6.14 | |
| ==> ./configure --prefix=/usr/local/Cellar/php56/5.6.14 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.6 --with-config-file-path=/us | |
| ==> make | |
| ==> make install | |
| ==> Caveats | |
| The php.ini file can be found in: | |
| /usr/local/etc/php/5.6/php.ini |
| import os | |
| filename = 'my_file.txt' | |
| filesize = os.path.getsize(filename) | |
| b_read = 0 | |
| f = open(filename, 'r') | |
| # read n bytes and perform action | |
| # ... | |
| b_read += n |
| <?php | |
| // in config : <parameter key="translator.class">AppBundle\Translation\TestTranslator</parameter> | |
| namespace AppBundle\Translation; | |
| use Symfony\Component\Translation\Translator; | |
| class TestTranslator extends Translator | |
| { | |
| /** |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| $input = ['a' => 'b', 'c' => 'd']; | |
| $keys = array_keys($input); | |
| $values = array_values($input); | |
| $i = 0; | |
| while (isset($keys[$i], $values[$i])) { | |
| $currentKey = $keys[$i]; | |
| $currentValue = $values[$i]; |
| function f($a, $k) { | |
| $b = $a; | |
| $c = &$k; | |
| $b[$k] = null; | |
| if (null === $a[$k]) { | |
| $a[$k] = $c; | |
| return true; | |
| } |
| function f($a, $k) { ob_start(); debug_zval_dump($a[$k]); preg_match('/refcount\((\d+)/', ob_get_clean(), $b); return $b[1] == 1; } |