Skip to content
Snippets Groups Projects
Select Git revision
  • master default
  • feature/3.0
  • bugfix/post-meta-container-has-method
  • feature/single_deferred_persistent_container
  • feature/changed-access-level
  • feature/psr
  • feature/psr-beta-tag
  • 3.0.2
  • 3.0
  • 2.1.4
  • 2.1.3
  • 2.1.2
  • 2.1.1
  • 2.1
  • 2.1-beta2
  • 2.1-beta
  • 2.0-beta
  • 1.0
18 results

wp-persistence

  • Clone with SSH
  • Clone with HTTPS
  • potreb's avatar
    Piotr Po authored
    ffbf9f12
    History

    pipeline status coverage report Latest Stable Version Total Downloads Latest Unstable Version License

    WordPress Library to facilitate access to various persistence possibilities

    Requirements

    PHP 7.0 or later.

    Composer

    You can install the bindings via Composer. Run the following command:

    composer require wpdesk/wp-persistence

    To use the bindings, use Composer's autoload:

    require_once 'vendor/autoload.php';

    Compatiblity between plugins

    To ensure that always the latest and valid version of composer libraries are loaded in WP env you should use a solution that ensure support between plugins and at least decreases the change that something would break. At the moment we recommend using wpdesk/wp-autoloader.

    Manual instalation

    If you do not wish to use Composer and wpdesk/wp-autoloader, you probably should stop using any existing library as it breaks compatibility between plugins.

    When has() is true and when get() will throw an exception

    Value Get Has
    'test' 'test' true
    [] [] true
    '' '' true
    99 '99' or 99 true
    0 '0' or 0 true
    true true or '1' true
    false false or '' true
    not set exception false
    null exception false