EZCache project launched !

2 08 2006

Since every dynamic website is not really ultra-dynamic, it is a good idea that most of its pages may be cached to improve response time and save server ressources. Caching may be really simple : each cached page has an expire date. But this technique has two main inconvenients : it does not reflects reality if a change is made between two page regenerations, and page may be regenerated even if it has not been changed, which is a stupid behaviour in itself.

So how can we have cache performance benefits, without disadvantages of expiration technique ? That’s the question I’ve tried to answer before creating the EZCache PHP library. To discover how I think I’ve resolved this problem, just have a look at the EZCache PHP library page.

About EZForm architecture

28 04 2006

I’m wondering if I’ve made a good architecture for this library. In fact, it is not fully object oriented.

Actually, EZForm is made of one class that imbeds all the code, with some switch/case within. It’s more a functionnal approach than an object one. A really object oriented approach may use one class for each datatype supported in the XML file. Those classes may inherit from an abstract superclass “EZFormDataType”, that gives the abstract methods to be implemented in the subclasses (types).

Lire la suite »

EZForm Beta 1

28 04 2006

I’m really happy to publish the first beta version of EZForm ! I’ve made a specific page on this blog to explain how it works and how to use it, and carefully the download archive.

I’ve looked again for similar libraries or frameworks on the net, and I found a PHP library that seems to be quite hard to use, one form generator (generated statically and not dynamically), and a powerful framework of AJAX web components, but that’s not the same goal and scale.

Finally I think I’ve not worked for nothing : my library is very simple to use, very flexible and really time-saving. Moreover, it can be easily upgradable with new types, a few code is required.

EZForm announcement

21 04 2006

I am currently working on a PHP library named EZForm. This library is intended to enable you to create HTML forms with custom business and automatic datatype checking.

In order to create a Form, you have to follow two steps :

  1. Write a small XML file describing the form sections and data fields, with type specification and restriction. For example, to create an integer field with value constrained between 1 and 10, you may simply write :

    <integer name="children" required="no">
    <!-- Visible label of the field -->
    <label>Your number :</label>
    <!-- The character length of the field - optional -->
    <!-- Minimum value -->
    <!-- Maximum value -->
    <!-- Your business-rules validation function -->
    <!-- Required empty tag for internal error management -->
  2. Write a PHP skeleton page, with only your business-rules validation functions for some fields, and your final processing functions (inserting and updating supported within only one page)

And that’s all, everything is managed by the library. It generates automatically form visual sections, field names, HTML controls, with examples and constraints explained.

Other features :

  • You can custom your form look with flexible CSS classes
  • Lists can be loaded directly from a database with mapping tags in the xml file (with extended where, orderby, and limit clauses)
  • List selection count is fully managed : min, max selected items, * supported for max
  • Lists are automatically transformed to corresponding HTML control depending on min/max constraints
  • Date types with min/max constraints
  • Cutom field type based on regular expression validation (for example phone number)
  • File uploading supported with custom processing and deleting functions, “can be deleted” attribute
  • Native supported types : string, integer, list, email, date, file, text (long strings), customtype

For example, a quite big form with 20 fields in 3 sections can be done with :

  • A XML file about 150 lines long (including whitespaces and pretty indentation)
  • A PHP file about 75 lines long (including headers, etc)

More information and a specific page will be created soon on this blog.

Parse error: syntax error, unexpected '/' in /mnt/106/sda/6/e/prog13/wp-content/themes/freshy/footer.php on line 18