Download the PHP package smhdhsn/zed without Composer

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

About

ZED is an API-Based Micro-Framework powered by PHP.

Features

Getting started

Make sure you have composer installed in your machine and then create a new ZED project using composer:

After the application has been created, you may start ZED's local development server using command line:

You can provide a custom port to serve on like the following:

Documentation

Routing

Defining routes

You can choose between three options for defining a route for your application.

Via closure

Via string

Via array

Middleware

You can implement a middleware to a route like the following.

:information_source: You need to list the method name that is responsible for your middleware inside the array.

Protecting routes

As I mentioned before, you can provide middleware within an array as the third parameter to the route.

:information_source: The auth middleware is powered by JWT and is responsible for protecting routes from unauthenticated requests.

Route params

You may wish to pass your route parameters to your application. You may do so like the following.

:information_source: In your controller or closure you'll receive Request object as your first parameter.

Request

Request object contains every parameter passed to the application, whether it's from request body or query string, you can access request params like following:

Request validation

You can validate your request and in case of any errors show a proper error message.

Available validation rules

Required

The field under this rule is required and must be provided to the application.

String

The field under this rule must be a valid string.

Numeric

The field under this rule must be a valid numeric string.

Email

The field under this rule must be a valid email.

Maximum

The field under this rule must contain less characters than given value.

Minimum

The field under this rule must contain more characters than given value.

Unique

The field under this rule must be unique in the database, you have to provide the column you wish to check for uniqueness of the request attribute after table name.

In this case, application will look through users table on database and checks if column email exists with the same value or not.

Response

The only available response type is JSON, for the sake of consistency of response properties you may use Controller's response() method. This method accepts 3 parameters: Response word, Response data, Response HTTP-code.

You may want to check out Response class, there's plenty of response words and codes there that you can use.

Error

In case of possible errors you can also use Controller's error() method:

ORM

ZED Provides some functionalities to interact with the database and perform simple CRUD operations.

Creating

Finding

You have 2 choices, whether you can find a record with where clause or you can find the record by their unique id.

Where clause

Returns a collection of objects, returns an empty collection if there's no matching record.

Find method

Returns an object of type model, throws a NotFoundException if there's no matching record.

Updating

Deleting

Command

ZED also provides a way to interact with the application via the command line. You can create your own command with the command below:

This command will create your command in path App/Commands.

After creating the command you need to address it to the application inside Routes/command file like the following:

You can also provide a closure as the second parameter to the define method to handle your command's action:

:information_source: Every parameter after the command name can be accessed within the command's class or closure.

Inside command.php file:

Also, the class CommandLineInterface includes massive command-line options for you to take advantage of like cli color, background, font, etc...

Predefined commands

Migrate

This command handles migration operations

Running migrations:

Rolling back migration:

Resetting all migrations:

Resetting and then running all migrations again:

Make

This command is responsible for creating classes within the application to save time.

Creating a new controller:

Creating a new model:

Creating a new repository:

Creating a new service:

Creating new migration:

Creating new command:

License

The ZED micro-framework is open-sourced software licensed under the MIT license.


All versions of zed with dependencies

PHP Build Version
Package Version
Requires vlucas/phpdotenv Version ^5.3
smhdhsn/zed-core Version ^1.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 smhdhsn/zed contains the following files

Loading the files please wait ....