academicpuma/citeproc-php
最新稳定版本:1.0.0
Composer 安装命令:
composer require academicpuma/citeproc-php
包简介
This is an effort to implement a full-featured standalone CSL processor in PHP. The code based on the implementation of Ron Jerome.
README 文档
README
Description
This is an effort to implement a standalone CSL processor in PHP. This program can be used to render bibliographies using CSL Stylesheets. This repository is a fork of the implementation of rjerome (apparently no longer maintained).
Some advantages:
- uses Composer
- each class is located in a separate file
- uses namespaces
- uses the autoloader of Composer
- uses PHPUnit for testing
Installing citeproc-php using Composer
Use Composer to add citeproc-php to your app:
$ composer require academicpuma/citeproc-php
How to use citeproc-php
<?php
include 'vendor/autoload.php';
use \AcademicPuma\CiteProc\CiteProc;
$bibliographyStyleName = 'apa';
$lang = "en-US";
$csl = CiteProc::loadStyleSheet($bibliographyStyleName); // xml code of your csl stylesheet
$citeProc = new CiteProc($csl, $lang);
// $data is a JSON encoded string
echo $citeProc->render(json_decode($data));
?>
Setup a workspace
$ cd /path/to/your/php/workspace
$ hg clone https://seboettg@bitbucket.org/seboettg/citeproc-php
$ composer install
You can setup your apache to see the test results on a webpage. Therefor you can configure your apache with an custom virtual host:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName citeproc.local
DocumentRoot /path/to/your/php/workspace/citeproc-php/tests
ErrorLog "/var/log/apache2/citeproc.error.log"
CustomLog "/var/log/apache2/citeproc.access.log" common
<Directory /path/to/your/php/workspace/citeproc-php/tests>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Replace '/path/to/your/php/workspace/' with your path and replace 'citeproc.local' with your favourite host name.
If you want to use your own host address don't forget to append them to /etc/hosts:
127.0.0.1 citeproc.local localhost
Restart your apache
$ sudo apachectl restart
or
$ sudo /etc/init.d/apache2 restart
Open your browser and enter your chosen host address, as soon as apache has finished.
Known packages using citeproc-php
- lib-php-kar (GitHub)
- BibSonomy restclient-php (BitBucket)
academicpuma/citeproc-php 适用场景与选型建议
academicpuma/citeproc-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 376.28k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 academicpuma/citeproc-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 academicpuma/citeproc-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 376.28k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 20
- 依赖项目数: 2
- 推荐数: 1
其他信息
- 授权协议: GPL
- 更新时间: 2026-01-04