定制 skalmi/cakephp-diffbot-datasource 二次开发

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

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

skalmi/cakephp-diffbot-datasource

最新稳定版本:0.0.11

Composer 安装命令:

composer require skalmi/cakephp-diffbot-datasource

包简介

CakePHP DiffbotSource Plugin with DataSource

README 文档

README

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

CakePHP DiffbotSource is DataSource Plugin for Diffbot

Installation

Step 1: Clone or download HttpSource

Step 2: Clone or download to Plugin/DiffbotSource

cd my_cake_app/app git://github.com/skalmi/CakePHP-DiffbotSource-Datasource.git Plugin/DiffbotSource

or if you use git add as submodule:

cd my_cake_app
git submodule add "git://github.com/skalmi/CakePHP-DiffbotSource-Datasource.git" "app/Plugin/DiffbotSource"

then update submodules:

git submodule init
git submodule update

Step 3: Add your configuration to database.php and set it to the model

:: database.php ::
public $diffbot = array(
  'datasource' => 'DiffbotSource.Http/DiffbotSource',
  'host' => 'example.com',
  'port' => 'some port'
);
public $diffbotTest = array(
  'datasource' => 'DiffbotSource.Http/DiffbotSource',
  'host' => 'api.diffbot.com',
  'prefix' => '',
  'port' => 80,
  'timeout' => 5
);

Then make model

:: Diffbot.php ::
public $useDbConfig = 'diffbot';
public $useTable = '<desired endpoint, for ex: "article">';

Step 4: Load plugin

:: bootstrap.php ::
CakePlugin::load('HttpSource', array('bootstrap' => true, 'routes' => true));
CakePlugin::load('DiffbotSource', array('bootstrap' => false, 'routes' => false));

#Tests

To run tests add and fill $diffbotTest in database.php

#Usage

You can use elasticsearch almost as db tables:

$this->Diffbot->setSource('article');
	$params = array(
		'conditions' => array(
			'query' => array(
				"term" => array("title" => "apple")
			)
		),
		'fields' => array('title', 'rank'),
		'order' => array('rank' => 'desc'),
		'offset' => 2
	);

$result = $this->Diffbot->find('first', $params);

#Documentation

Please read HttpSource Plugin README

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固