# citeproc-php

**URL:** <https://discourse.citationstyles.org/t/citeproc-php/850>\
**Category:** CSL Development\
**Created:** [May 27, 2010, 2:18am UTC](https://discourse.citationstyles.org/t/citeproc-php/850 "2010-05-27T02:18:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerome\_Ron](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jerome\_Ron](https://discourse.citationstyles.org/u/Jerome_Ron)\
**Post date:** [May 27, 2010, 2:18am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/1 "2010-05-27T02:18:54Z")

</div>

FYI, all this talk of development has prompted me to put my somewhat incomplete citeproc-php out there…

[http://bitbucket.org/rjerome/citeproc-php](http://bitbucket.org/rjerome/citeproc-php)

The next version of my Biblio module for Drupal will use similar code for citation formatting.

Ron.

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [May 27, 2010, 3:08am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/2 "2010-05-27T03:08:46Z")

</div>

Nice; great to see!

Bruce

---

<div class="post-metadata">

**Author:** ![panyasan](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@panyasan](https://discourse.citationstyles.org/u/panyasan)\
**Post date:** [May 27, 2010, 7:35am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/3 "2010-05-27T07:35:26Z")

</div>

Very cool, thanks! Having no time doing this myself, I have been waiting for  
a PHP implementation literally for years. I have experimented with creating  
a bridge between citeproc-hs and PHP:

[https://xbiblio.svn.sourceforge.net/svnroot/xbiblio/citeproc-hs-php/](https://xbiblio.svn.sourceforge.net/svnroot/xbiblio/citeproc-hs-php/)

which, however, had a daunting list of dependencies if you’re not a haskell  
person (even though from what I gather on the list, installation of  
citeproc-hs with bibutils support etc has gotten easier). To be sure, it  
would be interesting to compare performance especially on really large  
bibliographies, and the pandoc support that citeproc-hs offers is very  
powerful.

Are you planning to support the test suite that Frank has been maintaining  
so commendably?

Thanks,

Christian–  
View this message in context: [http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107357.html](http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107357.html)  
Sent from the xbiblio-devel mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![panyasan](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@panyasan](https://discourse.citationstyles.org/u/panyasan)\
**Post date:** [May 27, 2010, 7:48am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/4 "2010-05-27T07:48:40Z")

</div>

While we’re at it: is there any interest at all in the  
"haskell/cabal-for-dummies" citeproc-hs installation script, which is  
meanwhile probably totally outdated:

[https://xbiblio.svn.sourceforge.net/svnroot/xbiblio/citeproc-hs-php/trunk/bin/install.sh](https://xbiblio.svn.sourceforge.net/svnroot/xbiblio/citeproc-hs-php/trunk/bin/install.sh)

or am I the only one who needed something like that? Because if yes, I would  
like to ask Andrea if he could have a look and tell me what can be thrown  
out or needs to be updated.

BTW, I think it would be good to update the page

[http://citationstyles.org/citation-style-language/csl-processors/](http://citationstyles.org/citation-style-language/csl-processors/)

with some more detailed information what the state of development of the  
implementations is (in particular, how complete their support of the spec  
is. I couldn’t open the page [http://code.haskell.org/citeproc-hs/](http://code.haskell.org/citeproc-hs/) but that  
might just be my connection here.

Thanks,  
Christian–  
View this message in context: [http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107387.html](http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107387.html)  
Sent from the xbiblio-devel mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Andrea\_Rossato1](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@Andrea\_Rossato1](https://discourse.citationstyles.org/u/Andrea_Rossato1)\
**Post date:** [May 27, 2010, 9:44am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/5 "2010-05-27T09:44:54Z")

</div>

> While we’re at it: is there any interest at all in the  
> “haskell/cabal-for-dummies” citeproc-hs installation script, which is  
> meanwhile probably totally outdated:
> 
> [XBib download | SourceForge.net](https://xbiblio.svn.sourceforge.net/svnroot/xbiblio/citeproc-hs-php/trunk/bin/install.sh)
> 
> or am I the only one who needed something like that? Because if yes, I would  
> like to ask Andrea if he could have a look and tell me what can be thrown  
> out or needs to be updated.

I’m addressing the dependency problem and I think I was able to remove  
the most difficult ones:

- HXT has gone: by default citeproc-hs only needs xml, a very simple  
xml library;

- hs-bibutils does not require installing bibutils any longer and  
should be easily installed with “cabal install” (this will be a  
dependency activated by default in the next citeproc-hs release).

- I added the JSON dependency. Moreover something to retrieve styles  
from on-line repositories will be needed, but I plan not to extend  
the pandoc dependencies

While I did not do any test citeproc-hs should be easily installable  
with the Haskell platform installed and a simple “cabal install”  
command.

In other words, I hope to make your script obsolete and greatly  
simplify the installation process with the next release.

I also have an idea… I could write C bindings to citeproc-hs (it  
should not be that difficult, actually: Haskell foreign function  
interface is very easy and powerful). This way, writing PHP bindings  
to the C bindings could be trivial (BTW, this is not science-fiction:  
someone was distributing C bindings to pandoc…).

> I couldn’t open the page [http://code.haskell.org/citeproc-hs/](http://code.haskell.org/citeproc-hs/) but that  
> might just be my connection here.

That should just be a momentary problem ([haskell.org](http://haskell.org) connectivity is  
donated … and sometime you need to be patient).

Andrea

---

<div class="post-metadata">

**Author:** ![panyasan](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@panyasan](https://discourse.citationstyles.org/u/panyasan)\
**Post date:** [May 27, 2010, 10:11am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/6 "2010-05-27T10:11:58Z")

</div>

Andrea Rossato wrote:

> In other words, I hope to make your script obsolete and greatly  
> simplify the installation process with the next release.

That would be so wonderful! I’d really appreciate.

Andrea Rossato wrote:

> I also have an idea… I could write C bindings to citeproc-hs (it  
> should not be that difficult, actually: Haskell foreign function  
> interface is very easy and powerful). This way, writing PHP bindings  
> to the C bindings could be trivial (BTW, this is not science-fiction:  
> someone was distributing C bindings to pandoc…).

This would be even better! Unfortunately, however, I couldn’t be of help  
here because I am not a C programmer and could not create the PHP extension  
that would be necessary. I am sure, though, that this would be very popular  
and would extend the citeproc-hs user base considerably. One could also  
think of writing bindings to python, then.

Thanks,  
Christian–  
View this message in context: [http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107857.html](http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107857.html)  
Sent from the xbiblio-devel mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [May 27, 2010, 10:12am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/7 "2010-05-27T10:12:16Z")

</div>

> Very cool, thanks! Having no time doing this myself, I have been waiting for  
> a PHP implementation literally for years. I have experimented with creating  
> a bridge between citeproc-hs and PHP:
> 
> [XBib download | SourceForge.net](https://xbiblio.svn.sourceforge.net/svnroot/xbiblio/citeproc-hs-php/)
> 
> which, however, had a daunting list of dependencies if you’re not a haskell  
> person (even though from what I gather on the list, installation of  
> citeproc-hs with bibutils support etc has gotten easier). To be sure, it  
> would be interesting to compare performance especially on really large  
> bibliographies, and the pandoc support that citeproc-hs offers is very  
> powerful.

For performance tests with citeproc-js, the JS engine used will make a  
lot of difference. So far, the code has been run in the test bed  
under Rhino, Spidermonkey and Tracemonkey, with Rhino the slowest  
performer, Tracemonkey the fastests, and Spidermonkey somewhere in  
between. In-browser the code has been run on webkit and v8 as well,  
with v8 apparently the fastest of the lot.

It’s just a guess, but the fastest run times for citeproc-js would  
probably come from running it under nodejs, with libxmljs for XML  
parsing. Setting that up is beyond my ken, but with the xmldom.js  
module now available in citeproc-js, presumably someone will  
eventually get around to doing it.

Would be very interesting to see what the performance gap between  
citeproc-js and citeproc-hs looks like with very large data sets.

---

<div class="post-metadata">

**Author:** ![panyasan](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@panyasan](https://discourse.citationstyles.org/u/panyasan)\
**Post date:** [May 27, 2010, 10:28am UTC](https://discourse.citationstyles.org/t/citeproc-php/850/8 "2010-05-27T10:28:58Z")

</div>

Frank Bennett-3 wrote:

> Would be very interesting to see what the performance gap between  
> citeproc-js and citeproc-hs looks like with very large data sets.

Yes, it will be nice once we have a set of alternative, easy-to-install  
server-side citeproc implementations that we can compare with each other.  
The key point, for me, is the “easy-to-install”. The more dependencies are  
involved, the more deterring it is for people to use. For example, seen from  
PHP, having to install a Java VM to run a javascript program, which then has  
to be called through the command line is a huge problem. node.js is a step  
in the right direction, but, from scripting languages such as PHP and Python  
you will prefer to call C executables or libraries if you don’t have a fast  
native implementation…

It is certainly great to see things move forward on the server side! Thanks  
for all the work involved.

Christian–  
View this message in context: [http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107917.html](http://xbiblio-devel.2463403.n2.nabble.com/citeproc-php-tp5106642p5107917.html)  
Sent from the xbiblio-devel mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Jerome\_Ron](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jerome\_Ron](https://discourse.citationstyles.org/u/Jerome_Ron)\
**Post date:** [May 27, 2010, 12:20pm UTC](https://discourse.citationstyles.org/t/citeproc-php/850/9 "2010-05-27T12:20:58Z")

</div>

> Very cool, thanks! Having no time doing this myself, I have been waiting for  
> a PHP implementation literally for years. I have experimented with creating  
> a bridge between citeproc-hs and PHP:

Your welcome, I had been waiting also, but finaly decided to roll up my sleaves and dig in.

> Are you planning to support the test suite that Frank has been maintaining  
> so commendably?

Yes, it works with Franks tests and I will upload a test suite shortly. I had another inquiry regarding citeproc-php, so I wanted to (at least) get the base code out in the wild.

Ron.
