定制 inigo-aldama/inmovilla-api-proxy-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

inigo-aldama/inmovilla-api-proxy-bundle

最新稳定版本:1.0.2

Composer 安装命令:

composer require inigo-aldama/inmovilla-api-proxy-bundle

包简介

A Symfony bundle to proxy Inmovilla API requests, handling IP-based access restrictions.

README 文档

README

Latest Version PHP Symfony License

The inmovilla-api-proxy-bundle is a Symfony bundle designed to act as a proxy for Inmovilla API requests, addressing IP-based access restrictions. It simplifies the setup and configuration for integrating the inmovilla-api-proxy and inmovilla-api-client libraries in Symfony applications.

Features

  • Seamless integration with inmovilla-api-proxy.
  • Handles IP-based access restrictions for Inmovilla API.
  • Pre-configured Symfony services for easier implementation.
  • Compatible with Symfony 5.4 and 6.x.

Requirements

  • PHP: 7.4 or higher.
  • Symfony: 5.4 or higher.
  • Composer: For dependency management.

Installation

Install the bundle using Composer:

composer require inigo-aldama/inmovilla-api-proxy-bundle

Configuration

This bundle don't require extra configuration.
Follow instructions of inmovilla-api-client-bundle to configure the api client. This configuration will automatically create a service for the proxy that can be injected into your Symfony controllers or services.

Usage

Injecting the Proxy Service

You can inject the proxy service directly into your controllers or services:

namespace App\Controller;

use Inmovilla\ApiProxyBundle\Service\ProxyService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class ProxyController extends AbstractController
{
    private ProxyService $proxyService;

    public function __construct(ProxyService $proxyService)
    {
        $this->proxyService = $proxyService;
    }

    public function fetchProperties()
    {
        $response = $this->proxyService->handleRequest([
            'endpoint' => '/properties',
            'method' => 'GET',
            'parameters' => [],
        ]);

        return $this->json($response);
    }
}

Testing

Run PHPUnit tests to validate the functionality:

./vendor/bin/phpunit --testdox

Contribution

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/new-feature).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to your branch (git push origin feature/new-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License.

Credits

统计信息

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

GitHub 信息

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

其他信息

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