Skip to content

Conversation

@ben221199
Copy link
Contributor

This PR adds support for PHP 8.

@ben221199 ben221199 mentioned this pull request Jan 22, 2021
@ben221199
Copy link
Contributor Author

Seems Travis is hanging.

@mfjordvald
Copy link

Would be great to get this merged in.

@ben221199
Copy link
Contributor Author

@Gemorroj Changes are made. Where are we waiting for?

@Gemorroj
Copy link
Contributor

Gemorroj commented Feb 3, 2021

@ben221199 im not maintainer of that project) im waiting the change like you

@ben221199
Copy link
Contributor Author

ben221199 commented Feb 3, 2021

@ben221199 im not maintainer of that project) im waiting the change like you

Ah okay.
@oohnoitz I see that you did merge PRs in the past. Could you also check this one?

@woxxy woxxy self-assigned this Feb 3, 2021
@woxxy
Copy link
Member

woxxy commented Feb 3, 2021

We need to get the CI to work first, will look into it when I have some time

@oohnoitz
Copy link
Contributor

oohnoitz commented Feb 3, 2021

just had a tiny nit regarding the CHANGELOG modifications. but we'll need to look into the CI as @woxxy mentioned.

@ben221199 ben221199 requested a review from oohnoitz February 4, 2021 08:56
@ben221199
Copy link
Contributor Author

The last version was 2.1.0, so the next version could be 2.1.1, 2.2.0 or 3.0.0. Because we add support for PHP 8, I would say the best choice is to go to 3.0.0. I also used that version in the Change Log.

@oohnoitz
Copy link
Contributor

oohnoitz commented Feb 7, 2021

Next version would be 3.0.0 since renaming would be a breaking change. Also, don't see the change pushed up yet.

@ben221199
Copy link
Contributor Author

Well, that was stupid :D.
I pushed it now.

Copy link
Contributor

@oohnoitz oohnoitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a few nits regarding code style inconsistency. also, can you fix the travis builds so it passes?

@ben221199
Copy link
Contributor Author

there are a few nits regarding code style inconsistency. also, can you fix the travis builds so it passes?

Is there also a reason why I cannot see the Travis CI build?

@ben221199
Copy link
Contributor Author

there are a few nits regarding code style inconsistency. also, can you fix the travis builds so it passes?

Is there also a reason why I cannot see the Travis CI build?

Never mind. This was an issue in my browser.

Copy link
Contributor Author

@ben221199 ben221199 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect.

@scrutinizer-notifier
Copy link

The inspection completed: 117 updated code elements

@ben221199
Copy link
Contributor Author

@oohnoitz Is there anything possible at the moment?

Copy link
Contributor

@oohnoitz oohnoitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's taking me some time to determine what actual changes were made and review them. i'm seeing a few tests that are commented out. is the plan to fix them in a subsequent PR? if that is the case, we can get the current work merged into a branch on this repo and have some follow up PRs done to fix the broken tests. otherwise, i can't go ahead and merge it in as-is since this is removing tests.

Copy link
Contributor

@oohnoitz oohnoitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving a few comments to track down missing/removed tests. and determine what went wrong. adding php8 support should have caused those tests to break at all.

$this->stored = $this->affected_rows;
} else {
if (!$this->adapter->isDml()) {
// $this->stored = $this->affected_rows;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason this code was commented out?

There's a sphinx.conf file in this directory. It uses a single RT index. Check the necessary directories, I ran Sphinx in `/usr/local/sphinx`
Choose the version you want to use (e.g. Sphinx 2, Sphinx 3 or Manticore).
Then set an environment variable:
- Sphinx 2: Typ `SEARCH_BUILD=SPHINX2` in the console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: type is misspelled in this file.

// * @throws SphinxQLException
// * @throws DatabaseException
// */
// public function testMultiQuery(): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiQuery test was removed for some reason?

class MultiResultSetTest extends TestCase
{

// /**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiResultSet test was removed for some reason?

class FacetTest extends TestCase
{

// public static $DATA = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed if it isn't used at all in the test file.

// */
// public function testCreateFunction(): void
// {
// $this->createHelper()->createFunction('my_udf', 'INT', 'test_udf.so')->execute();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createFunction test was removed for some reason?

class PercolateTest extends TestCase
{

// /**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manticore Percolate test file was removed for some reason?

// * @throws DatabaseException
// * @throws SphinxQLException
// */
// public function testUpdate(): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update tests were removed for some reason.

Comment on lines +953 to +955
// $this->assertEquals('10', $result[0][0]['id'] ?? null);
// $this->assertEquals('1', $result[1][0]['Value'] ?? null);
// $this->assertEquals('11', $result[2][0]['id'] ?? null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's happening here? it should default to null

$this->assertEquals('3', $result[1][2]['count(*)']);
$this->assertEquals('2', $result[1][3]['count(*)']);
foreach ([self::$connection, null] as $connection) {
// $result = $this->createSphinxQL()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facet tests were removed for some reason? also not sure why we are returning early for Mysqli driver.

@ben221199
Copy link
Contributor Author

it's taking me some time to determine what actual changes were made and review them. i'm seeing a few tests that are commented out. is the plan to fix them in a subsequent PR? if that is the case, we can get the current work merged into a branch on this repo and have some follow up PRs done to fix the broken tests. otherwise, i can't go ahead and merge it in as-is since this is removing tests.

I think that is the easiest thing to do now.

@oohnoitz oohnoitz changed the base branch from master to php8 February 16, 2021 17:01
@oohnoitz oohnoitz merged commit 73a8b5c into FoolCode:php8 Feb 16, 2021
@oohnoitz
Copy link
Contributor

oohnoitz commented Feb 16, 2021

@ben221199 merged it into php8 branch so that it can be worked on there. we'll want to have the remaining tests fixed and added back in.

@ben221199
Copy link
Contributor Author

Nice. I will try to work on that one. But if other people feel free to help, they are welcome :D

@red-led
Copy link
Contributor

red-led commented Apr 8, 2021

Tried updating to php8 branch in my code (composer require foolz/sphinxql-query-builder dev-php8) and getting this error:

mysqli_sql_exception: Commands out of sync; you can't run this command now .../foolz/sphinxql-query-builder/src/Drivers/Mysqli/Connection.php:151
Stack trace:
#0 .../foolz/sphinxql-query-builder/src/Drivers/Mysqli/Connection.php(151): mysqli->multi_query()
#1 .../foolz/sphinxql-query-builder/src/SphinxQL.php(296): Foolz\SphinxQL\Drivers\Mysqli\Connection->multiQuery()
...

Is it bug or BC?

If I just manually rename Match to MathBuilder in old version - it works on php8 without any problems.

@ben221199
Copy link
Contributor Author

@red-led What version do you use? Sphinx 2, Sphinx 3 or MantiCore?

@red-led
Copy link
Contributor

red-led commented Apr 8, 2021

@ben221199, Sphinx 2

@ben221199
Copy link
Contributor Author

Did you try Sphinx 3?

@ben221199
Copy link
Contributor Author

Update:
See #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants