Download the PHP package endermanbugzjfc/configstruct without Composer

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

Gave up maintenance (不羈放縱愛自由)

Use https://github.com/sylvrs/libMarshal instead.

ConfigStruct

Type and shape system for arrays. Help write clearer code when implementing configs for your PocketMine-MP plugin or composer project.

It also generates more human-readable errors when something is wrong with the data. Encouraging and guiding the user (especially some PocketMine-MP server owners) to read the error and fix their mess.

https://github.com/Sandertv/Marshal is an alternative that supports lower versions of PHP. However, it is not as bloat feature-rich as this library.

The section that everyone is looking for

Installation

Via Composer:

Via PocketMine-MP virion infection: https://poggit.pmmp.io/v.dl/Endermanbugzjfc/ConfigStruct/ConfigStruct/%5E2.0.0

Preview

Parse errors

Notice there is a trailing line break.

Developer guide

Parsing data

$dataFilePath will be displayed in error messages if there is any.

The errors will be wrapped and thrown with a ParseErrorsWrapper when calling copyToObject(). Although it is recommended to catch it, you can yet ignore it. Because the errors can still be displayed well in a PHP uncaught error message.

You may use Parse::objectByReflection() if you don't have an object but instead, its ReflectionClass instance. And use $context->copyToNewObject() to copy the parsed data to a new object.

Customising error message

Changing the root header label

/Users/Shoghi/Documents/shog chips.yml is the root header label in the following errors tree:

You can change it in the first argument of ParseErrorsWrapper::regenerateErrorMessage():

Changing the indentation

You can change it in the second argument of ParseErrorsWrapper::regenerateErrorMessage()

Filtering errors

You can hide certain errors from the errors tree by filtering them out. Apply an error filter with the third argument of ParseErrorsWrapper::regenerateErrorMessage():

This filters out all the TypeMismatchError. Although $parseError->getErrorsTree() will still have them, they will not be shown in the error message.

Print the updated error message

Simply throw the parse errors wrapper again. Or you may choose to echo $parseErrorsWrapper->getMessage(). By default, the error message has a trailing line break (\n). You can get an error message without the trailing line break (and other whitespaces) by calling $parseErrorsWrapper->getMessageRtrim() instead.


All versions of configstruct 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 endermanbugzjfc/configstruct contains the following files

Loading the files please wait ....