Skip to content

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.
  • Installation: the nativella command, with PHP inside, and the PHP package.
  • Getting started: from an empty directory to a desktop application, in plain PHP.
  • Configuration: the extra.nativella section of composer.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.
  • Testing: the fake client, and running the application outside Nativella.
  • Building a standalone app: nativella build, and what ships in the executable.
  • Mobile: Android and iOS builds, 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: desktop notifications.
  • Clipboard: read and write text and HTML.
  • Global shortcuts: keyboard shortcuts that work in the background.
  • Settings: a key-value store for preferences.
  • Secrets: tokens and passwords in the keychain of the system.
  • Timers: wake PHP up for periodic work.
  • Child processes: start processes, with their output as events.
  • Phone APIs: haptics, geolocation and biometrics, on phones.
  • Shell: open URLs and files with the applications of the system.
  • 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.
  • Pages and JavaScript: nativella:* DOM events, fetch(), context menus.

Under the hood

Contributing