In some cases you need to access your bundleconfiguration in contexts, where you have no container, or the container does not contain the configuration, because you are in a firewall livecycle like in the authentication provider context.
So there is hope. After 2 hours dumping arround, I found a working solution.
We simply have to install a Bundleextension in your bundle and implement the "PrependExtensionInterface". This one allows to prepend configurations.
Step 1) Add a BundleExtension to your bundle like that:
As you can see, there is a prepend method. This method loads your bundleconfiguration and adds the needed items to the container from which you can get the config item later. In Authenticationcontexts the bundleconfig isn`t loaded by default, so you have to do that all to inject the configitems.
Step 2) Add a config.yml to <Bundlename>/Resources/config:
This is done to keep your bundleconfigs only in the bundlecontext. So you can later access your bundleconfig. And only that.
Step 3) Now you can get your config:
At last we have to publish our new configitems in the <BundleName>/DependencyInjection/Configuration.php
That is it!
Dieses Blog durchsuchen
Montag, 31. Oktober 2016
symfony 3: get bundleconfiguration from everywhere. Authenticationprovider
In some cases you need to access your bundleconfiguration in contexts, where you have no container, or the container does not contain the configuration, because you are in a firewall livecycle like in the authentication provider context.
So there is hope. After 2 hours dumping arround, I found a working solution.
We simply have to install a Bundleextension in your bundle and implement the "PrependExtensionInterface". This one allows to prepend configurations.
Step 1) Add a BundleExtension to your bundle like that:
As you can see, there is a prepend method. This method loads your bundleconfiguration and adds the needed items to the container from which you can get the config item later. In Authenticationcontexts the bundleconfig isn`t loaded by default, so you have to do that all to inject the configitems.
Step 2) Add a config.yml to <Bundlename>/Resources/config:
This is done to keep your bundleconfigs only in the bundlecontext. So you can later access your bundleconfig. And only that.
Step 3) Now you can get your config:
At last we have to publish our new configitems in the <BundleName>/DependencyInjection/Configuration.php
That is it!
So there is hope. After 2 hours dumping arround, I found a working solution.
We simply have to install a Bundleextension in your bundle and implement the "PrependExtensionInterface". This one allows to prepend configurations.
Step 1) Add a BundleExtension to your bundle like that:
As you can see, there is a prepend method. This method loads your bundleconfiguration and adds the needed items to the container from which you can get the config item later. In Authenticationcontexts the bundleconfig isn`t loaded by default, so you have to do that all to inject the configitems.
Step 2) Add a config.yml to <Bundlename>/Resources/config:
This is done to keep your bundleconfigs only in the bundlecontext. So you can later access your bundleconfig. And only that.
Step 3) Now you can get your config:
At last we have to publish our new configitems in the <BundleName>/DependencyInjection/Configuration.php
That is it!
Freitag, 28. Oktober 2016
Munich: must have visited
This is a little offtopic I think, but I want to share my impressions of munich with you.So, if you are onetimes in Munich, feel free to follow my route there.
ASADO Parsing
My first restaurant in Munich was the steakhouse ASADO Parsing. It`s on the Parsinger Bahnhofsplatz 3. This is directly in the near of the Mainstation Munich Parsing.
The Steaks are perhaps a little small, but excelent in quality. It`s fresh and good.
But the secret tip is the young sexy waitress. She is what a man wants. Sweet small with wonderful blue eyes, long black hairs and a perfect body. A beautyful smile and a overvelming charm.
Now I got my first location where I want to get my steak from.
http://www.asado-steak.de/pasing.html
Feel free to enjoy!
ASADO Parsing
My first restaurant in Munich was the steakhouse ASADO Parsing. It`s on the Parsinger Bahnhofsplatz 3. This is directly in the near of the Mainstation Munich Parsing.
The Steaks are perhaps a little small, but excelent in quality. It`s fresh and good.
But the secret tip is the young sexy waitress. She is what a man wants. Sweet small with wonderful blue eyes, long black hairs and a perfect body. A beautyful smile and a overvelming charm.
Now I got my first location where I want to get my steak from.
http://www.asado-steak.de/pasing.html
Feel free to enjoy!
Sonntag, 23. Oktober 2016
symfony 3: 404 routing nginx
If your routing does not work, even if the debug:router shows the correct routing and all other configurations seems to be correct.
Try to delete the <root>/var folder and run composer install again.
This will recreate the var/ datas.
After that your can try to give more rights on the var folder
That solved my problem
Try to delete the <root>/var folder and run composer install again.
This will recreate the var/ datas.
After that your can try to give more rights on the var folder
That solved my problem
Samstag, 22. Oktober 2016
useful books: get the best pdfs for free
Refactoring:
Martin Fowler: "Refatoring"
https://www.csie.ntu.edu.tw/~r95004/Refactoring_improving_the_design_of_existing_code.pdf
Robert C Martin
Donnerstag, 20. Oktober 2016
php7: install xhprof un ubuntu 16.04
On ubuntu we want to install xhprof as our default profiler
Install dependencies
Install dependencies
apt-get install pear sed -i "s/ -n / /" $(which pecl) sudo apt-get install php7.0-dev sudo pecl install xhprofthats it
pear pecl: fix warnings on php7
On ubuntu 16.04 ann error might occure when you install pecl with pear and xhprof
Here is a line which fixes that
sed -i "s/ -n / /" $(which pecl)
Abonnieren
Posts (Atom)