8000 Allow custom php.ini settings by mpociot · Pull Request #98 · NativePHP/laravel · GitHub
[go: up one dir, main page]

Skip to content

Allow custom php.ini settings #98

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

Merged
merged 1 commit into from
Jul 31, 2023
Merged

Allow custom php.ini settings #98

merged 1 commit into from
Jul 31, 2023

Conversation

mpociot
Copy link
Member
@mpociot mpociot commented Jul 31, 2023

This PR adds the ability to define custom php ini settings that will be passed to the static PHP binary when it starts the Laravel app, runs the scheduler and runs the queue worker.

To use this in existing apps, just add the phpIni method to your NativeAppServiceProvider class.

For example:

<?php

namespace App\Providers;

use Native\Laravel\Facades\Window;
use Native\Laravel\Contracts\ProvidesPhpIni;

class NativeAppServiceProvider implements ProvidesPhpIni
{
    /**
     * Executed once the native application has been booted.
     * Use this method to open windows, register global shortcuts, etc.
     */
    public function boot(): void
    {
        Window::open();
    }


    public function phpIni(): array
    {
        return [
            'memory_limit' => '512M',
            'display_errors' => '1',
            'error_reporting' => 'E_ALL',
            'max_execution_time' => '0',
            'max_input_time' => '0',
        ];
    }
}

This PR needs NativePHP/electron-plugin#9

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.

1 participant
0