Download the PHP package knevelina/prolite without Composer

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

ProLite PL-M2014R Protocol

This is a PHP implementation of the Prolite PL-M2014R protocol. The PL-M2014R is an electronic LED sign. With this library, you can create pages, timers and graphics and generate the protocol lines to transfer them to the sign.

This implementation is not complete.


Usage

First install the library:

Start by creating a Display instance with the correct display ID:

Now use the graphics bank, page bank and timer bank to configure the display:

Finally, use getConfiguration(bool $reset = true): string to get the text you should send to the display to apply your configuration. Setting $reset argument (true by default) resets the display before applying the configuration. This is highly recommended.

The configuration should now be sent line by line to the display. The display will respond with its identification followed by a new line after each succesful request. It's important that you wait for this acknowledgement, otherwise the display will crash.

PHP is not really able to write to a serial port, so you should consider using something else like Node.JS or Python to accomplish that. An example script, which uses pySerial, is included in examples/writetty.py.

Page bank

The most important building block of the Prolite sign is the page. The sign can store up to 26 pages. The sign identifies them by letter in the alphabet; the library identifies them by their numerical index, starting at 0. So page A has index 0, page B has index 1, ..., and page Z has index 25.

Every page stores roughly 1024 characters, but this library enforces 1000 as a hard limit to stay on the safe side. You should thus split large pages yourself before setting them with the library, or else an exception will be thrown.

Interacting with the page bank is as simple as you'd expect:

Graphics bank

The GraphicsBank of the display contains user-defined and default graphics. The display supports defining and using 26 different graphics of 18 pixels wide and 7 pixels high, consisting of red, yellow, green and black pixels. Graphics are defined as strings of 126 characters.

26 default graphics are included:

You can use the built-in graphics by including <B_> in your message, replacing _ with the letter of the graphic you'd like to use.

While some graphics are nice to have, others (like the monster, the chair and the glasses) are quite boring. Luckily you can define your own graphics. This is done using a call to setGraphic(int $index, Graphic $graphic). The first argument is an instance of the Graphic class, which takes the graphic specification as its first and only argument:

Timer bank

The timer bank allows you to let the display show different pages after each other. The display supports up to 10 timers. Every timer has a day of week, hour and minute when it should activate, and the sequence of pages that is shown when the timer activates. The timer is the solution for displaying messages longer than 1000 characters.

The time settings work a bit like those of cron jobs, in the sense that you can omit time settings (by setting them to -1) to indicate that a timer should activate every time. For example, to have a timer activate every day of week at 2:30 AM, use -1, 2 and 30 as the day of week, hour and minute respectively.

The sequence of pages can be at most 32 pages; more pages are ignored by the sign and rejected by the library. You can use one page multiple times in one sequence.

Good to know: a timer which activates always (-1 for every field) only activates after it has finished displaying its entire sequence. In other words, to simply set a bunch of pages on loop, set a timer to fire every minute with those pages as a sequence.

Of course specific timers are only useful when the clock of the display has been set correctly:

Formatting text

The DisplayText class has a lot of useful DISPLAY_, COLOR_, and FORMAT_ constants.

First, the DISPLAY_ constants change the way the text on the screen behaves. You use them by inserting them in your page contents, for example like so:

The behavior of the various display constants is described in their phpDoc.

Next, you can set the color of text using the COLOR_ constants. You use them the same way as the display constants. The color remains set until another color is set, or when the end of the page is reached.

Finally, you can set the formatting of the text using the FORMAT_ constants. The format(bool $flashing, bool $italic, bool $bold): string function can help in finding the right constant, for example when letting users choose their formatting in a GUI.

Other useful functions

Lots of special characters and other things you'd expect to work on the sign don't. The sign only supports a limited subset of ASCII. To help you out with crafting the right messages for the sign, the DisplayText class has two very useful functions.

The escape(string $string): string function escapes a string to strip it from special commands. You should definitely pass user input through this function when it will be displayed on the sign.

The normalize(string $string): string function modifies a string to reduce it to the character set allowed by the sign. It does this while trying to transform special characters to their ASCII equivalent. For example, mon frère a acheté de la crème fraîche would be changed to mon frere a achete de la creme fraiche.

Contributing

Some guidelines:

License

MIT. See LICENSE.


All versions of prolite with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-intl Version *
ext-json Version *
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 knevelina/prolite contains the following files

Loading the files please wait ....