Archive for February 2016

Yii2 print ActiveRecord query sql output

<?php   echo $query->createCommand()->sql;

Beanstalkd stats and jobs delete

telnet localhost 11300 stats   peek-ready FOUND 7 90 {"job":"Kleidoo\\Queue\\Job\\Shop\\Import\\ProductFeed","data":{"id":"303","revision":19}}   peek-delayed FOUND 7 90 {"job":"Kleidoo\\Queue\\Job\\Shop\\Import\\ProductFeed","data":{"id":"303","revision":19}}   delete 7

Beanstalkd “cold” delete all jobs

/etc/init.d/beanstalkd stop cd /var/lib/beanstalkd rm -r -f * /etc/init.d/beanstalkd start

Git hard remove last commit

git reset –hard HEAD~1

Apache2 enable mod_proxy

a2enmod proxy_http

Php curl verbose

<?php   curl_setopt($f1, CURLOPT_VERBOSE, true);

Yii 2 Download a File

<?php   return Yii::$app->response->sendFile($fileName);