Download the PHP package clue/zenity-react without Composer

On this page you can find all versions of the php package clue/zenity-react. 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 zenity-react

clue/reactphp-zenity

CI status installs on Packagist

Zenity allows you to build graphical desktop (GUI) applications in PHP, built on top of ReactPHP.

https://help.gnome.org/users/zenity/3.24/question.html

Zenity is a small program that allows creating simple GTK+ dialogs from within command line scripts. Zenity already ships with Ubuntu-based distributions and does not require any installation there - so this library should work out of the box. Otherwise you may have to install Zenity yourself. This library provides an easy to use wrapper to spawn Zenity processes to build graphical desktop applications with PHP.

Table of contents

Support us

We invest a lot of time developing, maintaining and updating our awesome open-source projects. You can help us sustain this high-quality of our work by becoming a sponsor on GitHub. Sponsors get numerous benefits in return, see our sponsoring page for details.

Let's take these projects to the next level together! 🚀

Quickstart example

Once installed, you can use the following code to open a prompt asking the user for his name and presenting it in another info dialog.

Looking for more examples? Take a look at the examples folder.

Usage

Launcher

As shown in the above example, a Launcher has to be instantiated once and is responsible for launching each Zenity dialog. It manages running the underlying zenity process and reports back its state and user interaction.

It uses the react/event-loop component to enable an async workflow where you can launch multiple dialogs while simultaneously doing more I/O work. This library exposes both a simple blocking API and a more advanced async API.

This class takes an optional LoopInterface|null $loop parameter that can be used to pass the event loop instance to use for this object. You can use a null value here in order to use the default loop. This value SHOULD NOT be given unless you're sure you want to explicitly use a given event loop instance.

setBin()

For launching the process it assumes your zenity binary is located in your system $PATH. If it's not, you can explicitly set its path like this:

waitFor()

The waitFor($dialog) method can be used to launch a given dialog and wait for the Zenity process to return its result. This simple blocking API allows you to get started quickly without exposing all nifty async details - and lacking some of its advanced features:

launch()

The launch($dialog) method can be used to asynchronously launch a given dialog and return a Promise that will be fulfilled when the Zenity process returns. This async API enables you to launch multiple dialogs simultaneously while simultaneously doing more I/O work.

launchZen()

The launchZen($dialog) method can be used to asynchronously launch a given dialog and return an instance of the BaseZen class. This instance exposes methods to control the Zenity process while waiting for the results. Some dialog types also support modifying the information presented to the user.

Builder

Additionally, the Builder implements an even simpler interface for commonly used dialogs. This is mostly for convenience, so you can get started easier. The methods should be fairly self-explanatory and map directly to the Zenity dialogs listed below.

For anything more complex, you can also instantiate the below classes directly.

Dialog

The Dialog API is modelled closely after Zenity's command line API, so it should be familiar if you're already using it from within any other command line script.

AbstractDialog

Abstract base class for all Zenity dialogs (see below for details on each concrete type).

CalendarDialog

https://help.gnome.org/users/zenity/3.24/calendar.html

ColorSelectionDialog

https://help.gnome.org/users/zenity/3.24/colorselection.html

EntryDialog

https://help.gnome.org/users/zenity/3.24/entry.html

ErrorDialog

https://help.gnome.org/users/zenity/3.24/error.html

FileSelectionDialog

https://help.gnome.org/users/zenity/3.24/fileselection.html

FormsDialog

https://help.gnome.org/users/zenity/3.24/forms.html

InfoDialog

https://help.gnome.org/users/zenity/3.24/info.html

ListDialog

Where $selected in case of listCheck is an array of keys of the items from $list you want to preselect. Where $selected in case of listRadio is the key of the item from $list you want to preselect.

https://help.gnome.org/users/zenity/3.24/list.html

NotificationDialog

https://help.gnome.org/users/zenity/3.24/notification.html

PasswordDialog

https://help.gnome.org/users/zenity/3.24/password.html

ProgressDialog

https://help.gnome.org/users/zenity/3.24/progress.html

QuestionDialog

https://help.gnome.org/users/zenity/3.24/question.html

ScaleDialog

https://help.gnome.org/users/zenity/3.24/scale.html

TextInfoDialog

https://help.gnome.org/users/zenity/3.24/text.html

WarningDialog

https://help.gnome.org/users/zenity/3.24/warning.html

Install

The recommended way to install this library is through Composer. New to Composer?

This will install the latest supported version:

See also the CHANGELOG for details about version upgrades.

This project aims to run on any platform and thus does not require any PHP extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. It's highly recommended to use the latest supported PHP version for this project.

Obviously, this library requires the Zenity binary itself. Zenity already ships with Ubuntu-based distributions and should not require any installation there. On Debian- and Ubuntu-based distributions you can make sure it's installed like this:

Otherwise you may have to install Zenity yourself (use your favorite search engine, download the appropriate release tarball or compile from source). Zenity it not officially supported on other platforms, however several non-official releases exist.

Running on Windows is currently not supported

This library assumes Zenity is installed in your PATH. If it is not, you can explicitly set its path like this:

Tests

To run the test suite, you first need to clone this repo and then install all dependencies through Composer:

To run the test suite, go to the project root and run:

License

This project is released under the permissive MIT license.

Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.


All versions of zenity-react with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
react/child-process Version ^0.6 || ^0.5 || ^0.4 || ^0.3
react/event-loop Version ^1.0 || ^0.5 || ^0.4 || ^0.3
react/promise Version ~2.0|~1.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 clue/zenity-react contains the following files

Loading the files please wait ....