chris48s / cakephp-searchable

:cake: A CakePHP 3 behavior for creating MySQL MATCH() AGAINST() queries :mag:
https://packagist.org/packages/chris48s/cakephp-searchable
MIT License
4 stars 4 forks source link

CakePHP 4 support #4

Closed robertpustulka closed 2 years ago

robertpustulka commented 3 years ago

CakePHP 4+ compatibility updates.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 19


Totals Coverage Status
Change from base Build 16: 0.0%
Covered Lines: 31
Relevant Lines: 31

💛 - Coveralls
chris48s commented 3 years ago

Hi @robertpustulka

Thanks for having a look at this.

I wrote a few CakePHP plugins a few years back, but since 2017 I don't use PHP in my job at all any more. This means I have not really kept pace with the latest developments in the PHP or CakePHP communities. I've had a look and the changes in this PR look sensible to me and all the tests pass, but I've never used CakePHP4 at all myself so I suspect if there was a small error I would not see it.

So here is my suggestion.. I notice you have made substantial contributions in the CakePHP ecosystem including to CakePHP core. If you are still relying on this library, I would be happy to either:

This is a small module which not require much attention (I made the repo in 2016 and this is issue #4 🙂) and if you are actively using it you are better placed to keep it up to date than I am.

What do you think?

umer936 commented 3 years ago

Hi.

I've tried adding the plugin from @robertpustulka 's "cake-4" branch in my composer.json using the repository section and it seems to include, but I can't get it to find the Behaviors...

However, if either of the things @chris48s said happen, then I can remove all that and just include the package normally, which would be nice :)

umer936 commented 3 years ago

Here's composer.json to be able to use it:

    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "chris48s/cakephp-searchable",
                "version": "2.0",
                "type": "package",
                "source": {
                    "url": "https://github.com/robertpustulka/cakephp-searchable.git",
                    "type": "git",
                    "reference": "cake-4"
                }
            }
        }
    ],
    "require": {
        "chris48s/cakephp-searchable": "^2.0"
    },
    "autoload": {
        "psr-4": {
            "Chris48s\\Searchable\\": "./vendor/chris48s/cakephp-searchable/src/"
        }
    },
    "extra":
    {
        "installer-paths":
        {
            "vendor/chris48s/cakephp-searchable": ["Chris48s/Searchable"]
        }
    },

and bootstrap()

        $this->addPlugin('Chris48s/Searchable',  [
            'path' => ROOT . DS . 'vendor' . DS . 'chris48s' . DS . 'cakephp-searchable' . DS . 'src'
        ]);

Not sure if all of these bits are correct, but it does finally work with all of these sections

robertpustulka commented 3 years ago

@chris48s Hi! Sorry for the late response. You can give me push access as a start, we'll see how it goes from here :). Thanks!

@umer936 Adding this to repositories should be enough:

        {
            "type": "vcs",
            "url": "https://github.com/robertpustulka/cakephp-searchable.git"
        }

My fix is tagged as 3.0:

"chris48s/cakephp-searchable": "^3.0"

CakePHP plugin installer will figure out the path itself. Just load a plugin as usual.

$this->addPlugin('Chris48s/Searchable');
chris48s commented 3 years ago

No problem :+1:

Thanks

wate commented 2 years ago

@robertpustulka

Would you like to be merged?

robertpustulka commented 2 years ago

@wate merged

I no longer use this package sorry. But the fix introduced here should work, at least it worked while I was using it.