# |
Jun 28th 2017, 02:14 |
savant |
are you going to write it or do you want me to? |
# |
Jun 28th 2017, 02:14 |
savant |
just extend the ObjectRegistry class: https://github.com/cakephp/cakephp/blob/master/src/Core/ObjectRegistry.php |
# |
Jun 28th 2017, 02:14 |
xuding |
I think this makes an awsome blog post! |
# |
Jun 28th 2017, 02:14 |
xuding |
right! |
# |
Jun 28th 2017, 02:14 |
savant |
you can return any QueueEngine from it |
# |
Jun 28th 2017, 02:14 |
savant |
https://github.com/josegonzalez/cakephp-queuesadilla/blob/master/src/Queue/QueueEngineRegistry.php |
# |
Jun 28th 2017, 02:14 |
savant |
I made one for Queuesadilla |
# |
Jun 28th 2017, 02:14 |
xuding |
Yea, I think you make a valid point |
# |
Jun 28th 2017, 02:13 |
savant |
`ServiceRegistry` |
# |
Jun 28th 2017, 02:13 |
xuding |
“service class” :slightly_smiling_face: |
# |
Jun 28th 2017, 02:13 |
savant |
what kind of object? |
# |
Jun 28th 2017, 02:13 |
xuding |
just a object |
# |
Jun 28th 2017, 02:13 |
savant |
what does `makeDeleteProductVariant()` return? |
# |
Jun 28th 2017, 02:13 |
xuding |
yea, i understood that, just wonder how to do that using cakephp |
# |
Jun 28th 2017, 02:13 |
savant |
for instance, here is a plugin that uses Ray.DI, by one of the core developers: https://github.com/lorenzo/piping-bag |
# |
Jun 28th 2017, 02:12 |
savant |
we also dont stop you from using your own DIC |
# |
Jun 28th 2017, 02:12 |
xuding |
which is serving as a service locator |
# |
Jun 28th 2017, 02:12 |
xuding |
``` function makeDeleteProductVariant() ``` |
# |
Jun 28th 2017, 02:12 |
xuding |
this is what I am doing in my app: |
# |
Jun 28th 2017, 02:11 |
savant |
correct me if I’m wrong, @markstory |
# |
Jun 28th 2017, 02:11 |
savant |
just extend ObjectRegistry and you can have your own service locator |
# |
Jun 28th 2017, 02:11 |
xuding |
I mean service locator. |
# |
Jun 28th 2017, 02:11 |
savant |
ComponentRegistry, HelperRegistry, LogEngineRegistry… etc. |
# |
Jun 28th 2017, 02:11 |
xuding |
interesting! |
# |
Jun 28th 2017, 02:11 |
savant |
You can see that in any of the ObjectRegistry classes, like TableRegistry |
# |
Jun 28th 2017, 02:10 |
savant |
If you mean a service locator, which is a common pattern related to DIC, then we already do that |
# |
Jun 28th 2017, 02:10 |
savant |
since you just have thing that contains a reference to everything/can make it out of thin air |
# |
Jun 28th 2017, 02:10 |
savant |
Thats what a DIC usually ends up being used as in an application |
# |
Jun 28th 2017, 02:09 |
savant |
Do you mean `$_GLOBALS`? |
# |
Jun 28th 2017, 02:06 |
xuding |
why didn’t CakePHP choose to go the DIC container route? |
# |
Jun 28th 2017, 02:06 |
savant |
? |
# |
Jun 28th 2017, 02:05 |
xuding |
might be a dumb qns. |
# |
Jun 28th 2017, 00:37 |
savant |
no problem, good luck! |
# |
Jun 28th 2017, 00:37 |
aproapedelune |
thank you! :slightly_smiling_face: |
# |
Jun 28th 2017, 00:34 |
savant |
https://serverfault.com/questions/422507/mysql-incorrect-information-in-file-corrupt-error |
# |
Jun 28th 2017, 00:34 |
savant |
here is a stackoverflow answer regarding steps you can take to recover |
# |
Jun 28th 2017, 00:34 |
savant |
you have a corrupt database |
# |
Jun 28th 2017, 00:31 |
savant |
whats the exact error message? |
# |
Jun 28th 2017, 00:30 |
aproapedelune |
Thank you. I created the project and made the connection with my database. The database has 3 tables, I m trying to follow the acl application tutorial. When I try to bake the tables, I have an error. I write cake bake all table_name but it doesn t work. It returns "Exception: SQLSTATE[HY000] : General error: 1033 Incorrect information in file..... |
# |
Jun 28th 2017, 00:21 |
savant |
you can manually create a controller |
# |
Jun 28th 2017, 00:21 |
aproapedelune |
Ok, thank you. All the Controllers should be generated, or I can manually create one? |