Skip to content

Laravel package to convert files and database from zawgyi to unicode.

License

Notifications You must be signed in to change notification settings

tintnaingwinn/kuu-pyaung

Repository files navigation

Convert resources files and database from zawgyi to unicode for Laravel apps

Latest Version on Packagist Laravel 10.x Laravel 9.x Laravel 8.x

Kuu Pyaung Package converts resources files and databases from zawgyi to unicode.

If the context is unicode, don't worry about the conflict context, Kuu Pyaung hasn't converted unicode context to unicode again.

Requirements

version-1.x

version-2.x

version-3.x

version-4.x

version-5.x

Laravel Version Compatibility

Laravel Package PHP
5.2.x 1.x >=5.6.4
5.3.x 1.x >=5.6.4
5.4.x 1.x >=5.6.4
5.5.x 2.x >=7.0.0
5.6.x 2.x >=7.1.3
5.7.x 2.x >=7.1.3
5.8.x 3.x >=7.2.0
6.x 3.x >=7.2.0
7.x 3.x >=7.2.5
8.x 4.x >=7.4
9.x 5.x >=8.1
10.x 5.x >=8.1

Installation and usage

For Laravel 8.x

composer require tintnaingwin/kuu-pyaung:"~4.0"

For Laravel 5.8|6.x|7.x

composer require tintnaingwin/kuu-pyaung:"~3.0"

For Laravel 5.5|5.6|5.7

composer require tintnaingwin/kuu-pyaung:"~2.0"

For Laravel 5.2|5.3|5.4

composer require tintnaingwin/kuu-pyaung:"~1.0"

For laravel >=5.5 that's all. This package supports Laravel new Package Discovery.

If you are using Laravel < 5.5, you also need to add the service provider class to your project's config/app.php file:

Service Provider
Tintnaingwin\KuuPyaung\KuuPyaungServiceProvider::class,

You can publish the config-file with:

php artisan vendor:publish --provider="Tintnaingwin\KuuPyaung\KuuPyaungServiceProvider"

Artisan commands

You can convert your app by running:

php artisan kuupyaung:run

If you would like to convert only the files, run:

php artisan kuupyaung:run --only-files

If you would like to convert only the database, run:

php artisan kuupyaung:run --only-database

Configuration

Kuu Pyaung can be configured directly in /config/kuu-pyaung.php.

This is the contents of the published config file:

return [

    /*
     * These resource directories only will be convert.
     */
    'include_files' => [
        'views',
        'lang', // lang/my
    ],

    /*
     * These database tables will be excluded from the convert.
     */
    'exclude_tables' => [
        'password_resets',
        'migrations',
        'failed_jobs',
        'telescope_entries',
        'telescope_entries_tags',
        'telescope_monitoring',
    ],
    
    /*
     * These database table columns will be excluded from the convert.
     *
     * The value of the some columns may be filenames or you don't want to convert.
     * Eg - 'table_name' => [ 'exclude_column', 'exclude_column' ]
     */
    'exclude_table_columns' => [
        'users' => [ 'profile_pic', 'file_path' ],
        'orders' => [ 'invoice_path' ]
    ]
    
];

Files Convert

This package convert only folder under the resource directories. You can determine which resource files will be convert.

    /*
     * These resource directories only will be convert.
     */
    'include_files' => [
        'views',
        'lang', // lang/my
    ],

Database Convert

Exclude Tables - Kuu Pyaung converts only string data types from the database. You can determine which tables will be excluded from the convert. In addition, if your table does not have primary key (id or UUID), this table will not be converted.

    /*
     * These database tables will be excluded from the convert.
     */
    'exclude_tables' => [
            'password_resets',
            'migrations',
            'failed_jobs',
            'telescope_entries',
            'telescope_entries_tags',
            'telescope_monitoring',
    ],

Exclude Columns - If the value of some columns is maybe zawgyi filenames or file paths. you can add these columns in the exclude_table_columns at the config file.

    /*
     * These database table columns will be excluded from the convert.
     *
     * The value of the some columns may be filenames that you don't want to convert.
     * Eg - 'table_name' => [ 'exclude_column', 'exclude_column' ]
     */
    /*
    'exclude_table_columns' => [
        'users' => [ 'profile_pic', 'file_path' ],
        'orders' => [ 'invoice_path' ]
    ]
    */

We highly recommend that you should use maintenance mode when you convert the database tables in production server.

Supported databases

  • MySQL
  • PostgreSQL
  • SQLite

Troubleshoot

You can convert with kuu-pyaung in the following situations,

The first thing if you are using the laravel <5.2
The second thing you don't want to install current project.

  • First, create the new laravel project
  • Make sure to join the database.
  • Make sure to install the kuu-pyaung
  • After that you can convert with kuu-pyaung

Testing

Run the tests with:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.