[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] New PHP bindings



On Nov 3, 2010, at 3:57 AM, jclift redhat com wrote:
On 03/11/2010, at 1:53 PM, Arnar Mar Sig <antab antab is> wrote:
On Nov 3, 2010, at 2:40 AM, jclift redhat com wrote:
<snip>
It's probably also going to make things uncomfortable for packagers (ie for Fedora and similar). They'll need to rename one of the packages to not have the same name as the other.
Yeah, on second though it might not have been the best thing, but it started out as a little test and never though much about the name.

Heh, I completely understand trying things out and seeing how they go. :)

Don't get me wrong, I think this is good effort, and worth taking forwards.  But, (and it's a big one) I *really* *really* want us to have just one _very good_ PHP library for libvirt if at all possible, rather than a number of competing ones that each do their piece ok.
It was not my intention to compete with Redek's work, but more to provide an alternative OO based extension.


It can make it a bit harder up front, after you've got the general experimentation bit done to see if the idea is sound (which you're doing :>).  But it's _generally_ the right approach if people can work together well.  

Radek, who is working on the PHP libvirt bindings we already link to, has a good attitude, is responsive, and is also putting a good amount of time into PHP bindings.  Other people are submitting patches and testing things out too.

It would be great if you guys could work together on getting your OO approach added in (please!)  OO is so much nicer than procedural when a person gets the hang of it. :)
I first looked at Redek's extension and its not bad, but i thought it would be too much work to extend it to support OO and instead opted to write one from scratch and generate most of the code. The codegen part saved me alot of time and as a proof of concept I changed it to generate procedural style interface also, so:
$vir = new virConnect('test:///' . $test_def);
$dom = virConnectDomainLookupByName($vir, 'fv0');
var_dump(virDomainGetName($dom));

is the same as:
$vir = new virConnect('test:///' . $test_def);
$dom = $vir->domainLookupByName('fv0');
var_dump($dom->getName());

This applies to all functions and the code for this is now in the svn repo (but not the tarball)
Will take a little more work to add virConnectOpen(..) and fix virConnectDomainLookupBy* => virDomainLookupBy*, as i renamed them to go under virConnect.

 

Its the default from php docgen script,  haven't done the install/configure part yet, just the methods to get something to help people get started.
The build insturctions are in the README file at the moment.

Cool.  I won't try them out personally (other priorities atm), but others probably will. :)

Arnar Mar Sig

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]