Download the PHP package jshannon63/jsoncollect without Composer

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

Build Status StyleCI

Supercharge your JSON using collections in PHP

The JsonCollect package allows you to surround your JSON objects with the power of collection methods. Making it easy to traverse your data with methods like each(), pluck(), where(), tap(), reduce(), search(), filter(), map(), transform() and many others.

Framework Agnostic.

100% PHPUnit Test Coverage.

Heavily dependent on tightenco/collect, Matt Stauffer's split of Laravel's Illuminate Collections.

See the Laravel documentation here for more on available methods and usage.

Additionally, this package provides customized getters and setters for accessing keyed data elements. Described in more detail below.

Installation

if installing in the Laravel framework, JsonCollect will depend on the frameworks copy of Illuminate Collections and tightenco/collect will not be required.

Usage

Supply your data to the JsonCollect constructor. The form of your data can be a JSON String, a stdClass object or an Array. JsonCollect will recursively dive into the deepest depths of your JSON tree and convert everything to collections.

Injecting your JSON

Note: You can set the recursion depth of JsonCollect by supplying the optional second constructor argument $depth. Default value is 512.

Working with your JSON collection

JsonCollect provides custom getter and setter methods for your data. Simply call the methods "get" or "set" with the key name appended to the method name to access your data directly to retrieve or to create/update.

As mentioned earlier, you should visit the Laravel documentation here for more on the "~100 available methods" and their usage.

Some fun examples:

Starting from scratch with an empty JsonCollect object

It is not necessary to provide data to JsonCollect if your goal is to build a new collection of JSON data. Simply "new up" an instance of JsonCollect and begin adding data. Notice how we use ArrayAccess to simplify our code, and to show flexibility we used the custom getter to retrieve the address collection for setting the city.

Which generates the following output from the die-and-dump.

Exporting your JSON when needed

The following export() method will return a complete JSON string representation of your collection's data. Note that export will accept the standard json_encode options.

Based on the previous example, this is what we would expect to see from our export.

Contributing

If you would like to contribute refer to CONTRIBUTING.md


All versions of jsoncollect with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
tightenco/collect Version ^5.5
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 jshannon63/jsoncollect contains the following files

Loading the files please wait ....