Download the PHP package batenburg/cache-bundle without Composer

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

Caching Bundle

Caching for the Symfony Framework.

Build Status: Build Status

What is Caching Bundle?

The caching bundle is an repository around the Symfony Cache. Its purpose is to simplify usage of Symfony Cache.

For who?

This bundle is recommended for Microservices, Domain Driven Development or the Repository Design Pattern. This bundle is not developed for usage with Doctrine ORM.

Installation

Install with composer:

Register the bundle, add the following line to config/bundles.php:

Usage

After the installation is completed, the CacheRepositoryInterface can be resolved by dependency injection. Or through the container. It is highly recommended to use dependency injection.

An example::

<?php

namespace App\Product\Repository;

use Batenburg\CacheBundle\Repository\Contract\CacheRepositoryInterface;
use App\Product\Model\Brand;
use App\Product\Repository\Contract\BrandRepositoryInterface;

class BrandCacheRepository implements BrandRepositoryInterface
{

    const EXPIRES_AFTER_IN_SECONDS = 3600;

    /**
     * @var CacheRepositoryInterface
     */
    private $cacheRepository;

    /**
     * @var BrandRepositoryInterface
     */
    private $brandRepository;

    /**
     * @param CacheRepositoryInterface $cacheRepository
     * @param BrandRepositoryInterface $brandRepository
     */
    public function __construct(CacheRepositoryInterface $cacheRepository, BrandRepositoryInterface $brandRepository)
    {
        $this->cacheRepository = $cacheRepository;
        $this->brandRepository = $brandRepository;
    }

    /**
     * @param int $id
     * @return Brand|null
     */
    public function findById(int $id): ?Brand
    {
        $item = $this->cacheRepository->rememberItem(
            "brands.{$id}",
            [$this->brandRepository, 'findById'],
            self::EXPIRES_AFTER_IN_SECONDS,
            $id
        );

        return $item->get();
    }

    /**
     * @return Brand[]
     */
    public function findAll(): array
    {
        $item = $this->cacheRepository->rememberItem(
            "brands.all",
            [$this->brandRepository, 'findAll'],
            self::EXPIRES_AFTER_IN_SECONDS
        );

        return $item->get();
    }
}

License

The Caching Bundle is open-sourced software licensed under the MIT license.


All versions of cache-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.2.0
symfony/cache Version ^4.3 || ^4.4 || ^5.0 || ^5.1 || ^5.2
symfony/dependency-injection Version ^4.3 || ^4.4 || ^5.0 || ^5.1 || ^5.2
symfony/framework-bundle Version ^4.3 || ^4.4 || ^5.0 || ^5.1 || ^5.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 batenburg/cache-bundle contains the following files

Loading the files please wait ....