Download the PHP package ozh/bookmarkletgen without Composer
On this page you can find all versions of the php package ozh/bookmarkletgen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ozh/bookmarkletgen
More information about ozh/bookmarkletgen
Files in ozh/bookmarkletgen
Package bookmarkletgen
Short Description PHP class to convert JS into valid bookmarklet links
License MIT
Homepage https://github.com/ozh/bookmarkletgen
Informations about the package bookmarkletgen
Bookmarklet Gen
![Codacy Badge](https://app.codacy.com/project/badge/Grade/c3859f81e65c4e37a711531e06c0e477)
Convert (readable) Javascript code into bookmarklet links
Requires PHP 7.2 - 8.1
Features
- removes comments
-
compresses code by removing extraneous spaces, but not within literal strings. Example:
will return:
- encodes what needs to be encoded
- wraps code into a self invoking function ready for bookmarking
This is basically a slightly enhanced PHP port of the excellent Bookmarklet Crunchinator: http://ted.mielczarek.org/code/mozilla/bookmarklet.html
Installation
If you are using Composer, add this requirement to your composer.json
file and run composer install
:
Or simply in the command line : composer install ozh/bookmarkletgen
If you're not using composer, download the class file and include it manually.
Example
will print:
Tests
This library comes with unit tests to make sure the resulting crunched Javascript is valid code under various PHP versions.
Current version supports PHP 7.2+ (previous releases were tested with PHP 5.3 - 7.1)
License
Do whatever the hell you want to do with it