# |
Jan 14th 2020, 18:40 |
ricksaccous |
just some extra tips |
# |
Jan 14th 2020, 18:40 |
ricksaccous |
no |
# |
Jan 14th 2020, 18:39 |
andre.karner |
but yes .. you are write - i'd better move this code the controller .. however, do you think that this leads to my problem? |
# |
Jan 14th 2020, 18:38 |
andre.karner |
also not in static functions? |
# |
Jan 14th 2020, 18:37 |
ricksaccous |
you shouldn't be doing things like that, imo, it's just going to bite you in the butt |
# |
Jan 14th 2020, 18:37 |
ricksaccous |
also you aren't really following cake conventions by loading a table class in an entity |
# |
Jan 14th 2020, 18:36 |
andre.karner |
4.0.1 on both |
# |
Jan 14th 2020, 18:35 |
ricksaccous |
do you have 2 different versions of cake? |
# |
Jan 14th 2020, 18:34 |
andre.karner |
jesus |
# |
Jan 14th 2020, 18:34 |
andre.karner |
well ... get_class() gives different outputs on both systems - while its a User class on local machine it is a "entity" on remote |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
in a users plugin, rector doesn't know what to do, i suppose i could load all these files manually but there has to be a better way |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
```namespace Users\Traits;``` |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
like |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
not all unix systems are created equal |
# |
Jan 14th 2020, 18:32 |
andre.karner |
but let me check the result of get_class() |
# |
Jan 14th 2020, 18:32 |
ricksaccous |
so i noticed that rector is not autoloading all files in my "plugins" folder which it should via vendor/cakephp-plugins.php in the autoload but if i have for instance a trait class namespaced |
# |
Jan 14th 2020, 18:32 |
andre.karner |
both systems are running on an unix system .. one on docker and the remote one on ubuntu |
# |
Jan 14th 2020, 18:31 |
ndm |
I don't want to jump to conclusions yet, but very likely filesystem a case sensitivity issue, at least that's the issue 9 out 10 times |
# |
Jan 14th 2020, 18:31 |
ricksaccous |
are you sure you don't have mistyped casing in your folder or file names? |
# |
Jan 14th 2020, 18:30 |
andre.karner |
the funny thing is, the same code works on my local machine .. just not on the remote one |
# |
Jan 14th 2020, 18:29 |
ndm |
@andre.karner `$user` probably isn't what you think it is, check `debug(get_class($user))` |
# |
Jan 14th 2020, 18:27 |
ricksaccous |
okay it's reading from my yaml just not working, hmmmm |
# |
Jan 14th 2020, 18:27 |
andre.karner |
and that: https://github.com/cakephp/cakephp/issues/14172 |
# |
Jan 14th 2020, 18:26 |
andre.karner |
anyone encountered similar issue like that? https://github.com/cakephp/cakephp/issues/14171 |
# |
Jan 14th 2020, 18:25 |
andre.karner |
hey guys - since my issue on github got closed I am trying to find help here, although i think that it is a bug .. |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
do i have to do rectory rector.yaml? like feed the file to the command |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
the docs don't say you have to do anything special |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
how can i make sure rector is reading from rector.yaml? |
# |
Jan 14th 2020, 17:01 |
this.impetus |
Yeah, I just got there; `$query->execute()->fetchAll()` gets it done, tyvm. |
# |
Jan 14th 2020, 17:01 |
neon1024 |
You’re right, that execute() returns the compiled statement :) |
# |
Jan 14th 2020, 17:01 |
neon1024 |
Yes, my apologies @this.impetus it should be `all()` |
# |
Jan 14th 2020, 16:59 |
neon1024 |
I’m sure they used to be in the repo, but I can’t find them right now |
# |
Jan 14th 2020, 16:58 |
neon1024 |
But I believe Rector has change sets for like 3.4, 5 or 6 upwards |
# |
Jan 14th 2020, 16:58 |
neon1024 |
The 4.x upgrade tool uses Rector https://github.com/cakephp/upgrade/tree/4.x |
# |
Jan 14th 2020, 16:57 |
ricksaccous |
@neon1024 thanks man you are changing my life right now |
# |
Jan 14th 2020, 16:57 |
neon1024 |
@ricksaccous Yeah the versions are in Rector, it already knows about CakePHP |
# |
Jan 14th 2020, 16:57 |
neon1024 |
Perhaps you need `all()` I forget |
# |
Jan 14th 2020, 16:56 |
javier.villanueva |
:S |
# |
Jan 14th 2020, 16:56 |
this.impetus |
`Call to undefined method Cake\Database\Statement\CallbackStatement::toArray()` |
# |
Jan 14th 2020, 16:56 |
this.impetus |
@neon1024 No, actually, you can't; that throws an undefined method error |
# |
Jan 14th 2020, 16:56 |
ricksaccous |
oh i can't specify version? |