Download the PHP package guillermoandrae/php-repository without Composer

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

PHP Repository Library

Travis Scrutinizer Scrutinizer Coverage Your Mom Approves

I use a simple implementation of the Repository pattern. Often. I've been copying and pasting the same code between projects for longer than I care to admit; I came to my senses recently, and that's why this project now exists.

Installation

Do this, then relax:

Usage

Before you do anything crazy, read up on the Repository pattern. If, after reading that, you decide you still want to move forward: keep reading.

Naming Classes

Your classes should be named according to their data type. For example, if you're dealing with widgets, your repository should be named WidgetsRepository and your model should be named WidgetModel. Note that the data type in the repository name is pluralized and singular in the model name.

Define the Namespace

By default, the RepositoryFactory class will look for repositories in the App\Repositories namespace. If you don't plan on using that namespace, you'll need to tell the factory where your repositories live. Use RepositoryFactory::setNamespace() to do that, like so:

Creating Repositories

Leveraging the repository functionality is as easy as writing the following:

There are a few methods you need to implement in the classes that inherit from the AbstractRepository class. Check out the AbstractRepository classes for the most up-to-date list.

Creating Models

Creating models is straightforward:

I generally build immutable models, but how you use them is entirely up to you.

Testing

Run the following command to make sure you don't ruin the code coverage percentage:

Run the following command to make sure your code is appropriately styled:

Run the following command to invoke both of the above commands easily:


All versions of php-repository with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
icanboogie/inflector Version ^2.0
guillermoandrae/php-collection Version ^2.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 guillermoandrae/php-repository contains the following files

Loading the files please wait ....