server {
listen 80;
root /Users/admin/htdocs/vax-uk;
index index.php index.html index.htm;
server_name vax.local;
access_log /usr/local/etc/nginx/logs/vax_access.log;
access_log /usr/local/etc/nginx/logs/vax_error.log;
<?php | |
use App\Infrastructure\EventManager\Listener\AnotherListener; | |
use App\Infrastructure\EventManager\Listener\UserLoginListener; | |
use Zend\EventManager\LazyListenerAggregate; | |
use Zend\ServiceManager\Factory\InvokableFactory; | |
use Zend\ServiceManager\ServiceManager; | |
chdir(dirname(__DIR__)); | |
require __DIR__ . '/vendor/autoload.php'; |
<?php | |
/** | |
* This is a quick example of how to stream a file to a client, likely a browser, | |
* using Zend Expressive. There are a lot of factors which it doesn't take in to | |
* account. But for the purposes of a quick intro, this should suffice. | |
*/ | |
class ViewDocumentPageAction | |
{ | |
protected function downloadFile() | |
{ |
API | Status Codes |
---|---|
[Twitter][tw] | 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504 |
[Stripe][stripe] | 200, 400, 401, 402, 404, 429, 500, 502, 503, 504 |
[Github][gh] | 200, 400, 422, 301, 302, 304, 307, 401, 403 |
[Pagerduty][pd] | 200, 201, 204, 400, 401, 403, 404, 408, 500 |
[NewRelic Plugins][nr] | 200, 400, 403, 404, 405, 413, 500, 502, 503, 503 |
[Etsy][etsy] | 200, 201, 400, 403, 404, 500, 503 |
[Dropbox][db] | 200, 400, 401, 403, 404, 405, 429, 503, 507 |
<?php | |
/* | |
* Get full Action controller name in Observer | |
*/ | |
$request = Mage::app()->getRequest(); | |
$module = $request->getControllerModule(); | |
$module_controller = $request->getControllerName(); | |
$module_controller_action = $request->getActionName(); | |
$fullActionName = $module."_".$module_controller."_".$module_controller_action; |
- For your local dev, create a
Dockerfile
that is based on your production image and simply installxdebug
into it. Exemple:
FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
This is a git pre-push hook intended to help developers keep their PHP code base clean by performing a scan with PHP CodeSniffer whenever new code is pushed to the repository. When any coding standards violations are present the push is rejected, allowing the developer to fix the code before making it public.
To increase performance only the changed files are checked when new code is
<?php | |
return Symfony\CS\Config\Config::create() | |
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) | |
->fixers([ | |
'short_array_syntax', | |
'ordered_use', | |
]) | |
; |
TLDR: The cascade={"remove"}
is like a "software" onDelete="CASCADE"
, and will remove objects from the database only when an explicit call to $em->remove()
occurs. Thus, it could result in more than one object being deleted. orphanRemoval
can remove objects from the database even if there was no explicit call to ->remove()
.
I answered this question a few times to different people so I will try to sum things up in this Gist.
Let's take two entities A
and B
as an example. I will use a OneToOne relationship in this example but it works exactly the same with OneToMany relationships.
class A
admin: | |
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml' | |
prefix: /admin | |
_sonata_admin: | |
resource: . | |
type: sonata_admin | |
prefix: /admin | |
soanata_user: |