Download the PHP package smronju/nativephp-document-picker without Composer

On this page you can find all versions of the php package smronju/nativephp-document-picker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nativephp-document-picker

NativePHP Document Picker

Presents the system document picker in a NativePHP Mobile app — to open a foreign file, and to save one back out to a location the user chooses.

No storage permission on either platform, either direction: both pickers are system UI, and the user choosing a file or a destination is the entire grant.

Why open hands back a copy

Neither platform hands back something PHP can read. Android returns a content:// URI belonging to another app's provider, which fopen() cannot open at all; iOS returns a URL inside the provider's sandbox that needs coordinated access and a security-scoped resource dance the embedded runtime can't perform. So pick() copies first and reports the copy's path.

Why save exists at all

The system share sheet (Share::file() from nativephp/mobile-share) can only offer whatever apps happen to register a share receiver — on a device with no such app installed, there is nothing to save to. save() is backed by the OS's own storage layer instead (Android's Storage Access Framework; iOS's document provider system), so it always has somewhere to put the file, independent of what's installed.

Installation

Then rebuild — native code only compiles in at build time:

Usage

Opening a file

pick() only presents the picker. The result arrives via an event, because choosing a file can take arbitrarily long — a file in a cloud provider is downloaded first.

Saving a file

$sourcePath must already exist — this presents a picker for a file the app already wrote; it does not create one. Like pick(), this only presents the picker; the outcome arrives via an event.

Every listener parameter needs its own = null default even though the types are nullable — the #[On] dispatcher supplies an argument only for payload keys that are present, and this plugin omits every key on cancel. (An explicit JSON null would arrive as '', not null.)

Notes

License

MIT


All versions of nativephp-document-picker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
nativephp/mobile Version ^3.0|^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package smronju/nativephp-document-picker contains the following files

Loading the files please wait ...