ADmad
Repos
47
Followers
400
Following
4

Events

issue comment
Namespace all functions.

This sounds good to me. I can take care of making those changes if you want.

Thanks, so is this good to merge for 4.x? I was wondering if we should at least add an "internal" env. variable for disabling loading of the global functions for testing purposes. So that we can disable it when running the testsuite and ensure the core is only using the namespaced functions.

Created at 2 days ago
issue comment
`Cake\Log\Log` is not a PSR-3 compatible provider

It's the various engines(classes) under the Cake\Log\Engine namespace which are PSR-3 compatible and not Cake\Log\Log itself.

Created at 3 days ago

Update PHPStan

Update PHPStan

Add note about PHPStan execution

Merge pull request #17040 from cakephp/4.x-note

Add note about PHPStan execution

Merge pull request #17039 from cakephp/4.x-update-phpstan

Update PHPStan

clone stored message to prevent overwrite (#17031)

clone stored message to prevent overwrite

Fixes #17030

Add tests for cookie options.

Refs #17043

Merge pull request #17044 from cakephp/issue-17043

Add tests for CSRF cookie options.

Closes #17043

Fix cookie expire set to 1 when app timezone is not UTC

use '@1' syntax instead of DateTimezone

Update tests/TestCase/Http/Cookie/CookieTest.php

Co-authored-by: ADmad ADmad@users.noreply.github.com

Update tests/TestCase/Http/ResponseTest.php

4.5 Prototype of result set deprecations.

I wanted to put this up for review as an approach to improve the workflow issues outlined in #17046.

Once we're happy with the approach for these deprecations, I'll apply it to the remaining CollectionInterface methods.

Merge pull request #17049 from Erwane/expire_cookie_utc

Fix cookie expire set to 1 when app timezone is not UTC

Cleanup after #17049

Add more proxy methods having doc + runtime annotations.

Cleanup not needed tearDown part.

Merge pull request #17056 from cakephp/4.x-cleanup

Cleanup not needed tearDown part.

Adding provide psr/simple-cache-implementation

Merge pull request #17058 from challgren/add-psr-simple-cache

Adding provide psr/simple-cache-implementation

Created at 3 days ago

Namespace all functions.

Add global versions if not already defined.

Created at 3 days ago
closed issue
Plugin ErrorController not called when inside prefix routing

Description

Current behavior

We want to render specific template when error is thrown from the plugin. For that we have ErrorController inside main plugin namespace(let's call it Company\Plugin\Controller), so it would be Company\Plugin1\Controller\ErrorController.

Now when we throw exception from prefix route's controller i.e. Company\Plugin\Controller\Prefix1\FooController or Company\Plugin\Controller\Prefix2\BarController, it doesn't take plugin's Company\Plugin1\Controller\ErrorController into account. But, it calls core's controller(App\Controller\ErrorController).

Upon digging into ControllerFactory, it tries to find Company\Plugin\Controller\Prefix1\ErrorController.

// inside Cake\Controller\ControllerFactory
public function getControllerClass(ServerRequest $request): ?string
{
    ...

    // here in $namespace: Controller/Prefix1 (or Controller/Prefix2)
    return App::className($pluginPath . $controller, $namespace, 'Controller');
}

Expected behavior

Plugin's ErrorController(Company\Plugin1\Controller\ErrorController in our example) should be called.

CakePHP Version

4.3.11

PHP Version

No response

Created at 4 days ago
closed issue
Non intuitive name of `Cake\Validation\Validator->isArray()`

Description

This method adds a rule but by its name I wouldn't have thought so. There's the method isEmpty in the same class that follows the semantics we're used to and returns true or false.

I guess isArray() should be changed to array() following the same naming conventions as decimal, integer and scalar types.

CakePHP Version

4.4.11

PHP Version

No response

Created at 4 days ago
issue comment
Namespace all functions.

I don't want to discourage the use of global function in full Cake apps. They are a good convenience to have and having to add use statements for the functions is detrimental to that.

Your proposal for how to handle the loading of global functions sounds good but I would have that enabled by default in 5.x too, with the option of turning it off. For split packages we can make them opt-in and have users explicitly load them.

Namespacing the functions and always using the namespaced version internally ensures there are never naming conflicts with global functions declared by other vendors. In case of a conflict users still have the option to used the namespaced function, unlike currently how our dd() function becomes unavailable altogether if you use the REPL plugin.

Created at 5 days ago
issue comment
927 (DebugKit) - Refactor fallback feature to reuse it on DebugEngine

Adding a ChainedEngine would still add API surface wouldn't it?

Yes but with better code organization as all the fallback code gets tucked under that engine.

We also have the existing fallback configuration value to shim into a chained engine.

True though I wish we had explored the chained engine concept earlier instead of addition a new option. Hindsight is always 20/20 :)

Created at 5 days ago
issue comment
927 (DebugKit) - Refactor fallback feature to reuse it on DebugEngine

Can't we have a ChainedEngine which internally goes through the configured engines instead of increasing the API surface? Similar to the ChainMessagesLoader we have for i18n.

Created at 5 days ago

Add Validator::array().

Deprecate Validator::isArray(). Closes #17072.

Created at 6 days ago

Add Validator::array().

Deprecate Validator::isArray(). Closes #17072.

Created at 6 days ago

Add Validator::array().

Deprecate Validator::isArray(). Closes #17072.

Created at 6 days ago

Add Validator::array().

Deprecate Validator::isArray(). Closes #17072.

Created at 6 days ago

Add Validator::array().

Deprecate Validator::isArray(). Closes #17072.

Created at 6 days ago
pull request opened
Add Validator::array().

Deprecate Validator::isArray(). Closes #17072.

Created at 6 days ago
create branch
ADmad create branch issue-17072
Created at 6 days ago
issue comment
Non intuitive name of `Cake\Validation\Validator->isArray()`

We can add Validator::array() in 4.5 and deprecated Validator::isArray()

Created at 6 days ago
issue comment
Is there a way to get this to work with PHP 7?

The plugin can be installed on 7.2+ https://github.com/UseMuffin/Trash/blob/master/composer.json#L34

Created at 1 week ago
closed issue
Is there a way to get this to work with PHP 7?

I tried composer require muffin/trash but that yields:

composer require muffin/trash
Using version ^3.1 for muffin/trash
./composer.json has been updated
Running composer update muffin/trash
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires php >=8.1 but your php version (7.4.33) does not satisfy that requirement.
  Problem 2
    - laminas/laminas-diactoros 2.24.0 requires php ~8.0.0 || ~8.1.0 || ~8.2.0 -> your php version (7.4.33) does not satisfy that requirement.
    - cakephp/authentication 2.9.0 requires laminas/laminas-diactoros ^2.2.2 -> satisfiable by laminas/laminas-diactoros[2.24.0].
    - cakephp/authentication is locked to version 2.9.0 and an update of this package was not requested.

You can also try re-running composer require with an explicit version constraint, e.g. "composer require muffin/trash:*" to figure out if any version is installable, or "composer require muffin/trash:^2.1" if you know which you need.

I also tried: composer require muffin/trash:* but gives the same error.

Created at 1 week ago

Namespace all functions.

Add global versions if not already defined.

Created at 1 week ago

Namespace all functions.

Add global versions if not already defined.

Created at 1 week ago

Namespace all functions.

Add global versions if not already defined.

Created at 1 week ago
issue comment
Namespace all functions.

We'll need to figure out how to handle conditional declaration of global functions. Using Configure::read() won't work since the functions.php files are auto loaded by composer before we can modify the app config.

Created at 1 week ago

Namespace all functions.

Add global versions if not already defined.

Created at 1 week ago