Download the PHP package milanpasic92/phalcon-repositories without Composer

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

Phalcon Repositories

License Latest Stable Version Latest Unstable Version Build Status

Introduction

Phalcon Repositories lets you easily build repositories for your Phalcon models, for both SQL and Mongo drivers.

PHP 7.1+ and Phalcon 3.2+ are required.

Installation

Phalcon Repositories can be installed through Composer, just run composer require michele-angioni/phalcon-repositories.

Usage with SQL Drivers

The abstract class AbstractRepository consists of a model wrapper with numerous useful queries to be performed over the Phalcon models. This way implementing the repository pattern becomes straightforward.

As an example let's say we have a MyApp\Models\Posts model.

The easiest way to create a Posts repository is to define a class as such

Suppose now we need the Post repository in our PostController. For example we can retrieve a Post this way

We could also bind out repository to the container through the Phalcon dependency injection. We just need to add a new postRepo service in our bootstrap file

and than use it in the controller

Usage with MongoDB

The abstract class AbstractCollectionRepository, similary to AbstractRepository, consists of a model wrapper with numerous useful queries to be performed over the Phalcon collections. This way implementing the repository pattern becomes straightforward.

As an example let's say we have a MyApp\Models\Posts collection

The easiest way to create a Posts repository is to define a class as such

Suppose now we need the Post repository in our PostController. For example we can retrieve a Post this way

We could also bind out repository to the container through the Phalcon dependency injection. We just need to add a new postRepo service in our bootstrap file

and than use it in the controller

Method list

The AbstractRepository and AbstractCollectionRepository empower automatically our repositories of the following public methods:

The AbstractRepository contains also the methods:

while the AbstractCollectionRepository allows for aggregations through:

The $where parameter with SQL drivers

The $where parameter allows the use of various operators with the SQL driver, other than the equals =, even the LIKE keyword.

The following formats are supported:

SQL Injection

The AbstractRepository and AbstractCollectionRepository use bind parameters for all $id and $where clauses. $inputs parameters in create and update queries are automatically escaped by Phalcon.

The security of the other parameters ($whereInKey, $whereIn, $orderBy, $order, $limit etc.) is up to you.

Testing

Install dependencies with composer install and then run vendor/bin/phpunit tests.

Contribution guidelines

Phalcon Repositories follows PSR-1, PSR-2 and PSR-4 PHP coding standards, and semantic versioning.

Pull requests are welcome.

License

Phalcon Repositories is free software distributed under the terms of the MIT license.


All versions of phalcon-repositories with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-phalcon Version ^3.2
phalcon/incubator Version ^3.2
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 milanpasic92/phalcon-repositories contains the following files

Loading the files please wait ....