Log message #4053014

# At Username Text
# Jul 17th 2017, 17:54 savant there we go
# Jul 17th 2017, 17:53 savant @plusplus help
# Jul 17th 2017, 17:53 savant @plusplus leaderboard
# Jul 17th 2017, 17:53 savant @admad++
# Jul 17th 2017, 17:53 savant @admad++
# Jul 17th 2017, 17:50 savant @admad++
# Jul 17th 2017, 17:48 savant test++
# Jul 17th 2017, 17:45 backstageel Hello, can someone show me a link to a tutorial on how to enable opcache on cakephp2?
# Jul 17th 2017, 16:50 aaronc jeremyharris++
# Jul 17th 2017, 16:50 aaronc Thanks for the help. I ended up get the passed vars with $this->viewVars, then the return is an array, I used array_keys() on it to get an array of all passed variables.
# Jul 17th 2017, 16:46 jeremyharris np!
# Jul 17th 2017, 16:45 aaronc Apologies had a bunch of pr statements floating around and mixed them up.
# Jul 17th 2017, 16:44 jeremyharris when you debug it, it shows you the “items” as a help for debugging
# Jul 17th 2017, 16:43 jeremyharris no it’s not :slightly_smiling_face: it’s an internal piece of the collection. if you want to make sure it was passed, you can check that the var you passed is indeed a collection/collectioninterface
# Jul 17th 2017, 16:42 aaronc I'm attempting to check what variables were passed to the view with ->set() in the controller, so in this case, 'items' is one of them.
# Jul 17th 2017, 16:41 jeremyharris items is internal
# Jul 17th 2017, 16:41 aaronc The name of the array, so in the first example 'items'. It seems to be disappearing with a lot of accessor methods.
# Jul 17th 2017, 16:40 jeremyharris I thought that was what you were asking for :slightly_smiling_face: what is it you want?
# Jul 17th 2017, 16:39 aaronc ->first returns just the part ```[id] => 1 [name] => Safari Land/Second Chance [[new]] => [[accessible]] => Array ( [*] => 1 ) etc.... ```
# Jul 17th 2017, 16:37 jeremyharris resultsets are collections, so check out the docs on collections for more info on using them: https://book.cakephp.org/3.0/en/core-libraries/collections.html
# Jul 17th 2017, 16:36 jeremyharris you can always turn it into an array if you want, too, ->toArray
# Jul 17th 2017, 16:35 jeremyharris usually you iterate through the resultset (e.g., items). or if there is a single item, use ->first()
# Jul 17th 2017, 16:35 slackebot )
# Jul 17th 2017, 16:35 aaronc Is there a simple way to get the key of this result set object i.e. 'items'? ```Cake\ORM\ResultSet Object ( [items] => Array ( [0] => Cake\ORM\Entity Object ( [id] => 1 [name] => Safari Land/Second Chance [[new]] => [[accessible]] => Array ( [*] => 1
# Jul 17th 2017, 16:20 jeremyharris that could just be old stuff
# Jul 17th 2017, 16:19 jeremyharris or at least, at that time they did
# Jul 17th 2017, 16:19 jeremyharris yeah they have their own test library it seems
# Jul 17th 2017, 16:18 phantomwatson Trying to point phpunit to the directory only gets me "file not found" errors. I'm stumped. And I know it has to be something really simple and dumb that I'm doing wrong
# Jul 17th 2017, 16:17 phantomwatson Yeah, I see references to php_codesniffer having a framework for running phpunit tests to confirm the standards are working as expected, but I haven't managed to find anything in the library's wiki (https://github.com/squizlabs/PHP_CodeSniffer/wiki).
# Jul 17th 2017, 16:16 jeremyharris maybe the codesniffer lib has some info on how to run those tests
# Jul 17th 2017, 16:15 jeremyharris although, it looks like those aren’t phpunit tests
# Jul 17th 2017, 16:14 jeremyharris @phantomwatson you can point to the dir perhaps? vendor/bin/phpunit CakePHP/Tests
# Jul 17th 2017, 16:13 stefan I didn't use 2.x before so I don't know how it was working. Slack was my last hope. ;)
# Jul 17th 2017, 16:12 jeremyharris I think you’re right though. I just looked through the code and can’t find detection of hasOne. Perhaps it was removed in the 3.x version of bake — I don’t use hasOne in my 3.x application
# Jul 17th 2017, 16:11 jeremyharris yes
# Jul 17th 2017, 16:11 stefan but this is very similar to `hasMany` relationship - isn't that the case?
# Jul 17th 2017, 16:11 phantomwatson Anyone know how phpunit works with testing php_codesniffer standards? I can't seem to get them to run for cakephp-codesniffer. I clone https://github.com/cakephp/cakephp-codesniffer.git, run `composer install`, then run `vendor/bin/phpunit` and it only runs the tests defined in `vendor/squizlabs/php_codesniffer`. Anyone know how I would get it to run the tests under `CakePHP/Tests`?
# Jul 17th 2017, 16:10 jeremyharris it might suggest belongsTo first, just say “no”
# Jul 17th 2017, 16:10 stefan I did.
# Jul 17th 2017, 16:10 jeremyharris I believe it does detect hasOne automatically if you follow conventions
# Jul 17th 2017, 16:06 stefan I'm trying to modify bakery and I'm wondering if it's possible to detect `hasOne` relationship automatically? I can't find anything in the source code of the `ModelTask.php`