Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for PHP8.4 #151

Merged
merged 6 commits into from
Dec 17, 2024
Merged

feat: add support for PHP8.4 #151

merged 6 commits into from
Dec 17, 2024

Conversation

danielrona
Copy link
Contributor

With PHP 8.4 introducing PDO Subclasses and a new connect function.
I had to rename this to not crash on 8.4

[11.x] Add PDO subclass support for PHP 8.4 #52538

@yajra
Copy link
Owner

yajra commented Dec 11, 2024

Thanks for the PR. I need to set up a PHP8.4 environment and will test this along with the Laravel OCI8 package.

@shufo
Copy link

shufo commented Dec 13, 2024

I had the same issue on PHP 8.4.1 with pdo-via-oci 3.5.0.

⬢ [Docker] ❯ php -v
PHP 8.4.1 (cli) (built: Nov 21 2024 17:57:55) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.4.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.1, Copyright (c), by Zend Technologies

> DB::connection('oracle')
{
	"message": "Cannot make static method PDO::connect() non static in class Yajra\\Pdo\\Oci8",
	"context": {
		"exception": {
			"class": "Symfony\\Component\\ErrorHandler\\Error\\FatalError",
			"message": "Cannot make static method PDO::connect() non static in class Yajra\\Pdo\\Oci8",
			"code": 0,
			"file": "/app/vendor/yajra/laravel-pdo-via-oci8/src/Pdo/Oci8.php:136"
		}
	},
	"level": 400,
	"level_name": "ERROR",
	"channel": "local",
	"datetime": "2024-12-14T05:29:25.054917+09:00",
	"extra": {}
}

Works perfectly by this PR's fix.

> DB::connection('oracle')->table('emp')->get()
= Illuminate\Support\Collection {#6560
    all: [
      {#6548
        +"empno": "aaa",
        +"empname": "test",
        +"gender_f": "0",
      },
    ],
  }

Also this fix works on php 8.3.

⬢ [Docker] ❯ php -v
PHP 8.3.1 (cli) (built: Jan 11 2024 06:55:06) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.1, Copyright (c), by Zend Technologies

root in app on  main [#!?⇣] via  v22.4.1 via 🐘 v8.3.1
⬢ [Docker] ❯ php artisan tinker
Psy Shell v0.12.4 (PHP 8.3.1 — cli) by Justin Hileman
> DB::connection('oracle')->table('emp')->get()
= Illuminate\Support\Collection {#6560
    all: [
      {#6548
        +"empno": "aaa",
        +"empname": "test",
        +"gender_f": "0",
      },
    ],
  }

@shufo
Copy link

shufo commented Dec 13, 2024

@yajra
Copy link
Owner

yajra commented Dec 16, 2024

Unfortunately, I am not yet able to set up a php8.4 due to some constraints.

Given @shufo's review, I think this is good for a release. But it would be nice if we could include php8.3 and 8.4 in the CI matrix. Can we try and add it in the matrix @danielrona?

Thanks!

@danielrona
Copy link
Contributor Author

@yajra this should do the trick i guess.

@yajra yajra changed the title PHP8.4 rename connect to connectOracle feat: add support for PHP8.4 Dec 17, 2024
@yajra yajra merged commit d29ff1f into yajra:3.0 Dec 17, 2024
6 checks passed
@yajra
Copy link
Owner

yajra commented Dec 17, 2024

Released on https://github.com/yajra/pdo-via-oci8/releases/tag/v3.6.0 🚀 Thanks!

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.

3 participants