https://github.com/ahmadasjad/php-mysql-mysqli-migration
A library to migrate PHP mysql_* functions to mysqli_* functions
https://github.com/ahmadasjad/php-mysql-mysqli-migration
migration mysqli upgrade
Last synced: about 1 month ago
JSON representation
A library to migrate PHP mysql_* functions to mysqli_* functions
- Host: GitHub
- URL: https://github.com/ahmadasjad/php-mysql-mysqli-migration
- Owner: ahmadasjad
- Created: 2024-02-21T17:55:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-23T15:11:57.000Z (about 1 year ago)
- Last Synced: 2025-02-16T09:18:16.990Z (3 months ago)
- Topics: migration, mysqli, upgrade
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## How to use
- create a class similar to `src/Example/DbConnection.php`
- copy `src/rector-config/rector.php` to your root directory
- modify it as per your need.
- Must call `\AhmadAsjad\Refactor\MysqlToMysqli\Rule\ChangeMysqlToMysqli::setDbConnectionVariable('\Example\DbConnection::getInstance()');` and change its argument value to your custom class value## Example
rector.php
```php
use AhmadAsjad\Refactor\MysqlToMysqli\Rule\ChangeMysqlToMysqli;$root_path = '/your/app/src';
ChangeMysqlToMysqli::setDbConnectionVariable('\Example\DbConnection::getInstance()');
return RectorConfig::configure()
->withPaths([
$root_path,
])
//->withSkip([$root_path.'/path/1', $root_path.'/path/2',])
//->withPhpVersion(\Rector\ValueObject\PhpVersion::PHP_56)
->withRules([
ChangeMysqlToMysqli::class,
]);
```command
`vendor/bin/rector process`## Rector version details
- refactoring for mysql supported in rector: 0.8.8
- refactoring for mysql supported in rector: 0.17.2
- refactoring for mysql removed from 0.17.3