Download the PHP package webiny/std-lib without Composer

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

StdLib

The standard library is a set of core Webiny framework components that make coding a bit more pleasurable when working with some low level objects like strings, array, date time and url.

Install the component

The best way to install the component is using Composer.

For additional versions of the package, visit the Packagist page.

About

The standard library consists of following libraries:

.. and following helper traits:

ComponentTrait

This trait is used when creating a new Webiny Framework component. By implementing this trait you automatically get the possibility to register the required class loader libraries, services and additional parameters for your new component. The trait is based on two main methods setConfig and getConfig, both methods are defined as public static.

Here is an example Webiny Framework component that uses the ComponentTrait.

The ExampleConfig.yaml file is defined like this:

There are couple of things you should notice:

So basically as you see, the ComponentTrait does a lot of handy stuff and makes Webiny Framework components very neatly organised.

Callback

If you want to know when the configuration file on your class has been parsed, and all the services and class loader paths have been assigned, you can just define a protected static function _postSetConfig inside your component class, and the ComponentTrait will automatically call it each time you define a configuration for that class.

FactoryLoaderTrait

A handy trait when you want to load some classes where the class name is defined as a string or inside a variable and you want to pass along some parameters to the constructor. You can also pass a interface or a class name that the factory class must implement/extend. This trait will first construct the object, with the given parameters, and then it will verify its instance against the given interface or a class. If everything matches, the class instance is returned, otherwise, and Exception is thrown.

SingletonTrait

The SingletonTrait is used on classes that must implement singleton pattern. You just use the trait on the class you want to be singleton, and that's it.

There are two methods that you can optionally implement in your class, public function init() and protected function _init(), they are called only once and at the moment when you request a singleton instance.

To use your class you just call the static getInstance method that is implemented by the trait.

StdLibTrait

Also a helper trait with some commonly used functions. The trait itself only supports a limited number of methods, but we plan to expand it with more, so feel free to give suggestions.

This trait, not only that it defines helper methods, but it also uses ValidatorTrait and StdObjectTrait traits.

StdObjectTrait

This trait provides helper functions when working with StdObject library.

ValidatorTrait

This is a helper trait with some common validation methods like isNull, isEmpty, isInstanceOf and many more. Just view the class, all the methods are documented and, mostly self-explanatory.

Resources

To run unit tests, you need to use the following command:

$ cd path/to/Webiny/Component/StdLib/
$ composer.phar install
$ phpunit

All versions of std-lib with dependencies

PHP Build Version
Package Version
Requires php Version ^7
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 webiny/std-lib contains the following files

Loading the files please wait ....