Skip to content

Instantly share code, notes, and snippets.

@jkrzefski
jkrzefski / app_services.xml
Created December 16, 2019 13:14
Workaround for broken mail context in Shopware
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<!-- Add some generic project services here -->
<services>
<service id="App\EventListener\FixBackendMailModule">
<tag name="shopware.event_subscriber"/>
<argument type="service" id="models"/>
<?php
namespace TestPlugin;
use KskCrowdfunding\Components\AccessEnforcer;
use Shopware\Components\CacheManager;
use Shopware\Components\Model\ModelManager;
use Shopware\Components\Plugin;
class TestPlugin extends Plugin
@jkrzefski
jkrzefski / AccessEnforcer.php
Last active May 24, 2018 12:33
This "hack" grants external callers read-, write- and execution-access to private and protected members of an instance. Beware that this violates the idea of oop and should therefore only be the last resort before giving up.
<?php
use Closure;
use Exception;
use ReflectionException;
use ReflectionMethod;
/**
* Class AccessEnforcer
*/

Keybase proof

I hereby claim:

  • I am jkrzefski on github.
  • I am jkrzefski (https://keybase.io/jkrzefski) on keybase.
  • I have a public key whose fingerprint is 2337 47F4 FE4D 91E4 9DDB 11CE 22F6 CA5D 871C 291F

To claim this, I am signing this object: