Nativella documentation¶
Nativella runs a PHP web application as a desktop application: a native window, PHP embedded in the application itself, and no web server in between. These pages go from the first window to the single-file build, and down to how the requests travel.
Nativella is young and experimental. Linux is the platform it is built and tested on; Android and iOS builds are experimental. Read Limitations and roadmap before you bet anything on it.
Start here¶
- Introduction: what Nativella is, what it is not, and when it fits.
- Compared to NativePHP and Symfony UX: what each one runs, where, and which one to pick.
- Installation: the
nativellacommand, with PHP inside, and the PHP package. - Getting started: from an empty directory to a desktop application, in plain PHP.
- What runs where: every native API, on computers and on phones.
- Configuration: the
extra.nativellasection ofcomposer.json, and the environment.
Frameworks¶
- Symfony: the bundle, the APIs as services, native events as Symfony events.
- Laravel: the package, the facades, native events as Laravel events.
- Plain PHP: no framework,
Nativella::create()and the event factory.
Guides¶
- Lifecycle and events: booting, native events, closing windows, quitting.
- Database: SQLite in the data directory, migrated when the application starts.
- Downloads: attachments and
downloadlinks, saved where the user chooses. - Testing: the fake client, and running the application outside Nativella.
- Building a standalone app:
nativella build, what ships in the executable, its size and its memory. - Your own PHP: another version of PHP, other extensions, in a
nativellabuilt from the repository. - Updates: standalone executables that update themselves from your releases.
- Mobile:
nativella androidandnativella ios, what changes on a phone, what is tested.
Native APIs¶
- App: name and version, directories, quit and restart, autostart, badge.
- Windows: open, move, resize, hide and close windows.
- Menus: the application menu and context menus.
- Tray: an icon in the system tray, with its menu.
- Dialogs: message boxes, confirmations and file pickers.
- Notifications: system notifications.
- Clipboard: read and write text, HTML and images.
- Global shortcuts: keyboard shortcuts that work in the background.
- Settings: a key-value store for preferences.
- Secrets: tokens and passwords in the system keychain.
- Timers: wake PHP up for periodic work.
- Child processes: start processes, with their output as events.
- Phone APIs: haptics, geolocation, biometrics, a barcode scanner, NFC tags and the share sheet, on phones.
- Shell: open URLs and files with the system's applications.
- Screens: displays, work areas and the cursor.
- System: the operating system, the locale and the theme.
- Power: the battery, the power source, waking from sleep, keeping the computer awake.
- Updates: standalone executables that update themselves from your releases.
- Pages and JavaScript:
nativella:*DOM events,fetch(), context menus.
Under the hood¶
- How it works: the scheme handler, the SAPI, the PHP thread, and what WebKit does not do.
- Limitations and roadmap: what is missing, what is untested, what comes next.
Contributing¶
- Developing Nativella: the Docker stack, the Castor tasks, the quality checks and the CI.