# |
Jun 17th 2021, 00:00 |
vinicius.big |
I was looking for a cakephp way to do it, but I think a `class_exists()` will fit here |
# |
Jun 16th 2021, 23:45 |
vinicius.big |
thinking here that probably I will have to install Bake even for production |
# |
Jun 16th 2021, 23:40 |
vinicius.big |
Hello! How can I *disable* a command inside my plugin when in production mode? I've created a custom bake command in order to bake custom stuff on my project. I'm extending the `AllCommand` from bake. and the class in `src/Command/AllCommand.php` is using `use Bake\Command\AllCommand` But, on production, the Bake plugin is not installed, and I'm getting this class not found error. Is there a way to get around this? |
# |
Jun 16th 2021, 20:25 |
slackebot |
ideas? I can post more code if it helps, but I'm trying to keep it simple. |
# |
Jun 16th 2021, 20:25 |
joey.mukherjee |
Using a CakePHP union from database, I am not getting all of my "contain"ed tables. I am only getting the first one that is contained. If I reverse the union, I get the other one. Is there a way I can get them all? Here's my union: $reviewers = $obs->union ($tests); If I reverse the "tests" and "obs", I get the other tables information which is correct, but I want them all regardless of the order in the union. Any |
# |
Jun 16th 2021, 20:21 |
kevin.pfeifer |
if there is a `composer.lock` file present the command `composer install` will ignore the version strings in your `composer.json` and just install the versions which are set in the `composer.lock` file but if you don't have a `composer.lock` file then it will generate a new one with the newest versions currently available (according to the version strings) |
# |
Jun 16th 2021, 20:19 |
kevin.pfeifer |
see https://getcomposer.org/doc/articles/versions.md#stability-constraints for what the different version strings are |
# |
Jun 16th 2021, 20:18 |
slackebot |
present (which are still valid to your constraints set in composer.json) |
# |
Jun 16th 2021, 20:18 |
kevin.pfeifer |
the short gist of it composer.json is the "what versions of software would I like to have" file composer.lock gets generated after executing `composer install` based on the conditions set in the composer.json You can basically perform a `composer update` anytime you want. It then checks what versions are actually installed currently in your system (via the composer.lock file) and the checks if there are newer version |
# |
Jun 16th 2021, 20:17 |
japerlman |
I see .lock I think it's a file being used by a process running I thought it was stale and left over |
# |
Jun 16th 2021, 20:16 |
japerlman |
I don't and I deleted my composer.lock to get around the last error I was getting so I probably messed it up |
# |
Jun 16th 2021, 20:09 |
kevin.pfeifer |
you know how composer.json and composer.lock are related? |
# |
Jun 16th 2021, 20:09 |
kevin.pfeifer |
just a composer.json doesn't allow you to use that command |
# |
Jun 16th 2021, 20:08 |
japerlman |
```$ cat composer.json | grep cakephp/plugin-installer "cakephp/plugin-installer": "^1.3",``` |
# |
Jun 16th 2021, 20:07 |
japerlman |
```$ dir composer.json composer.json``` |
# |
Jun 16th 2021, 20:07 |
japerlman |
yes |
# |
Jun 16th 2021, 20:07 |
kevin.pfeifer |
and you are in the directory where the composer.json is present? |
# |
Jun 16th 2021, 20:06 |
japerlman |
no idea why mine is showing that error, I'm copy/pasting your text |
# |
Jun 16th 2021, 19:59 |
kevin.pfeifer |
it should say something like that ```-> % composer why cakephp/plugin-installer cakephp/app dev-master requires cakephp/plugin-installer (^1.3) ``` |
# |
Jun 16th 2021, 19:56 |
japerlman |
The suggestion from @bmuddagot me what I needed, but that's the output from your command. Seems odd to me but I'm very new so I accept that I don't know much |
# |
Jun 16th 2021, 19:56 |
japerlman |
```$ composer why cakephp/plugin-installer [InvalidArgumentException] Could not find package "cakephp/plugin-installer" in your project``` |
# |
Jun 16th 2021, 19:54 |
kevin.pfeifer |
something seems to require an old plugin-installer check it via ```composer why cakephp/plugin-installer``` |
# |
Jun 16th 2021, 19:54 |
japerlman |
thanks! had the wrong composer.json open at first, then had to delete a stale composer.lock file but it looks like it's doing it's thing now. Thank you. |
# |
Jun 16th 2021, 19:49 |
bmudda |
you probably have to update you composer.json to update plugin installer library ```"cakephp/plugin-installer": "^1.3"``` |
# |
Jun 16th 2021, 19:47 |
japerlman |
Or is that not the reason for my error? |
# |
Jun 16th 2021, 19:47 |
japerlman |
```ERROR: The system cannot find the file specified. C:\xxxx\xxxx\xxxxx\vendor\composer\tmp-6493c3d89bb30a9ae52c10e3e9387636``` |
# |
Jun 16th 2021, 19:46 |
japerlman |
How do I update my plugin installer? Or do I need to install an older version of composer? ```$ composer require friendsofcake/crud:^5.0 Loading "cakephp/plugin-installer" which is a legacy composer-installer built for Composer 1.x, it is likely to cause issues as you are running Composer 2.x.``` |
# |
Jun 16th 2021, 17:23 |
kevin.pfeifer |
I personally just add the scripts “in the middle” of my HTML when I need to have specific JS loaded in cells |
# |
Jun 16th 2021, 17:20 |
tyler.adam.lazenby |
That is unfortunate. What if you need to have a script in order for parts of your cell to work. Do you just have to remember to add it or be content with adding a script tag in the middle of your html? |
# |
Jun 16th 2021, 17:19 |
kevin.pfeifer |
the `['block' => true]` doesn’t work in elements ;) |
# |
Jun 16th 2021, 17:17 |
ndm |
> Cell templates have an isolated scope that does not share the same View instance as the one used to render template and layout for the current controller action or other cells. Hence they are unaware of any helper calls made or blocks set in the action’s template / layout and vice versa. |
# |
Jun 16th 2021, 17:14 |
tyler.adam.lazenby |
Just doesn't add the script tag |
# |
Jun 16th 2021, 17:14 |
greg138 |
Does it give an error, or just not add the script tag? |
# |
Jun 16th 2021, 17:13 |
tyler.adam.lazenby |
```$this->Html->script('build/cellEmail.bundle.js?v=1.0.0i', ['block' => true]);``` |
# |
Jun 16th 2021, 17:13 |
tyler.adam.lazenby |
Are cells unable to call script? |
# |
Jun 16th 2021, 15:56 |
neon1024 |
I did not. Thanks @kevin.pfeifer I’ll give that a try :thumbsup: |
# |
Jun 16th 2021, 15:46 |
kevin.pfeifer |
this is default true |
# |
Jun 16th 2021, 15:46 |
kevin.pfeifer |
did you disable the debugging in the docker engine? |
# |
Jun 16th 2021, 15:33 |
neon1024 |
My boss claims it’s because the framework bootstrap is loading too many files per request, but I thought if that was the case, it would 504 more consistently. My shared volume is mounted with `cached` too |
# |
Jun 16th 2021, 15:32 |
neon1024 |
Anyone else have issues with Cake / PHP applications and Docker on a Mac? At least twice a day my containers will throw a 504 timeout, and the `com.docker.hyperkit` process goes up to 300% CPU |
# |
Jun 16th 2021, 15:23 |
ndm |
Yeah, seems like bake generates UUIDs for string columns that are part of the primary key: https://github.com/cakephp/bake/blob/master/src/Command/FixtureCommand.php#L342-L347 Not much that you could do about it. Even if it would respect the limit, it could still not insert a value that would make sense.# |