承接 babeuloula/cloud-image-proxy 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

babeuloula/cloud-image-proxy

最新稳定版本:0.6.1

Composer 安装命令:

composer require babeuloula/cloud-image-proxy

包简介

A proxy between your application and CloudImage

README 文档

README

CloudImage Proxy is a Symfony bundle for linking your application to Cloud Image.

Cloud Image is a service that lets you resize and apply filters to your images, but it's also a CDN. It will therefore accelerate the loading of your assets (images or resources).

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

composer require babeuloula/cloud-image-proxy

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    BaBeuloula\CloudImageProxy\CloudImageProxyBundle::class => ['all' => true],
];

Step 3: Configure the Bundle

# config/packages/cloud_image_proxy.yaml

cloud_image_proxy:
    proxy:
        assets_path: 'mandatory'
        url: 'mandatory'
        check_assets: true # if the bundle need to check if you have the file on the server before fetch from CloudImage
        encrypted_parameters: false # if you need to hide the query parameters on your application
    encrypter:
        secret_key: null # the key encrypting and decrypting the query parameters (required if proxy.encrypted_parameters is true)
    twig:
        route_name: 'mandatory' # the route to the controller that displays the assets
        route_parameter: 'mandatory' # the route parameter name

Using a fallback handler

If you don't have access to CloudImage or if you want to use it on local development, you can set up a fallback handler.

Actually, I only support Intervention Image v3.

Intervention\Image\Drivers\Imagick\Driver: ~

BaBeuloula\CloudImageProxy\FallbackHandler\InterventionImageFallbackHandler:
    arguments:
        $assetsPath: '_your_path_'
        $driver: '@Intervention\Image\Drivers\Imagick\Driver'
        $cache: '_your_cache_instance_'

BaBeuloula\CloudImageProxy\FallbackHandler\FallbackHandlerInterface: '@BaBeuloula\CloudImageProxy\FallbackHandler\InterventionImageFallbackHandler'

Contributing

Build and install dependencies

You can use the existing docker stack with the command make install to build the Dockerfile and install the composer dependencies.

If you want to execute some commands through Docker, just use docker/exec your_command.

Run testing stack

# Run all tests
make check

# Execute PHPCS
make lint

# Execute PHPCS fixer
make fixer

# Execute PHPStan
make analyse

统计信息

  • 总下载量: 59
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-20