# |
Jun 28th 2021, 15:33 |
info315 |
@umer936 I had a similar issue and had to build something for on my own. I had to move the node_modules folder out of the webroot because it is full of bash scripts and example files. I added a <https://github.com/it-novum/openITCOCKPIT/blob/development/src/itnovum/openITCOCKPIT/Core/AngularJS/AngularAssets.php#L36%7Clist> of all loaded npm files to my code and created a |
# |
Jun 28th 2021, 15:28 |
kevin.pfeifer |
or you use the asset-mix plugin https://github.com/ishanvyas22/asset-mix which is based on laravel-mix |
# |
Jun 28th 2021, 15:26 |
kevin.pfeifer |
well you can still use npm normally like in any other project I still love gulp and use it to generate CSS and JS from my source files and downloaded modules but as far as I know there is no out of the box npm/JS bundler in cakephp present. Maybe you can find a plugin Maybe you can copy some things from this vuejs single page application template https://github.com/ishanvyas22/cakephpvue-spa |
# |
Jun 28th 2021, 15:23 |
umer936 |
Hi, what's the way to have npm (or yarn) as a package manager for front-end stuff (JS)? Laravel has mix-ins to handle this. After trying quite a few things, I've come to using the "foxy" composer plugin (to allow composer to run npm commands) and putting my node_modules folder in /webroot/js so I can access them in my templates. This still feels a little like a hack. |
# |
Jun 28th 2021, 15:20 |
info315 |
Oh i see you are still using freenode - the Freenode stuff delete my user account and hijack our community channel (together with more than 700 other channels) |
# |
Jun 28th 2021, 15:18 |
dereuromark |
@info315 https://api.slack.com/reference/surfaces/formatting#linking-urls |
# |
Jun 28th 2021, 15:18 |
admad |
But the bridge seems down :( |
# |
Jun 28th 2021, 15:17 |
kevin.pfeifer |
https://discord.gg/k4trEMPebj |
# |
Jun 28th 2021, 15:16 |
info315 |
@admad Really? Can you send me an invite link please? @dereuromark Good to know |
# |
Jun 28th 2021, 15:14 |
admad |
We are on Discord too :) |
# |
Jun 28th 2021, 15:14 |
dereuromark |
@info315 Slack uses a different markup ;) <link|url> etc |
# |
Jun 28th 2021, 15:13 |
info315 |
Fun fact, Slack isn't as Markdown friendly as I expected^^ |
# |
Jun 28th 2021, 15:13 |
ankitgsolanki |
@admad Ok |
# |
Jun 28th 2021, 15:12 |
admad |
@ankitgsolanki ignore my comments about scopes :) |
# |
Jun 28th 2021, 15:11 |
admad |
Sorry I had a dumb moment, it's a config for logger not cache. |
# |
Jun 28th 2021, 14:54 |
info315 |
@admad What is the `scopes` option? Its unknown to the [docs](https://book.cakephp.org/4/en/core-libraries/caching.html) and the [code](https://github.com/cakephp/cakephp/blob/master/src/Cache/Engine/RedisEngine.php) |
# |
Jun 28th 2021, 14:51 |
ankitgsolanki |
@admad Ok |
# |
Jun 28th 2021, 14:50 |
admad |
@ankitgsolanki err... needs to be `false` not `null` |
# |
Jun 28th 2021, 14:49 |
ankitgsolanki |
@admad No. Let me try with add this config |
# |
Jun 28th 2021, 14:48 |
admad |
@ankitgsolanki Have you set `'scopes' => null` for the redis config? |
# |
Jun 28th 2021, 14:44 |
info315 |
Me too. Check the Redis Metrics and your Code - something is firing hundreds of requests or stores large files to redis i guess |
# |
Jun 28th 2021, 14:40 |
admad |
If it's not the default cache and it's not used for the current request then Cake wouldn't even connect to it, so don't see how it could cause any slowdown. |
# |
Jun 28th 2021, 14:38 |
ankitgsolanki |
I have defined new cache for redis server in app.php and default cache is file cache |
# |
Jun 28th 2021, 14:36 |
info315 |
Have you set your default cache to redis? Or did you defined a new cache in app.php just for the particular data that has to be stored to redis? |
# |
Jun 28th 2021, 14:32 |
ankitgsolanki |
@info315 At this post request I am not sending any request to Redis server. |
# |
Jun 28th 2021, 14:31 |
info315 |
@ankitgsolanki How many requests do you send to the redis server per POST request? |
# |
Jun 28th 2021, 14:30 |
tomrwaller |
Thanks again @ndm - your tip pointed me in the right direction and I ended up looking at the BootstrapUI plugin by FriendsOfCake which has shown me how to avoid using dumb templates! |
# |
Jun 28th 2021, 14:27 |
ankitgsolanki |
Also try with another redis remote server from https://app.redislabs.com/ but same issue facing this remote server as well |
# |
Jun 28th 2021, 14:26 |
ankitgsolanki |
In a local redis server it takes 10 seconds |
# |
Jun 28th 2021, 14:24 |
info315 |
try with an local redis server running on 127.0.0.1 to test if it's an Redis or an AWS issue |
# |
Jun 28th 2021, 14:23 |
info315 |
Than you are facing most likely a network latency issue |
# |
Jun 28th 2021, 14:22 |
ankitgsolanki |
@info315 Yes. It is in AWS Elastic Cache |
# |
Jun 28th 2021, 14:21 |
info315 |
@ankitgsolanki Is your Redis server running on a remote host? |
# |
Jun 28th 2021, 13:08 |
info315 |
@ndm Ahh perfect thanks. |
# |
Jun 28th 2021, 13:05 |
ndm |
@info315 That's just incorrect error output for missing elements https://github.com/cakephp/cakephp/issues/15619 |
# |
Jun 28th 2021, 12:58 |
info315 |
Hi, i have a question about View Elements. I'm trying to load an element from an Plugin like so: ```echo $this->element('HyperscaleModule.warning');``` My issue is, that CakePHP 4 adds the name of the Plugin to the element file name and complains that it can not find the element: ```- /opt/openitc/frontend-modules/HyperscaleModule/templates/element/HyperscaleModule.warning.php``` |
# |
Jun 28th 2021, 12:20 |
ankitgsolanki |
Hello All, Cake Application works very slow when I have implemented the Radis cache. If I Remove Redis Cache configuration then it's works very fast. *Example:* Without Redis cache one post request take 2 seconds to complete the request. With Redis cache same post request take 20 seconds to complete the request. Can anyone have any idea that why cake application works very slow when I use redis cache? |
# |
Jun 28th 2021, 12:17 |
ndm |
@tomrwaller Templates are stupid, they cannot apply logic. If you don't want to manually pass options when creating controls, then you'll most likely either need a custom widget, or a custom form helper. |
# |
Jun 28th 2021, 10:38 |
slackebot |
to be a valid template option - I end up with the input style applied - input should be 'form-control' class while a range should be 'form-range' style. `'rangeContainer' => '<div class="form-group mb-11">{{content}}</div>',` Anyone know if there is a corresponding 'range' variable I can use? |
# |
Jun 28th 2021, 10:38 |
tomrwaller |
Hey all - I'm trying to style my range input for Bootstrap and need to provide a different input class to normal text input. I'm using a form helper template to acheive this and mostly getting there, but I'm stuck trying to differentiate between input and range in the template. For example, 'input' and 'inputContainer' work, and I can even use 'rangeContainer' to provide the correct container style - but 'range' doesn't seem |
# |
Jun 28th 2021, 09:43 |
conehead |
Then you got a completely different problem and that is probably not a cake problem. Using a view should not make a noticable difference |