Download the PHP package phrity/util-accessor without Composer

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

Build Status Coverage Status

Introduction

Utility to handle access to a data set by using access paths.

Installation

Install with Composer;

How to use

Basic operation get() and has() methods

Any set of data (including arrays, objects, and scalar values) can be access using a path.

Using default return value for get() method

The get() method can also have default value specified, to be returned when path do not match the data set. If not specified, null will be returned in these cases.

The set() method

The set() method add or replace value in data set as specified by path. Note that this operation do not merge values, but set explicitly.

Depending on scope, it may not be possible to use set() on class properties. In this case an AccessorException will be thrown.

Specifying path separator

By default, path uses / as separator. Optionally, separator can be set in constructor.

The PathAccessor

If multiple data sets should be accessed using the same path, the PathAccessor can be used instead. The path is then specified on constructor, and then used on all calls to get(), has() and set().

The DataAccessor

If a data sets should be accessed using multiple paths, the DataAccessor can be used instead. The data is then specified on constructor, and then used on all calls to get(), has() and set().

I want to incorporate this in my own class

Sure, no problem. Just use the AccessorTrait in your class, and call the available worker methods. The internal, recursive worker methods takes path as an array of path segments. There is also a helper to extract array path from a string path.

Versions

Version PHP
1.1 ^8.0 set() method
1.0 ^7.4\|^8.0 Initial version: get(), has() methods

All versions of util-accessor with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 phrity/util-accessor contains the following files

Loading the files please wait ....