Hello<div>this is the project details that i will put in my proposal , please tell me what you think.</div><div><br></div><div><div>Project Details </div><div>The project will be composed of two parts: the first one is reimplementing SWIG's PHP backend, and the second one is improving Xapian's PHP API. I have changed the order of the parts to avoid spending a lot of time on the easy part, and not having enough time to finish the second part.</div>
<div>Reimplementing SWIG's PHP backend: </div><div>The current SWIG version seems to support the conversions of the C++ classes to PHP classes. But, in the reality, it doesn’t have a native support for C++ classes, it supports only functions. It simulates C++ classes for PHP by creating a function for every class method and then generating a new PHP file in which it implements the class.</div>
<div>To avoid this unnecessary work, a native class support will need to be implemented for SWIG.</div><div>PHP/Zend C API will be used: PHP/Zend C API is an API that allows using C and C++ functions, variables and the most important for use classes in PHP. Classes made by PHP/Zend C API don’t need a PHP wrapper. So this library is perfect for us. </div>
<div>To use this library, a set of configuration code need to be added to the C or C++ files. This code includes for example each thing that would be accessible in PHP.</div><div>When a file is sent to SWIG, the first thing it does is the prepossessing work. Then, it starts parsing and it creates a tree with all objects. This tree is very important. It could be used to generate the PHP/Zend C API code. This code will be inserted into our file and then if the user compiles the code, he will be able to use it without a wrapper.</div>
<div>Improving Xapian's PHP API:</div><div>This is will be the second part of the project. At that time, I will become familiar with the project and I will code fast.</div><div>The purpose of this part is to make the Xapian API more easy to use for PHP developer. </div>
<div>This includes: </div><div>Creating for example new iterator: the current version of Xapian, the iterator are used as there are C++ iterator and not PHP iterator</div><div>Fixing the integer problem with function that takes float parameter</div>
<div>What is new or different about your approach which hasn't been done or wasn't possible before?</div><div>For the first part, PHP/Zend C API hasn’t been used because its lack of documentation, but now it is. So it’s possible to use it.</div>
<div>For the second part, I think the developers haven’t the time to do that which I have.</div><div>Do you have any preliminary findings or results which suggest that your approach is possible and likely to succeed?</div>
<div>For the first part, I have discussed this detail with same mentors and developers the mailing list and irc channel, and one of them (Olly Betts). I also saw the code of SWIG for PHP, and I think that this will work.</div>
<div>Please note any uncertainties or aspects which depend on further research or investigation.</div><div>For the second part, the list of functions that need to be changed </div><div>How useful will your results be when not everything works out exactly as planned?</div>
<div>The project will be very useful. It will allow saving time not only for Xapian learner (the second part) but also for PHP application that use SWIG. </div><div>Project Timeline</div><div>April 30 - May 20: </div><div>
Checking the Coding guidelines</div><div>Installing Development environment</div><div>Reading and understanding deeply the source of SWIG and wrapped API</div><div>Discussing with mentors about the final details of the project</div>
<div>May 21 - May 29: Defining the changes needed in SWIG</div><div>May 28 – July 7: Using SWIG objects tree to generate the PHP/Zend C API code</div><div>July 8 - July 13: Inserting generated the Code into the files</div>
<div>JULY 13: MID TERM EVALUATION Dead line</div><div>July 13 - July 16: Testing SWIG (including having tests with testsuite)</div><div>July 17- July 19: Writing documentation for SWIG</div><div>July 20- July 26: Defining the change needed for the Xapian PHP API, with the mentors and Xapian users</div>
<div>July 27 - August 5: Improving the Xapian PHP API by changing the code and implementing the new feature into it.</div><div>August 5- August 10: Testing the new version of the Xapian</div><div>August 11- August 13: Writing the documentation for Xapian API</div>
</div><div><br></div><div>I have submitted my proposition</div><div><a href="http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/riadh/14001">http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/riadh/14001</a> </div>
<div>So pleas if you have a comment about it tell me.</div><div><br>Yours sincerely</div><div>Riadh<br><div class="gmail_quote">2012/4/4 riadh chtara <span dir="ltr"><<a href="mailto:riadh.chtara@gmail.com">riadh.chtara@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<div>I'm sorry because what I said has no sence: i didn't know how swig works before.<br><div>I have been reading how swig works <a href="http://www.swig.org/Doc2.0/Extending.html#Extending_nn5" target="_blank">http://www.swig.org/Doc2.0/Extending.html#Extending_nn5</a> and I started understanding.</div>
<div><br></div>
<div>I didn't have the time to read the hole documentation of swig, however I think that the best moment to include use implement the zend api is in the prepossessing: when preprocessor reads the collection of configuration files , we will then translate these config file to zend api code .</div>
<div>In the code generation phase, we will not generate wrapper code since we don't need anymore.</div><div>What do you think please?</div><div><br></div><div>Yours sincerely</div><div><span class="HOEnZb"><font color="#888888">Riadh</font></span><div>
<div class="h5"><br><br><div class="gmail_quote">
2012/4/4 Olly Betts <span dir="ltr"><<a href="mailto:olly@survex.com" target="_blank">olly@survex.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Tue, Apr 03, 2012 at 02:12:56PM +0200, riadh chtara wrote:<br>
> I will take you comment suggestion about timing in consideration.<br>
> What do you thing about this Schedule?<br>
><br>
</div>> 1. April 30 ? May 20 : Checking the Coding guidelines, Installing<br>
<div>> development environment, Reading and understanding deeply the source<br>
> SWIG and wrapped API , Discussing with mentors about the final<br>
> details of the project<br>
</div>> 2. May 21 ? May 29: Defining the changes needed in SWIG<br>
> 3. May 28 - July 13: adding new function to SWIG<br>
<br>
You need much more detail here - that's 6 weeks with a really vague one<br>
phrase description. In mid-June, how can we tell you are doing? Even<br>
on July 13th, how can we tell how you are doing?<br>
<br>
> 4. JULY 13<br>
> 5. MID TERM EVALUATION Dead line<br>
> 6. July 13 ?July 22: adding new function to SWIG, Testing SWIG,<br>
> Writing the documentation for SWIGo<br>
<br>
I think you need to investigate how SWIG's PHP backend currently<br>
works, and think about what you would change about that to make<br>
the change from defining the PHP classes in a generated PHP wrapper<br>
script to doing this in the generated C++ wrapper code using PHP's<br>
Zend API. And what a logical order to tackle these changes would<br>
be.<br>
<br>
SWIG already has an extensive testsuite, which I think all currently<br>
passes for PHP - certainly most of it does. So you have a natural<br>
measure of progress here - how much of SWIG's testsuite passes with your<br>
changes to the SWIG PHP backend?<br>
<br>
> 7. July 23 ? August 15: Improving the xapian php api<br>
> 8. August 16-August 20: Testing the new version of the xapian<br>
<div>> api, Writing the documentation for it<br>
<br>
</div>Much too vague, and you really want to implement, test, and document<br>
each improvement in turn.<br>
<div><br>
> For the mid term evaluation do I need to make a deliverable?<br>
<br>
</div>Ideally the project should provide a series of deliverables, not<br>
just one in the middle and one at the end.<br>
<br>
On Wed, Apr 04, 2012 at 12:37:55AM +0200, riadh chtara wrote:<br>
> I have an approach for handling php with swig.<br>
> Swig needs to act like this when we use it for php<br>
><br>
> - first it analyses the code<br>
> - then it inserts the zend api instuctions into the code<br>
> - finally it generates and compiles the zend extensions<br>
><br>
> What do you think?<br>
> I that couldn't work , please tell me how could I make that.<br>
<br>
You really need to make this fit with how SWIG already works, so trying<br>
to think about how to implement this without having looked at that is<br>
rather futile.<br>
<br>
Cheers,<br>
Olly<br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>