承接 ochi51/cybozu-http-bundle 相关项目开发

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

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

ochi51/cybozu-http-bundle

最新稳定版本:1.0.0

Composer 安装命令:

composer require ochi51/cybozu-http-bundle

包简介

Symfony2 HTTP client bundle for cybozu.com API (kintone API and User API)

README 文档

README

Circle CI Scrutinizer Code Quality Code Coverage Build Status

Symfony bundle that integrates the Cybozu HTTP by providing easy-to-use services and configuration.

cybozu.com API Documentation

Japanese English

Requirements

  • PHP >=5.5
  • Composer
  • Symfony >=3.1

Installation

The recommended way to install Cybozu HTTP is with Composer. Composer is a dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project.

    $ curl -sS https://getcomposer.org/installer | php
    $ mv composer.phar /usr/local/bin/composer

You can add Cybozu HTTP as a dependency using the composer

    $ composer require ochi51/cybozu-http-bundle

Alternatively, you can specify Cybozu HTTP as a dependency in your project's existing composer.json file:

    {
       "require": {
          "ochi51/cybozu-http-bundle": "^1.0"
       }
    }

After installing, you need to register the bundle in your application.

    // app/AppKernel.php
    class AppKernel extends Kernel
    {
        // ...
        public function registerBundles()
        {
            $bundles = array(
                // ...
                new CybozuHttpBundle\CybozuHttpBundle()
            );
        }
    }

Configuration

There are two ways that configure cybozu.com account information.

  1. User entity has it.
    # app/config.yml
    cybozu_http:
        cert_dir:       /path/to/cert_dir
        logfile:        /path/to/logfile.log
    use CybozuHttpBundle\Entity\UserInterface;
    
    class User implements UserInterface
    {
        public function getCybozuHttpConfig()
        {
            return [
                "domain" =>         "cybozu.com",
                "subdomain" =>      "changeMe",
                "use_api_token" =>    false,
                "login" =>          "changeMe",
                "password" =>       "changeMe",
                "token" =>          null,
                "use_basic" =>       false,
                "basic_login" =>     null,
                "basic_password" =>  null,
                "use_client_cert" =>  false,
                "cert_file" =>       "cert.pem",
                "cert_password" =>   null
            ];
        }
        
        public function getDebugMode()
        {
            return true;
        }
    }

Quick example

    <?php
    // AppBundle\Controller\MyCybozuHttpController
    
    public function getRecordAction($appId, $recordId)
    {
        $api = $this->get('cybozu_http.kintone_api_client');
        $record = $api->record()->get($appId, $recordId);
        // do something
    }

Testing

To run the tests, Run the following command from the project folder.

    $ php ./bin/phpunit

TODO

  • Japanese documentation.

License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-10-04