Log message #4222956

# At Username Text
# Jan 19th 2020, 23:19 slackebot 'unauthenticatedRedirect' => '/simsiswa/pages/display', 'queryParam' => 'redirect', ]); // Load identifiers, ensure we check email and password fields $authenticationService->loadIdentifier('Authentication.Password', [ 'fields' => [ 'username' => 'username', 'password' => 'password', ] ]); // Load the authenticators, you want session first
# Jan 19th 2020, 23:19 mr.kusmadi Hi bro How do you create multiple table logins on cakephp version 4.x? I have followed the guidelines at https://book.cakephp.org/4/en/tutorials-and-examples/cms/authentication.html Only the users table is successful, while the Admin and Students table always fails ``` protected function configAuth(): \Authentication\AuthenticationService { $authenticationService = new \Authentication\AuthenticationService([
# Jan 19th 2020, 23:18 challgren @lpj145 https://github.com/dereuromark/cakephp-queue works great
# Jan 19th 2020, 23:00 lpj145 or parallel tasks ? what lib yours recommend me ?
# Jan 19th 2020, 22:59 lpj145 someone used any cakephp lib to jobs (scheduled jobs) ?
# Jan 19th 2020, 22:25 martin I can't simple change the order of label and field when I use `$this->Form->control('bla', ['label' => 'green']);` ? I don't see it in the widget templates. I I think the only way to do this is label false and put lable seperate ?
# Jan 19th 2020, 19:08 lpj145 but, if your's look something is interest, or to change better, feel free to talk with me.
# Jan 19th 2020, 19:07 lpj145 yes, know, this is much better for Br community.
# Jan 19th 2020, 19:07 lpj145 guy's, look some api boilerplate with 4x
# Jan 19th 2020, 19:06 lpj145 https://github.com/lpj145/cakephp_template
# Jan 19th 2020, 18:35 michael175 Ah. Must be something else then. :)
# Jan 19th 2020, 18:35 wizardfix Yeah, I mean I'm not usng it
# Jan 19th 2020, 18:34 michael175 Security-Enhanced Linux (*SELinux*) is a Linux kernel security module that provides a mechanism for supporting access control security policies, including mandatory access controls (MAC). It is software that acts like a firewall and can run on Ubuntu.
# Jan 19th 2020, 18:30 wizardfix Ah well I'm just on Ubuntu 18.04, not SELinux...
# Jan 19th 2020, 18:29 michael175 Hi, I don't know if it'll be any help but I've just spent an hgour tearing my hair out over a `file_put_contents()` error when thee folder and its parents all had write permission and were correctly owned and grouped. Turned out to be `SELinux` causing the trouble. Ran `setenforce = 0` and the permissions error disappeared. Now, jsut need to turn it back on and sort out the real issue with SELinux.
# Jan 19th 2020, 18:03 slackebot $this->response->withFile($path, ['download' => true]); $this->Flash->success(__('The file will be downloaded.')); return $response; }``` I'm not sure what I'm missing here, looking for a bit of guidance... :thinking_face:
# Jan 19th 2020, 18:03 slackebot [APP/Controller/ResultsController.php, line 132]# SOME DUMMY DATA WHICH SHOULD BE OVERWRITTEN. # -------------------------------------------- (src/files/test_results.csv)``` The file has 777 perms. `file_put_contents()` works fine in my psysh shell. This is my method: ```public function export() { $path = 'files/results_export.csv'; file_put_contents($path, 'THIS LINE WRITTEN BY EXPORT METHOD'); $response =
# Jan 19th 2020, 18:03 wizardfix *Problem Writing to File* I have a simple method to write a line to a file and let the user download it. What actually happens is the file does not seem to get overwritten at all, and the file downloaded contains error markup indicating a perms error followed by the original text contained in the file: ```Warning (2): file_put_contents(files/test_results_ex.csv): failed to open stream: Permission denied
# Jan 18th 2020, 21:29 jimbo2150 Yes, MySQL will rewrite that query to `ALTER TABLE \`results\` CHANGE \`status\` \`status\` TINYINT(1) UNSIGNED NULL;` and when you query for the column types is comes out as `TINYINT(1)` so there is no way for CakePHP (or any code) to even detect a `TINYINT(1)` vs `BOOLEAN`.
# Jan 18th 2020, 21:19 wizardfix So are the SQL statements generated by phpMyAdmin just syntactic sugar? ```ALTER TABLE `results` CHANGE `status` `status` BOOLEAN UNSIGNED NULL;```
# Jan 18th 2020, 21:16 jimbo2150 Once it is removed it will just be `TINYINT` (without parentheses) unless they implement `BOOLEAN` as a separate type. In the first case it will be up to the code to cast it as boolean either in the SELECT query or once it's returned the value as an integer (e.g. greater than 0 is true otherwise false).
# Jan 18th 2020, 21:15 ndm I'm not familiar with the future plans for MySQL, but I'd suspect that they will add a real boolean type then
# Jan 18th 2020, 21:14 ndm *Until
# Jan 18th 2020, 21:14 ndm Unless it's actually removed, sure
# Jan 18th 2020, 21:12 wizardfix @ndm I didn't realise display width was deprecated - I see now it's deprecated for integer types from 8.0.17 - but that raises the question of - will `TINYINT(1)` still be interpreted as `BOOLEAN` ...
# Jan 18th 2020, 21:06 jimbo2150 @ndm so it is.. I rarely ever use them outside of floats and strings anyway.
# Jan 18th 2020, 21:06 wizardfix @ndm iI
# Jan 18th 2020, 21:04 ndm Well, it is what it is :) Display width is deprecated anyways, and there's no reason to use it unless the application that reads the data uses it for a specific purpose, like CakePHP does, to identify possible boolean types. Since boolean is a synonym, you'll receive tinyint(1) when reading the column details, ie there's no other way for CakePHP to "emulate" boolean types
# Jan 18th 2020, 20:59 wizardfix Afaik, in all other cases changing the integer in parentheses just changes the display width. In this case changing it from any integer `>1` to `1` changes its type and its inherent nature. :thinking_face:
# Jan 18th 2020, 20:57 wizardfix Ha! Was looking at that page before... Yeah I see the reference: > `BOOL`, `BOOLEAN` > These types are synonyms for `TINYINT(1)`. A value of zero is considered false. Nonzero values are considered true: but I find it unintuitive.
# Jan 18th 2020, 20:49 ndm boolean is a synonym for tinyint(1)
# Jan 18th 2020, 20:49 ndm https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html
# Jan 18th 2020, 20:45 wizardfix @jimbo2150 @admad I can find *nothing at all* in the MySQL docs saying `TINTINT(1)` is treated as a Boolean. And in my phpMyAdmin, it lets me change a field to Boolean, and generates this SQL statement: ```ALTER TABLE `results` CHANGE `status` `status` BOOLEAN UNSIGNED NULL DEFAULT TRUE;``` thus seeming to support Booleans... I'm trying to understand this! :)
# Jan 18th 2020, 20:01 wizardfix so logically I expected `TINYINT(1)` to be able to store any integer in `[0, 1, 2, ... ,8, 9]`...
# Jan 18th 2020, 19:57 ndm Ackchyually the number in parentheses _is_ the display width. The number of bytes an integer type can store is defined by the type of the integer, ie tinyint, smallint, mediumint, int, bigint
# Jan 18th 2020, 19:52 wizardfix Ha! The :bug: was in my understanding of MySQL! x) So I've learnt something and got my method working. Win-win! :)
# Jan 18th 2020, 19:51 jimbo2150 The number in the parentheses is the maximum number of bytes stored in the field, not the number of characters.
# Jan 18th 2020, 19:49 admad tinyint(1) is the only way to emulate boolean in mysql since it's lacks "real" boolean type like other dbs
# Jan 18th 2020, 19:36 wizardfix @jimbo2150 thanks but u=is
# Jan 18th 2020, 19:34 jimbo2150 @wizardfix In MySQL, `BOOLEAN` is a synonym for `TINYINT(1)`. Your options are to set it to `TINYINT(2)` or overwrite the column type in CakePHP 3+: https://stackoverflow.com/questions/10801632/cakephp-and-tinyint-as-boolean
# Jan 18th 2020, 19:17 lpj145 what your think about repository pattern on cakephp ?