2017 © Pedro Peláez
 

library safeecho

Lightweight function to easily hide printed data.

image

linio/safeecho

Lightweight function to easily hide printed data.

  • Friday, July 20, 2018
  • by linio
  • Repository
  • 3 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

safeecho

Purpose

Replacement function for echo/print. It will take the string, hide it and then wrap the new hidden string with whatever wrapper is specified., (*1)

echo John Smith will print John Smith, (*2)

Out-of-the-box safeecho('John Smith') will print J*** S****, (*3)

With a configuration file safeecho('John Smith') can print <span style="cursor: pointer;" onmouseout="this.innerHTML='J*** S****'" onmouseover="this.innerHTML='John Smith'">J*** S****</span>, (*4)

Installation

The supported way of installing safeecho is via Composer., (*5)

$ composer require linio/safeecho

Autoload function

In the composer.json file, add or append to the "autoload" field,, (*6)

"autoload": {
    "files": [
        "vendor/linio/safeecho/src/safeecho.php"
    ]
}

Configure safeecho Output

To override the default configuration of safeecho, you will need a configuration file., (*7)

Accepted file names are: safeecho.ini safeecho.json safeecho.php safeecho.xml safeecho.yaml safeecho.yml, (*8)

Configuration files are searched for in the above order. The first configuration file found, is the configuration that is used., (*9)

The recommended location for the configuration is the project root directory., (*10)

Example YML Configurations

safeecho.yml, (*11)

decorator: Linio\SafeEcho\Decorator\MouseHoverDecorator

If you want to change the 'hideChar', (*12)

safeecho.yml, (*13)

decorator: Linio\SafeEcho\Decorator\MouseHoverDecorator
hideChar: '~'

safeecho('John Smith') will now print <span style="cursor: pointer;" onmouseout="this.innerHTML='J~~~ S~~~~'" onmouseover="this.innerHTML='John Smith'">J~~~ S~~~~</span>, (*14)

To use your own custom Decorator: * YourCustomDecorator must extend SafeEchoDecorator, (*15)

safeecho.yml, (*16)

decorator:
    class: \Path\To\YourCustomDecorator
    arguments:
        arg1: arg1Value
        arg2: arg2Value

Please see safeecho Configuration File for configuration file examples., (*17)

Testing

$ vendor/bin/phpunit

License

The MIT License (MIT). Please see License File for more information., (*18)

The Versions

20/07 2018

dev-master

9999999-dev

Lightweight function to easily hide printed data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Melissa Billias

password encrypt echo secure print linio safeecho safe echo safe print

28/06 2018

dev-dependabot/composer/hassankhan/config-tw-0.10.0|tw-1.0.0

dev-dependabot/composer/hassankhan/config-tw-0.10.0|tw-1.0.0

Lightweight function to easily hide printed data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Melissa Billias

password encrypt echo secure print linio safeecho safe echo safe print

28/06 2018

dev-dependabot/composer/phpunit/phpunit-tw-6.0|tw-7.0

dev-dependabot/composer/phpunit/phpunit-tw-6.0|tw-7.0

Lightweight function to easily hide printed data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Melissa Billias

password encrypt echo secure print linio safeecho safe echo safe print

25/07 2017

dev-bugfix/throw-exception-not-error

dev-bugfix/throw-exception-not-error

Lightweight function to easily hide printed data.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Melissa Billias

password encrypt echo secure print linio safeecho safe echo safe print

01/12 2016

dev-safeecho-php56

dev-safeecho-php56

  Sources   Download

MIT

The Requires

 

The Development Requires

by Melissa Billias

password encrypt echo secure print linio safeecho safe echo safe print