vvoleman/zotero-php-wrapper 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

vvoleman/zotero-php-wrapper

Composer 安装命令:

composer require vvoleman/zotero-php-wrapper

包简介

Zotero API wrapper for PHP

README 文档

README

PHP wrapper for citation software Zotero

Features

Object-oriented approach. Since I don't know the full scale of API, I can painlessly add new endpoints and stuffs

Installation

composer require vvoleman/zotero-php-wrapper

Usage

Connect to Zotero

To use Zotero's API, you need to generate API key.

Get API key

Log into your Zotero account and access Feeds/API part of profile settings and click Create new private key.

Next, you can specify what permissions will this API key have. Save your API key, since you won't be able to retrieve it after you leave this page.

Create instance

Hop into your code and create some whooshing wrapper instance.

$api = new ZoteroApi("YOUR_API_KEY",new KeysSource("YOUR_API_KEY"));
$api->run();
$data = $api->getBody();

Let's explain it a bit. ZoteroApi instance requires API key for authentication and source.

Source is main branch from which we want to retrieve our data. So far, there are:

  • UsersSource/GroupSource

    • All your precious collections and items are linked to a user or to group. Working with both them is a same.
    • After you create your UsersSource/GroupSource instance, you set endpoints to them with ZoteroApi::setEndpoint(), which takes as a parameter instance of AbstractEndpoint
      $api = new ZoteroApi($_ENV["API_KEY"], new UsersSource("YOUR_USER_ID"));
      $api->setEndpoint(
          (new Collections("COLLECTION_ID"))
                ->setEndpoint(new Items(AbstractEndpoint::ALL))
      );
    • AbstractEndpoint can chain another AbstractEndpoint - think of it like you can add /items to /collections/ID. However, there are limits to chaining. You can't add /items to /collections - you have to specify specific collection.
    • So, here are possible chainings (not all, but you get the idea):
      • Collections("ID") -> Items(<All options>)
        • Collections("ID") -> Items("ID") -> Tags("ID")
        • Collections("ID") -> Items("ID") -> Tags(AbstractEndpoint::ALL)
    • AbstractEndpoint takes as a constructor parameter a string value that specifies what you want to search
      • AbstractEndpoint::ALL - All results
      • AbstractEndpoint::TOP - Top-level results only
      • AbstractEndpoint::TRASH - Results in trash
      • "ID" - Specific ID of Endpoint

vvoleman/zotero-php-wrapper 适用场景与选型建议

vvoleman/zotero-php-wrapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 36 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 vvoleman/zotero-php-wrapper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 vvoleman/zotero-php-wrapper 我们能提供哪些服务?
定制开发 / 二次开发

基于 vvoleman/zotero-php-wrapper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-27