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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 11 additions & 42 deletions resources/stubs/NativeAppServiceProvider.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,26 @@

namespace App\Providers;

use Native\Laravel\Facades\ContextMenu;
use Native\Laravel\Facades\Dock;
use Native\Laravel\Facades\Window;
use Native\Laravel\Facades\GlobalShortcut;
use Native\Laravel\Menu\Menu;
use Native\Laravel\Contracts\ProvidesPhpIni;

class NativeAppServiceProvider
class NativeAppServiceProvider implements ProvidesPhpIni
{
/**
* Executed once the native application has been booted.
* Use this method to open window 8000 s, register global shortcuts, etc.
*/
public function boot(): void
{
Menu::new()
->appMenu()
->submenu('About', Menu::new()
->link('https://beyondco.de', 'Beyond Code')
->link('https://simonhamp.me', 'Simon Hamp')
)
->submenu('View', Menu::new()
->toggleFullscreen()
->separator()
->link('https://laravel.com', 'Learn More', 'CmdOrCtrl+L')
)
->register();

Window::open()
->width(800)
->height(800);

/**
Dock::menu(
Menu::new()
->event(DockItemClicked::class, 'Settings')
->submenu('Help',
Menu::new()
->event(DockItemClicked::class, 'About')
->event(DockItemClicked::class, 'Learn More…')
)
);

ContextMenu::register(
Menu::new()
->event(ContextMenuClicked::class, 'Do something')
);
Window::open();
}

GlobalShortcut::new()
->key('CmdOrCtrl+Shift+I')
->event(ShortcutPressed::class)
->register();
*/
/**
* Return an array of php.ini directives to be set.
*/
public function phpIni(): array
{
return [
];
}
}
22 changes: 22 additions & 0 deletions src/Commands/LoadPHPConfigurationCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Native\Laravel\Commands;

use Illuminate\Console\Command;
use Native\Laravel\Contracts\ProvidesPhpIni;

class LoadPHPConfigurationCommand extends Command
{
protected $signature = 'native:php-ini';

public function handle()
{
/** @var ProvidesPhpIni $provider */
$provider = app(config('nativephp.provider'));
$phpIni = [];
if (method_exists($provider, 'phpIni')) {
$phpIni = $provider->phpIni();
}
echo json_encode($phpIni);
}
}
8 changes: 8 additions & 0 deletions src/Contracts/ProvidesPhpIni.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Native\Laravel\Contracts;

interface ProvidesPhpIni
{
public function phpIni(): array;
}
2 changes: 2 additions & 0 deletions src/NativeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Native\Laravel;

use Illuminate\Support\Arr;
use Native\Laravel\Commands\LoadPHPConfigurationCommand;
use Native\Laravel\Commands\LoadStartupConfigurationCommand;
use Native\Laravel\Commands\MigrateCommand;
use Native\Laravel\Commands\MinifyApplicationCommand;
Expand All @@ -20,6 +21,7 @@ public function configurePackage(Package $package): void
MigrateCommand::class,
MinifyApplicationCommand::class,
LoadStartupConfigurationCommand::class,
LoadPHPConfigurationCommand::class,
])
->hasConfigFile()
->hasRoute('api')
Expand Down
0