Source code or REST interface ?

Document created by cdnadmin on Jan 25, 2014
Version 1Show Document
  • View in full screen mode
This document was generated from CDN thread

Created by: Jimmy Cleuren on 25-03-2013 05:56:56 AM
Dear,
 
We have an application written in PHP to manage our network. Is it possible to view the c source code from the onepk library so we can port it to PHP ? Or do you have examples on how to use the REST interface ?

Subject: RE: Source code or REST interface ?
Replied by: Joseph Clarke on 25-03-2013 07:31:43 AM
Unfortunately the source code for the C presentation layer is not available, and the REST API is not yet available.  However, you could create some PHP wrappers for the C onePK API using something like SWIG or PHP extensions.  Here is a pointer to some SWIG documentation that might help you:
 
http://www.swig.org/Doc1.3/Php.html

Subject: RE: Source code or REST interface ?
Replied by: Joseph Clarke on 31-03-2013 03:39:37 PM
Joseph Clarke:
Unfortunately the source code for the C presentation layer is not available, and the REST API is not yet available.  However, you could create some PHP wrappers for the C onePK API using something like SWIG or PHP extensions.  Here is a pointer to some SWIG documentation that might help you:   http://www.swig.org/Doc1.3/Php.html
I tried my hand at creating a basic PHP module using SWIG.  This module gets an interface list.  It works well, and offers a proof of concept of how SWIG can work to get PHP and onePK playing together.  I'm including both the interface file and the C source.  If you run: swig -php onep_interfaces.i Then build the resulting onep_interfaces_wrap.c and onep_interfaces.c with your PHP and onePK APIs plugged in, you'll get a module you can test.

Attachments

Outcomes