Skip to content

Commit 1c697f9

Browse files
committed
wip
1 parent 3edcd50 commit 1c697f9

File tree

2 files changed

+40
-39
lines changed

2 files changed

+40
-39
lines changed

resources/views/docs/1/getting-started/configuration.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ order: 200
88
The `native:install` command publishes a configuration file to `config/nativephp.php`.
99
This file contains all the configuration options for NativePHP.
1010

11+
## Default Configuration File
12+
1113
```php
1214
return [
1315
/**
@@ -87,3 +89,41 @@ return [
8789
],
8890
];
8991
```
92+
93+
## Customize php.ini
94+
95+
When your NativePHP application starts, you may want to customize php.ini directives that will be used for your application.
96+
97+
You may configure these directives via the `phpIni()` method on your `NativeAppServiceProvider`.
98+
This method should return an array of php.ini directives to be set.
99+
100+
```php
101+
namespace App\Providers;
102+
103+
use Native\Laravel\Facades\Window;
104+
use Native\Laravel\Contracts\ProvidesPhpIni;
105+
106+
class NativeAppServiceProvider implements ProvidesPhpIni
107+
{
108+
/**
109+
* Executed once the native application has been booted.
110+
* Use this method to open windows, register global shortcuts, etc.
111+
*/
112+
public function boot(): void
113+
{
114+
Window::open();
115+
}
116+
117+
118+
public function phpIni(): array
119+
{
120+
return [
121+
'memory_limit' => '512M',
122+
'display_errors' => '1',
123+
'error_reporting' => 'E_ALL',
124+
'max_execution_time' => '0',
125+
'max_input_time' => '0',
126+
];
127+
}
128+
}
129+
```

resources/views/docs/1/the-basics/app-lifecycle.md

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -58,42 +58,3 @@ class NativeAppServiceProvider
5858
}
5959
}
6060
```
61-
62-
## Customize php.ini With Provider
63-
64-
you may to customize you php.ini with `NativeAppServiceProvider`:
65-
66-
```php
67-
<?php
68-
69-
namespace App\Providers;
70-
71-
use Native\Laravel\Facades\Window;
72-
use Native\Laravel\Contracts\ProvidesPhpIni;
73-
74-
class NativeAppServiceProvider implements ProvidesPhpIni
75-
{
76-
/**
77-
* Executed once the native application has been booted.
78-
* Use this method to open windows, register global shortcuts, etc.
79-
*/
80-
public function boot(): void
81-
{
82-
Window::open();
83-
}
84-
85-
86-
public function phpIni(): array
87-
{
88-
return [
89-
'memory_limit' => '512M',
90-
'display_errors' => '1',
91-
'error_reporting' => 'E_ALL',
92-
'max_execution_time' => '0',
93-
'max_input_time' => '0',
94-
];
95-
}
96-
}
97-
```
98-
99-
> **_NOTE:_** For customize php.ini, you must implement the `ProvidesPhpIni` contract.

0 commit comments

Comments
 (0)