Logs for #cakephp

Page 2 of 36,195, showing 100 records out of 3,619,426 total, starting on record 101, ending on 200

# At Username Text
# Yesterday, 15:40 neon1024 Which leads to `$this->getConnection()` returning `null` in `Table.php`, however I’ve added a connection instance to the config when running `initialize`
# Yesterday, 15:39 neon1024 However I encounter `Error: Call to a member function getSchemaCollection() on null`
# Yesterday, 15:39 neon1024 I’d like to unit test that my table class has the correct data type set to the schema
# Yesterday, 14:59 neon1024 Have a great day @scuadra
# Yesterday, 14:59 itmpls Did you figure it out?
# Yesterday, 14:58 scuadra I really appreciate everyone's help. Have a nice day
# Yesterday, 13:58 scuadra I posted the wrong snippet
# Yesterday, 13:58 scuadra but they are protected
# Yesterday, 13:58 scuadra my mistake
# Yesterday, 13:58 scuadra oh, sorry
# Yesterday, 13:57 neon1024 The one you pasted is `public`
# Yesterday, 13:56 scuadra yes, they are
# Yesterday, 13:48 neon1024 Aren’t they `protected` ?
# Yesterday, 13:47 scuadra I don't know if this helps but it seems that setters are not Working at all
# Yesterday, 13:41 itmpls hm I can't spot anything off if you say it's like that
# Yesterday, 13:40 scuadra so maybe the Entity is in the right place
# Yesterday, 13:40 scuadra and I got the website of the member
# Yesterday, 13:40 scuadra and after $user = $this->Members->get($this->Auth->user('id')); I did --> dd($user->get('website'));
# Yesterday, 13:39 scuadra and I created _getWebsite() method in the Entity which returns the website
# Yesterday, 13:39 scuadra for example I have field website
# Yesterday, 13:35 scuadra namespace App\Model\Entity; use Cake\Auth\DefaultPasswordHasher; use Cake\ORM\Entity; class Member extends Entity { public function _setPassword($password) { if (strlen($password) > 0) { return (new DefaultPasswordHasher)->hash($password); } } }
# Yesterday, 13:34 scuadra here are the contents
# Yesterday, 13:34 scuadra it's in app/src/Model/Entity
# Yesterday, 13:34 itmpls clearly something is off
# Yesterday, 13:34 itmpls directory, namespace, class name
# Yesterday, 13:33 scuadra @itmpls the filename is Member.php
# Yesterday, 13:33 itmpls @scuadra ?
# Yesterday, 13:32 itmpls what is the filename, and directory and class name and namespace?
# Yesterday, 13:32 itmpls where do . you have your Member class?
# Yesterday, 13:07 scuadra the Entity class not being used? :face_with_rolling_eyes:
# Yesterday, 13:07 scuadra maybe I'm missing something but where's the problem
# Yesterday, 13:05 admad we already found the problem. you need to find the solution :slightly_smiling_face:
# Yesterday, 13:04 scuadra thank you for your time
# Yesterday, 13:04 scuadra I still can't find the problem but anyway you were very patient
# Yesterday, 12:48 scuadra In my app.php I set the Security.salt to the one that was used in my Cake2 app
# Yesterday, 12:48 admad there's no caching involved in class loading (unless you have turned on opcode caching)
# Yesterday, 12:47 scuadra I also tried to clear the cache but still no result
# Yesterday, 12:47 scuadra yes, I tried debug($password); exit(); in the _setPassword() method but it wasn't triggered
# Yesterday, 12:46 admad So in spite of your claims you either havent named it properly or put in proper location
# Yesterday, 12:46 admad `object(Cake\ORM\Entity)` so your `Member` entity class isn't used.
# Yesterday, 12:45 scuadra the password field in the object is plain text
# Yesterday, 12:42 scuadra '[new]' => false, '[accessible]' => [ '*' => true ], '[dirty]' => [ 'password' => true ], '[original]' => [ 'password' => 'the original hash from db' ], '[virtual]' => [], '[hasErrors]' => false, '[errors]' => [], '[invalid]' => [], '[repository]' => 'Members'
# Yesterday, 12:42 scuadra The other keys are
# Yesterday, 12:42 scuadra It shows object(Cake\ORM\Entity) {} and all the fields of the table
# Yesterday, 12:37 admad what does `dd($user)` show after you set `$user->password`
# Yesterday, 12:36 scuadra I already checked it a couple of times and it is in the right place
# Yesterday, 12:33 admad make sure you have put the Member entity class in right place with proper class ame.
# Yesterday, 12:32 scuadra here it is
# Yesterday, 12:32 slackebot } return $this->redirect($this->Auth->redirectUrl()); } $this->Flash->error(__('Invalid username or password')); } }
# Yesterday, 12:32 slackebot !empty($this->getRequest()->getData())) { $user = $this->Auth->identify(); if ($user) { $this->Auth->setUser($user); if ($this->Auth->authenticationProvider()->needsPasswordRehash()) { $user = $this->Members->get($this->Auth->user('id')); $user->password = $this->getRequest()->getData('password'); $this->Members->save($user);
# Yesterday, 12:32 scuadra public function login() { if(empty($this->getRequest()->getParam('lang'))) { throw new NotFoundException(); } $lang = $this->getRequest()->getParam('lang'); if($this->Auth->user('id')) { return $this->redirect(['lang' => $lang, 'action' => 'index']); } $this->loadModel('Members'); if ($this->getRequest()->is('post') andand
# Yesterday, 12:29 admad show you actual login() action code
# Yesterday, 12:28 scuadra protected function _setPassword($password) { if (strlen($password) > 0) { return (new DefaultPasswordHasher)->hash($password); } }
# Yesterday, 12:27 admad it is
# Yesterday, 12:27 scuadra yes
# Yesterday, 12:27 scuadra maybe this is the problem
# Yesterday, 12:27 admad and have you added the `_setPassword()` method to your `Member` entity?
# Yesterday, 12:27 scuadra I did dd(get_class($this->Members)) because my table is named `members`
# Yesterday, 12:26 scuadra @admad it shows 'App\Model\Table\MembersTable'
# Yesterday, 12:24 admad @scuadra what does `dd(get_class($this->Users))` show?
# Yesterday, 12:22 ndm @scuadra The `$_accessible` property isn't involved if you're setting the property directly. If your entity has the hashing part implemented, then you might not be using that entity class. Check what exactly `$this->Users` is and what `$this->Users->get()` returns.
# Yesterday, 12:22 scuadra @admad I used exactly the same function in the link I provided
# Yesterday, 12:22 admad sorry, I see you linked the manual which shows how to update password
# Yesterday, 12:20 admad authcomponent (or it's classes) don't make any queries to update db, so don't see how simply logging in updated the password in db. It's your app code that's doing so.
# Yesterday, 12:20 scuadra I also checked the namespaces and they seem to be fine
# Yesterday, 12:19 scuadra I also tried to add " protected $_accessible = ['*' => true]; " in the entity class but with no success
# Yesterday, 12:18 scuadra @ndm no it is present
# Yesterday, 12:17 ndm @scuadra You might be missing https://book.cakephp.org/3.0/en/controllers/components/authentication.html#hashing-passwords
# Yesterday, 12:15 davorminchorov Hi, I want to setup Gmail SMTP for sending emails. I am using a gmail email as part of the company G Suite. Should I use the GSuite SMTP relay or can I do it with the normal one like for personal emails?
# Yesterday, 12:11 scuadra Hello. I am trying to migrate the passwords of the users in my application (in my case the table is called `members`) form Cake2 to Cake3. I followed these steps --> https://book.cakephp.org/3.0/en/controllers/components/authentication.html#changing-hashing-algorithms. But the problem is when the user is logged in the old hash in the database is being replaced with the plain password instead of a hashed one. What could be the problem?
# Yesterday, 11:57 dereuromark also traits work
# Yesterday, 11:38 graziel and extends all tests from it, ie put method `setUser(int $id)` and call it as needed (sometimes i need logged user sometimes not)
# Yesterday, 11:37 graziel @neon1024 i like to create `class IntegrationTestCase extends TestCase` and put there my methods to shorten writing of tests
# Yesterday, 11:29 neon1024 Is there a neat place to set the session for a number of tests? I am integration testing an api behind a login
# Yesterday, 11:01 dereuromark neon: see what ide helper does
# Yesterday, 11:00 aivaras.godliauskas Yeah I do agree with that too :slightly_smiling_face:
# Yesterday, 10:59 neon1024 Having a clean, organised and structured codebase is the approach I prefer personally
# Yesterday, 10:59 neon1024 Performance optimisation is a bit of a rabbit hole
# Yesterday, 10:58 neon1024 Probably just build your application as best you can, then use a tool like siege to test it’s response time, with debug off, and not on a live server ;)
# Yesterday, 10:57 aivaras.godliauskas nah, in general just interested in performance measures or ways of measuring it. Most likely for personal use.
# Yesterday, 10:55 neon1024 @aivaras.godliauskas Was there a specific piece of the framework’s performance you were interested in?
# Yesterday, 10:54 neon1024 It’s like comparing a shovel and a spade
# Yesterday, 10:53 neon1024 At least, that’s always been my experience of it
# Yesterday, 10:53 neon1024 Most of the posts you’ll find if you Google will tell you that Symfony or Laravel are quicker depending on which one the author prefers
# Yesterday, 10:52 aivaras.godliauskas i see.
# Yesterday, 10:52 neon1024 You’ll get the results you want to get and learn nothing about the frameworks performance
# Yesterday, 10:52 neon1024 Benchmarking frameworks is a pointless venture
# Yesterday, 10:51 neon1024 At least, that’s what I’ve put in the ticket for myself to look at
# Yesterday, 10:51 neon1024 I was going to run my test suite, note the time, refactor my use of fixture loading and run the suite again to see if it was quicker
# Yesterday, 10:51 aivaras.godliauskas thats sad
# Yesterday, 10:51 neon1024 @aivaras.godliauskas I’m not.
# Yesterday, 10:50 neon1024 :white_check_mark:
# Yesterday, 10:50 aivaras.godliauskas @neon1024 can you tell how are you running benchmarks on cake?
# Yesterday, 10:50 neon1024 It’s a non-standard table name, so you must declare `public $table = 'script_composed_of'` then it’ll work
# Yesterday, 10:46 neon1024 Seems that because I have database constraints, I have to execute the fixtures in a specific order
# Yesterday, 10:26 neon1024 Points if you can tell me why my Fixture isn’t actually creating a database table https://pastebin.com/UEnGV6vQ
# Yesterday, 10:11 neon1024 Guess I could benchmark that myself actually :thinking_face:
# Yesterday, 10:10 neon1024 Is it worthwhile to manually load fixtures for test-cases which need extra fixtures? So they’re not loaded for every test-case
# Yesterday, 09:58 neon1024 Hey @dereuromark when doing a `@property` in the class, with or without a dollar? `@property \App\Model\Table\ExamplesTable $Examples`
# Yesterday, 09:09 ankitgsolanki I have following line of code for update mysql mariaDB view. ```$stmt = $conn->execute('update `listing` set `longitude` = ?, `latitude` = ? where `id` = ?',[-96.1080, 31.7356, 1922]);``` And I am getting following error *General error: 1221 Incorrect usage of UPDATE and ORDER BY*