Log message #4189562

# At Username Text
# Jun 14th 2019, 08:54 acosonic hi everyone, how do I send email both html and text... ?
# Jun 14th 2019, 08:42 dereuromark Also if you cant fuck up things on prod :slightly_smiling_face: I wouldnt do it for API things for example. If you forget to set local stuff you might delete/modify via live API
# Jun 14th 2019, 08:42 dereuromark Joe: for non sensible data yes
# Jun 14th 2019, 08:40 admad @scuadra it probably doesnt like empty image name. I suggest you use name for a 1x1px tranparent png instead
# Jun 14th 2019, 08:36 kgb.acct.personal So, I write prod config in `app.php` then I write dev config in `.env`?
# Jun 14th 2019, 08:35 slackebot1 'data-src' => '/cache/images/products/...whatever']). The first argument is empty and the lazyload get the img src from the data-src attribute. My question is whether is possible to avoid that warning?
# Jun 14th 2019, 08:35 scuadra Hello. In Cake 3.7 I get the following notice: Uninitialized string offset: 0 [CORE/src/View/Helper/UrlHelper.php, line 178]. This is the assetUrl() method. However the warning comes from the image() method in this Helper. What I am trying to do is to use jquery lazyload for images because they are too much and the error probably comes because I use the Html image helper like that: $this->Html->image('', ['class' => 'lazyload card-img',
# Jun 14th 2019, 08:34 dereuromark not the other way around, ever.. ^^
# Jun 14th 2019, 08:34 dereuromark like debug mode off - that should be the default, and locally you enable it
# Jun 14th 2019, 08:34 kgb.acct.personal Putting in `app.php` looks promising
# Jun 14th 2019, 08:34 dereuromark that often simplifies things and keeps mistakes in prod away
# Jun 14th 2019, 08:34 dereuromark they "can" default to prod if you wanted to and only overwrite locally and for tests
# Jun 14th 2019, 08:33 dereuromark for me they would also be ENV then
# Jun 14th 2019, 08:32 kgb.acct.personal Application-wide constants, not sure where to put them
# Jun 14th 2019, 08:31 dereuromark what kind of extra configs? They are either persisted (no pwds, keys, etc) or defaulted to nothing and read from ENV where needed.
# Jun 14th 2019, 08:28 admad why not in app.php itself?
# Jun 14th 2019, 08:28 kgb.acct.personal So, where do I put extra configs? bootstrap.php?
# Jun 14th 2019, 08:27 admad bingo!
# Jun 14th 2019, 08:27 kgb.acct.personal Ah. I see, it's just for emulating environment variables
# Jun 14th 2019, 08:24 dereuromark why not using actual ENV to inject here?
# Jun 14th 2019, 08:23 kgb.acct.personal Because on `env.default` states: ``` # Having this file in production is considered a **SECURITY RISK** and also decreases # the boostrap performance of your application. ```
# Jun 14th 2019, 08:23 kgb.acct.personal Is it safe to use `.env` on prod?
# Jun 14th 2019, 08:23 neon1024 Morning everyone! :wave: Happy Friday :tada:
# Jun 14th 2019, 08:21 val Something like a bean in Java.
# Jun 14th 2019, 08:16 dereuromark see docs, they do if you have name or title field
# Jun 14th 2019, 08:12 noel Do tables have a default displayField or is this `id`?
# Jun 14th 2019, 08:00 noel This seems to work but not sure if it's DRY: ``` $exists = false; $connection = ConnectionManager::get('default'); $tables = $connection->execute('show tables;')->fetchAll('assoc'); foreach (array_values($tables[0]) as $key => $tableName) { if ($alias === $tableName) { $exists = true; } } return $exists; ```
# Jun 14th 2019, 07:54 noel What's the best way to check if a db table exists?
# Jun 14th 2019, 07:40 val Another way to optimize Entity would be to refactor $_properties array to a new class containing only those properties.
# Jun 14th 2019, 07:35 spriz Not sure how I feel about that, but it works! :)
# Jun 14th 2019, 07:35 spriz ->contain([ 'EanProductRelationTargets' => function (Query $q) { return $q->where(['EanProductRelations.type' => EanProductRelation::TYPE_ALTERNATIVE_PROCUREMENT]); }, ]);
# Jun 14th 2019, 07:35 spriz ```
# Jun 14th 2019, 07:35 spriz OK, I can actually just reference that join table in the where :thinking_face:
# Jun 14th 2019, 07:28 val I tested the memory by using `new MyEntity(...)` and generating the entities with some random values without any query to the database. So the memory overhead due to results buffering was not present.
# Jun 14th 2019, 07:28 spriz but how do I reference the join table and not either `articles` or `tags` table?
# Jun 14th 2019, 07:24 admad if that's not enough you could try using your own entity class implementation
# Jun 14th 2019, 07:24 challgren https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#using-innerjoinwith
# Jun 14th 2019, 07:24 admad depending on how you want to consume the results, i believe disabling results buffering might be the main thing that would help reduce memory consumption
# Jun 14th 2019, 07:24 spriz Data saved like this https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-additional-data-to-the-join-table :slightly_smiling_face:
# Jun 14th 2019, 07:23 val Okay. I believe there is a way to optimize Entity class a bit - $_properties is an array. It would use less memory if each property would be an actual class property instead of an array item in $_properties.
# Jun 14th 2019, 07:23 spriz now I only want all `tags` for an `article` that has priority `3`