Download the PHP package tag/sudzy without Composer

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

Sudzy Build Status

Breaking change on v0.3: Validations now use respect/validation validation library.

Sudzy implements validarion against model classes using Paris/Idiorm (an active record ORM, often used with Slim), although it could be adapted easily.

Sudzy's ValidModel class decorates Paris' Model class. By extending ValidModel, your model classes gain immediate access to validations.

By default the ValidModel will store validation errors when model properties are set (for an exising model) or a new model is saved, and throw a ValidationException on save if errors were encountered.

Sudzy's ValidModel class uses Respect/Validation as its validation engine. See that project for details.

Installation

The easiest way to install Sudzy is via Composer. Start by creating or adding to your project's composer.json file:

ValidModel Example

The ValidModel class requires you to implement the abstract method #prepareValidations(), in order to lazily load the validations. Thus, constructors will not have the overhead of creating unused validation objects.

Validations can also be added at any time with the #addValidation() method.

The #setValidation() method is passed the model property to watch, and a Respect validation object to be checked against. Multiple calls on the same property overwrite previous validations.

Respect\Validation is namespaced, but you can make your life easier by importing a single class into your context:

When using Respect\Validation, create different validations for each field, instead of a single validator for the entire object.

Full Example

Example model class:

Example controller snip:

Validation Exceptions and Errors

By default, Sudzy's ValidModel does validation checks whenever objects are committed to the database via #save(), but can be configured to throw an exception when properties are set, or not at all.

Because an object can have multiple fields fail, it is necessary to catch and wrap Respect's exceptions.

:TODO:

Validation failures are stored, and available through getValidationErrors(), a method of both the ValidModel object and the thrown ValidationException. An object that fails validation throws a ValidationException when save() is attempted (default behavior). This can be changed to ::ON_SET or ::NEVER by setting the throw option:

Be careful of using ::ON_SET, as Paris' internal set() method is not called when a model is built via Paris' hydrate() or create() methods. Also, ::ON_SET tiggers the validation exception immediately, whereas ::ON_SAVE permits validating all fields before throwing an exception.

Regardless of the value of the throw option, validations are checked when properties are set. In the case of new models (such as one built with Paris methods create() or hydrate()), validations are also checked on save. Regardless of when exceptions are thrown (or not), errors are immediately available through getValidationErrors().


All versions of sudzy with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
j4mie/paris Version >=1.4
respect/validation Version ^1.1
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 tag/sudzy contains the following files

Loading the files please wait ....