PEAR

Summary

ifeghali's picture

Hello!

This is a short summary of my work during Google Summer of Code 2006.
The main idea of this post is to be a single repository for all the links I need to provide Google folks to make my work known.

For the other people reading this blog entry, my SoC 2006 proposal is described here.

Well the first thing to point is my blog, which, by the way, is the one you are reading right now. I tried to post on my blog a brief of every step I took to accomplish my work. However on the last weeks of the program I hadn't enough time to feed it with detailed information.

ifeghali – Thu, 2006 – 08 – 24 21:48

Writer has Learned new Tricks

ifeghali's picture

MDB2_Schema_Writer now supports the new INSERT syntax and so the new additions: UPDATEs and DELETEs.

This is the last main modification for DML addition.

You can find the writer here.

ifeghali – Mon, 2006 – 08 – 21 02:00

Parsing one more level

ifeghali's picture

Today I have added support for functions inside expressions and vice-versa into Parser.

Now we can do things like:


INSERT INTO Example
  (foo, birthday, foolish) VALUES
  ('2', myfunc(('1' + '2')), ('3' + functionA('1', '2')));

UPDATE Example SET
  foo='10',
  foolish=(functionA('1', '2') + functionB('3', '4'))
  WHERE (bar = lower('somestring'));

DELETE FROM Example WHERE (functionA('1', '2') + functionB('3', '4'));

ifeghali – Fri, 2006 – 08 – 18 00:30

Yes! Its Working!

ifeghali's picture

The SQL generator is implemented (and ready for the function/expression recurssion, currently not supported by the parser) and working.

Using the example.php shipped with MDB2_Schema the following XML (non relevant part omitted)

<initialization>
 <insert>
  <field>
   <name>foo</name>
   <value>2</value>
  </field>
  <field>
   <name>birthday</name>
   <function>

ifeghali – Thu, 2006 – 08 – 17 01:11

New XML Parser

ifeghali's picture

As the end of the program is approaching, I am focused on coding so I don't have many time left for feeding this blog. I am learning so much from PEAR that I would like to share with you but unfortunately I don't have time for that.

The parser now supports the new INSERT syntax and so the new additions: UPDATEs and DELETEs.

You can find the parser here.

ifeghali – Tue, 2006 – 08 – 15 20:18

Complete MDB XML Syntax

ifeghali's picture

The complete MDB XML Syntax is now upped to MDB2_Schema Wiki.

ifeghali – Wed, 2006 – 08 – 09 01:20

XSD Part 2

ifeghali's picture

We are approaching the final version of MDB2's XML Schema:


<!-- ROOT -->

<xsd:complexType name="database">
  <xsd:sequence>
    <xsd:element ref="name" maxOccurs="unbounded"/>
    <xsd:element ref="create" minOccurs="0"/>
    <xsd:element ref="overwrite" minOccurs="0"/>
    <xsd:element ref="description" minOccurs="0"/>
    <xsd:element ref="comments" minOccurs="0"/>
    <xsd:element ref="table" maxOccurs="unbounded"/>

ifeghali – Thu, 2006 – 08 – 03 22:38

XSD Part 1

ifeghali's picture

The first approach of MDB2's XML Schema Definition:


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:annotation>
  <xsd:documentation xml:lang="en">
    Schema for PEAR MDB2_Schema database files
  </xsd:documentation>
</xsd:annotation>

<xsd:element name="comments">
  <xsd:complexType mixed="true">
    <xsd:sequence>
      <xsd:element name="variable" type="xsd:string"/>
    </xsd:sequence>

ifeghali – Thu, 2006 – 08 – 03 00:44

XML Schema Based Format

ifeghali's picture

Today I did some search at wikipedia about XML Schema files.

The most useful visited Links:

XML
Schema
XML Schema
XML Schema Definition
W3C XML Schema

Tomorow I will start writing the XML Schema for MDB2_Schema XML files.

ifeghali – Tue, 2006 – 08 – 01 00:18

Deterministic DTDs

ifeghali's picture

This post extends DTD issues

I have found an useful post about deterministics DTD here.

I have decided to leave the hard validation to a post XML-validation written in PHP (as sugested here). By the way Lukas had already told me to do this before.

The problems and their workarounds was:
P: <!ELEMENT create (#PCDATA | variable)>
S: <!ELEMENT create (#PCDATA | variable)*>

ifeghali – Fri, 2006 – 07 – 21 13:59
Syndicate content