Tài liệu The Object Oriented Evolution of PHP5 - Pdf 96

FEBRUARY 2003
www.phparch.com
VOLUME II - ISSUE 2
The Object Oriented The Object Oriented
Evolution of PHP5Evolution of PHP5
A Look At The New OOP Model
Using The Zend Engine 2.0
By Zeev Suraski
Reviewed for you:
IonCube PHP Accelerator 1.3.3
CodeCharge Studio 1.0
Plus:
Tips&Tricks, Book Reviews, Product Reviews
and much more
Creating A CustomizedCreating A Customized
Template-EngineTemplate-Engine
Hacking the Smarty
Template Engine
Data Fingerprinting with Hash Functions in PHP
Time Travel: Breadcrumbs and Session History with PHP
Enterprise Applications:
PHP in a Multitier Environment
PHP in a Multitier Environment
The Magazine For PHP Professionals
php|architect
Technologies Ltd.
Visit www.zend.com
for evaluation version and ROI calculator
Zend Performance Suite
Reliable Performance Management for PHP
Serve More.

5 NEW STUFF
6 REVIEWS
Zend Encoder V.3.1.0
22 REVIEWS
LogiCreate
61 TIPS & TRICKS
by John Holmes
65 BOOK REVIEWS
67 exit(0);
Hello, Mr. Gates?
EEDDIITTOORRIIAALL RRAANNTTSS
EDITORIAL
February 2003 · PHP Architect · www.phparch.com
4
php|architect
Volume II - Issue 2
February, 2003
Publisher
Marco Tabini
Editors
Arbi Arzoumani
Brian K. Jones
Marco Tabini
Graphics & Layout
Arbi Arzoumani
Administration
Emanuela Corso
Authors
Andreas Demmer, Peter James,
Tomica Jovanovic, Dave Palmer,

world seems to have resulted
from short-lived but intense
flashes of genius, which are then
followed by long periods of cere-
bral inactivity. (A related study
also showed that I have way too
much time on my hands, but I
was far too busy to notice or
even care about that).
For example, Arbi came up
with the idea of calling our mag-
azine “php|architect” after I had
been brooding over names like
“The PHP Gazette” and “The
PHP Informer” for days. I can
only be thankful for the com-
pletely random sequence of
synaptic signals that made that
brilliant idea come to life.
Given the spontaneity of our
collective genius, it would most
definitely prove futile to even try
to explain how we arrived at our
most brilliant idea: to ask Brian
Jones, who joined our editorial
staff last month, to become our
new Editor-in-Chief. I can only
say that it was a moment of
unparalleled brilliance. I’m sure
that we burned a good number

foolish soul that he is, Brian will
only read this once the maga-
zine has already hit the virtual
stands, and by then his fate will
be sealed).
Naturally, the person who can
sport the title of Editor-in-Chief
enjoys a great deal of power—a
power that Brian promptly
abused by asking me to rewrite
this editorial, claiming that “my
thoughts were too fragmented”.
As if. That could ever. Happen.
Let me now tell you about the
Publisher. The post of Publisher
affords great powers as well.
That includes the power to edit
and reject (did I say reject? I
meant “evaluate”) the Editor-in-
Chief’s monthly editorial.
Regardless of whether his
thoughts are fragmented or not.
Ah, the bittersweet taste of
revenge
NNEEWW SSTTUUFFFF
NEW STUFF
ionCube Launches New Encoder
British PHP software company ionCube Ltd.
released version 2.0 of their standalone Encoder
product last month. The new encoder providers

MacIntosh open-source software provider
OpenOSX have updated their OpenWeb CD prod-
uct to include the latest version of PHP.
OpenWeb is a CD compilation of open-source
software for the MacIntosh market designed to
provide publishing and development tools to Web
developers and webmasters. Besides technologies
like Apache, PHP and MySQL, it also includes a
shopping card, a content management system
and a graphical management interface.
The new 2.5.1 update is available to registered
users of the OpenWeb product free of charge. A
new full subscription can be purchased for $60 US
from the OpenOSX website at :
/>2003 PHP Conference in Montréal
This just hot off the press—The Québec PHP
Association announced that they will be holding a
PHP conference in Montréal, Canada, on March
20th and 21st. The conference will attract a who’s
who of the PHP community, from PHP creator
Rasmus Lerdorf to Zend-engine co-creator (and
php|a author) Zeev Suraski. The conference will
include sessions in both French and English, and it
is sure to attract visitors from the Americas as well
as from Europe.
The php|a team will be with a booth and to
cover the event.
/>February 2003 · PHP Architect · www.phparch.com
5
php|a

The Zend Encoder, produced by Zend Technologies
(yep, the same folks who wrote the Zend Engine on
which PHP is based) is a rather complete system that
makes it possible to transform a PHP source file into an
“intermediate” representation of itself—that is, a pre-
interpreted set of bytecode instructions that the PHP
interpreter would be able to execute but that are quite
meaningless to a human being. The resulting file is fur-
ther mangled to make reverse-engineering almost
impossible. In addition, it is possible to require that a
Reviewed For You
Zend EEncoder
V.3.1.0
By Marco Tabini
The Cost:
$960.00 - $2,880.00 (US)
(or less through special small business pricing)
Requirements:
-Supported PHP versions: 4.0.5 up through 4.3.0.
-Supported operating systems:
-Linux glibc 2.1 / 2.2 (e.g. RedHat
6.x/7.x/8.x, Debian 4.2, SuSE 6.4, Mandrake
8.1, and others)
-Windows® 98 / NT 4.0 / 2000 / XP.
-Solaris Sparc 2.6 /2.7 /2.8 (Non-GUI ver-
sion).
-Supported Web Servers for deployment:
-Apache 1.3.x, IIS 4 / 5
-Zeus (using FastCGI) or any Web server that
supports CGI

Zend website allows you to download a version for
Windows, Linux or Solaris.
On Linux, the platform I tested it on, the application
is set up through a very straightforward process that
even connects to the Zend website and downloads the
appropriate license code automatically. A free 14-day
trial of the Encoder is available, its only limitation being
that your encoded files will only work for three days,
regardless of what settings you choose when convert-
ing them.
The User Interface
Once installed, the Encoder launched flawlessly—no
ifs, ands or buts about it. It features a neat graphical
user interface (shown in Figure 1) that makes using the
software for the encoding of large numbers of files easy
and convenient.
As you can see, the interface is based on the concept
of a “project”—this way, you can encode entire direc-
tories of PHP scripts at the click of a mouse. In fact, I
tried to encode the entire php|a website, and the entire
operation took only a few seconds. The original files
were not overwritten (if they were, I’d lose our source
code!), but copied over to a destination folder of our
choosing. The program even skipped over our CVS
folders automatically!
The Encoder supports several options designed to
enrich the value of encoded files. For example, it’s pos-
sible to prepend a clear-text header to the file that
allows you to insert installation or usage comments, or
even plain PHP code that is executed if the server is not

“full” version by just installing a single file. Licensing is
only available if support for it is activated when a script
is encoded.
The licensing screen (Figure 2) offers a wide variety of
options, including the ability to limit the execution of
the scripts using constraints such as time or IP or even
a hardware ID that is generated by a small Zend appli-
cation distributed together with the Encoder.
Distributing the Code
Once encrypted, a project can be redistributed by
simply transferring the files to another system.
Depending on the settings, you may also need to dis-
tribute a license file.
In order to execute your script on a target system,
your customers will need to install a copy of the Zend
Optimizer together with their installation of PHP. This is
not normally a big problem, as the Optimizer is a freely
available product whose installation only require a
small change in the php.ini file. However, if the appli-
cation is being hosted by a third party, it might be dif-
ficult to convince them to install this software.
Advanced Capabilities And
Documentation
In addition to the GUI, the Encoder also features the
necessary tools for encoding scripts and generating
license files on-the-fly through a command-line exe-
cutable. This can be helpful if your goal is to hand out
licenses in an automated fashion directly from a web-
site.
There is no online help for the Encoder, but the instal-

10
Introduction
The great philosopher and novelist George Santayana
once told us: “Those who cannot remember the past
are condemned to repeat it.”
The past has always been a vital part of the present.
Like a map, it tells us where we’ve been and gives us
important information with which to make decisions
about the future. If you’re asking yourself what all of
this has to do with PHP, let me show you.
Information is critical. If you are reading this maga-
zine, your business probably revolves around informa-
tion, and you probably recognize the value of that
information to the people who want it. The fact is,
regardless of what your business is, every time someone
visits your site you have the opportunity to capture use-
ful information about them. That information can be
used to significantly enhance their experience on your
site, and there are many levels of detail to be had.
For instance, you could request that users register
and log in to your site, which usually has required the
provision of at least some personal information on
behalf of the end user. You could use this to contact
your customers with promotions or newsletters, or tar-
get their demographic (age, gender, location) with
advertising. While the gleaning of this personal data
requires action from the user (ie, voluntary registra-
tion), other types of information can be gathered pas-
sively and silently.
A prime example of the type of data which can be

our primary focus in this article, is the history of the cur-
rent session. This is the most easily handled type of
information. We can get it as they navigate, use it
while we have them on the site, and then discard it
when their session ends. Unlike many other types of
desirable user data, it doesn’t require a database or the
associated design; it is very transient. Interestingly
enough, if stored across sessions, the history provides
patterns of use data, which we mention briefly above.
Among many other things, this information can be
used to provide enhanced navigation options, called
‘breadcrumbs’, which is the subject of this article.
First, I’ll first explain what breadcrumbs are, and then
I’ll examine in detail the ways in which breadcrumbs
can be used, giving you plenty of usable code along the
way.
A note about the coding
style used in my examples
In all of my examples involving sessions, I will use the
$_SESSION[] array, rather than the associated glob-
als. Aside from being what I consider to be a cleaner
approach, this will reduce the chance for the introduc-
tion of errors by, for example, missing a
session_register() call. I also do not assume in
these examples that you will have register_glob-
als enabled in your php.ini file. This will ensure max-
imum compatibility with different systems and PHP
implementations.
Of Bread and Crumbs
‘ and Hansel comforted his little sister and said: “Just

page on that site, where you will then see two crumbs,
and so forth. This can be used on non-hierarchical sites
to supplement with a visual what’s under the browser’s
back button.
Figure B
Is that clear? Location breadcrumbs are like a ‘You are
here’ marker on a map, and path breadcrumbs are like
a highlighted route on a map. Location breadcrumbs
are more focused on where you are in the scheme of
things, whereas a path breadcrumb is more concerned
about the way you came.
As an aside, it may be that if you used a search engine
and looked for “daisy”, you might come across the
page in Figure A directly. Strangely, you may still see
the full location breadcrumb, even though you didn’t
navigate through those points. This is because pages
on sites that implement location breadcrumbs typically
know their way home. This can work in a couple of dif-
ferent ways, which I’ll discuss a little later.
Because they are the most common form, this article
will focus on the location breadcrumb concept,
although I will relate back to path breadcrumbs when
appropriate. In fact, the second example that we will
cover will actually be a hybrid that looks like a location
breadcrumb, but the processing underneath is closely
related to that of the path breadcrumb method. From
this point on, unless otherwise noted, when I talk about
breadcrumbs I’ll be referring to location breadcrumbs.
More About Breadcrumbs
Breadcrumbs usually will appear like a directory struc-

leader, and his final project while studying for his MBA
required a business idea that related to IT. Harvey
thought about it (no pun intended), and decided that
as a part of his business he could resell web code and
graphics. All he had to do was browse the web for an
hour or two, and he’d have enough code and images
to start up his business, HarveysHTMLHaven.com.
Harvey ended up using a highly hierarchical physical
structure for his site. Directories named images and
code resided in his site’s home directory. Inside of the
images directory were four more directories named but-
tons, clipart, icons and photos. Inside each of these
were, potentially, gif, jpg and png. The code directory
had a similarly nested structure. For brevity, we’ll focus
only on the images tree.
A user could follow links down any of these paths,
and Harvey was concerned that the user would lose
their bearings and become frustrated. He wanted to
maintain some sort of map back to home at all times.
Breadcrumbs to the rescue! This is the easiest form of
breadcrumb to implement, because it is a more or less
static structure. Sure, Harvey may add images to his
individual library pages, but the category layout is
mostly static. Let’s write some code.
In Figure F, you’ll see a simple class that I created to
show how easy it is to deploy this form of breadcrumb.
Let’s examine this code. I needn’t have used a class
here, but it provides nice encapsulation. The class’s job
is to build breadcrumbs from the script’s URL, and
return the finished product. There are two member

> Animated
Home
| Plays | Comedies
Home : Cooking
: Fish
Home
/ Monsters /
Sully
Home > Life > Plants
February 2003 · PHP Architect · www.phparch.com
12
<?php

// simple example of using SimpleBreadcrumb class
$crumb_label_map = $array(

images

=>

Images

,


buttons

=>

Buttons


jpg

=>

JPEG

,


gif

=>

GIF

,


png

=>

PNG

,


code


1 <?php
2
3 // a simple breadcrumb class that works off of the directory
4 // names in the current script
5 class SimpleBreadcrumb
6 {
7 var $_separator =

>

;
8 var $_label_map = array();
9
10 function SimpleBreadcrumb($label_map=null, $separator=null)
11 {
12 if (isset($separator))
13 {
14 $this->set_separator($separator);
15 }
16 if (isset($label_map))
17 {
18 $this->set_label_map($label_map);
19 }
20 }
21
22 function set_separator($separator)
23 {
24 $this->_separator = $separator;
25 }
26

45 $base .=

{$dir}/

;
46 if (isset($this->_crumb_label[$dir]))
47 {
48 if ($dir == $current)
49 {
50 $crumbs[] = $this->_crumb_label[$dir];
51 }
52 else
53 {
54 $crumbs[] =

<a href=

{$base}

>{$this->_crumb_label[$dir]}</a>

;
55 }
56 }
57 }
58
59 return join($this->_separator, $crumbs);
60 }
61 }
62

the structure a little further.
All activity on GrannysGiftGaggle.com comes
through specialized points of access, or controller
scripts, and as I mentioned earlier, there is no really
structured physical underlay for Granny’s site. She
mostly relies on the data passed in on the querystring
to get the current state, which determines what to
show.
Since the querystring will determine the current
page, it might be educational for us to follow a simple
set of transactions on Granny’s site, and see how peo-
ple navigate around in Figure H.
Now that we’ve got the view from 50,000 feet on
how Granny’s site works, we can move on to what we
need to make breadcrumbs work.
You may have seen some information in the links
above that might be useful for generating bread-
crumbs. This information will provide what bread-
crumbs require: state.
State and History
State can be defined as a “unique snapshot that is
quantified by values for a set of variables, characterizing
the web site for a period of time, and is different from
other states.” This is rather like your checkbook. Right
now, if it is balanced, you have a certain set of posses-
sions, and a certain amount of money left. Your check-
book, and life, is in a particular state. Writing a check
will transition you to another state (hopefully not a
broke one).
In order to get the information we need for the state,

3. Football Sub-Categories – category=football
variable , products directory
This is starting to look suspiciously like a breadcrumb!
Let’s see the code to “make it so, Number One”. It’s
listed in Figure I.
It’s ironic that this is the ComplexBreadcrumb class,
when the code is almost simpler than the
SimpleBreadcrumb class that we discussed earlier.
Regardless, I’ll walk through this code. Again, I really
didn’t need to use a class here, but there it is.
The purpose of the class is to store state history in the
Disclaimer: This is obviously not intended to be a
tutorial on how to write a shopping cart applica-
tion, and is only a very rough example, for demon-
stration purposes, of how an application like this
might work.
February 2003 · PHP Architect · www.phparch.com
14
FEATURES
Time Travel - Breadcrumbs and History with PHP
user’s session and allow retrieval of state in breadcrumb
form. It has two member variables, $_separator,
and $_current_state. $_separator again con-
tains the character used to delimit the breadcrumb’s
links, while $_current_state contains the label of
the current state. This label is used as a crude lookup
later.
The class also contains a very basic constructor,
which can optionally initialize the breadcrumb separa-
tor at instantiation. A setter function is also provided

1
/>First the user navigates to the main page, where
they are presented with, among other things, a link to
the products section.
2
/>ucts/
When the user navigates to the products section,
they are presented with a number of product cate-
gories
3
/>ucts/?category=football
Once a category is selected, a list of subcategories
will appear.
4
/>ucts/?subcategory=footballs
After they select a category, a list of products
appears.
5
/>ucts/?product_id=A1234
Once a product is chosen, the user may browse
through any amount of relevant information about it,
including the description, testimonials, specifications
and supporting material.
6
/>e/?cart=add&prod_id=A1234
Once the user is happy with the product, they may
choose to add it to the cart.
7
/>e/?cart=checkout
If no other products are wanted, the next logical

12 $this->set_separator($separator);
13 }
14
15 function set_separator($separator)
16 {
17 $this->separator = $separator;
18 }
19
20 // set a state/crumb
21 // - 'parent' is the parent label (allows chaining)
22 // - 'label' is the state/crumb label you are adding
23 // - 'vars' is an array of name-value pairs (usually from $_GET) that
24 // identify the state/crumb
25 function set_state($label, $parent='home', $vars=array())
26 {
27 $_SESSION['_crumbs'][$label] = array( 'label' => $label,
28 'path' => $_SERVER['PHP_SELF'],
29 'vars' => $vars,
30 'parent' => $parent,
31 );
32 $this->current_state = $label;
33 }
34
35 function get_output()
36 {
37 // no current crumb means no crumb display on the page
38 if (! isset($this->current_state))
39 return '';
40
41 $crumbs = array();

Figure I
FEATURES
Time Travel - Breadcrumbs and History with PHP
You might notice that, with some effort, this more
complex version of breadcrumbing would work for
Harvey as well. For his situation, the first method is
more than adequate, and will keep things simple, but
this would certainly do the trick, too.
Limitations
Although these examples will cover help with the
majority of applications, they still don’t address a few
things:
Using images as separators is not supported. This
would be a very simple extension, and would really
only involve the addition of a parameter to the contruc-
tor, an extra setter method, and the extra logic needed
to add an <img> tag, rather than a symbol.
Saving $_POST variable state is also not supported.
This is a very simple modification, requiring only that
you change $_GET to $_REQUEST. Note that storing
and later resubmitting $_POST values is generally con-
sidered a bad idea, though, since they usually come
from submitted forms, and can have nasty side-effects
(like attempting to re-insert entries to your database
tables) if you aren’t careful.
If you are browsing Granny’s site, and you navigate to
two different products in two different categories, you
may find problems with old history. If you use your
browser’s back button to back out of the second prod-
uct all of the way back to the first product and refresh,

these uses include preventing form resubmission, path
breadcrumbs (remember those?), and in-stream
authentication. In-stream authentication refers to a sit-
uation in which you click a link, are asked to authenti-
cate, and then proceed to that link’s location directly,
which is a very nice usability feature.
Wrapping Up
Boy, we’ve come a long way! I hope these examples
have helped to clear the mud. As with just about any-
thing in this world, there are a million ways to imple-
ment breadcrumbs. I can’t possibly attempt to cover
every base, but I hope that I’ve been able to provide
some insight into this topic, and provide some useful
code to work with.
February 2003 · PHP Architect · www.phparch.com
17
php|a
Peter James is a developer and team lead working in Edmonton, Alberta,
Canada. In his spare time he tries to magically juggle his family, free-
lance work, tool development and learning. You can reach Peter at

References
“Those who cannot remember the past are
condemned to repeat it.”
Life of Reason, Reason in Common Sense,
Scribner’s, 1905, page 284
Definition of state
/>ill/Definitions.html
Breadcrumb concepts
/><?php


category

])
);

print $cbc->get_output();

?>
Figure J
FFEEAATTUURREESS
FEATURES
February 2003 · PHP Architect · www.phparch.com
18
Where did it all start?
Few people know this, but when PHP as we know it
today was being molded, back in the summer of 1997,
there were no plans for it to have any object-oriented
capabilities. Andi Gutmans and I were working to cre-
ate a powerful, robust and efficient Web language
loosely based on the PHP/FI 2.0 and C syntax. As a
matter of fact, we got pretty far without having any
notion of classes or objects – it was to be a purely struc-
tured language. One of these summer nights however,
on August 27
th
that year, this changed.
At the time classes were introduced to the code base
of what was to become PHP 3.0, they were added as
syntactic sugar for accessing collections. PHP already

difference was that objects had to belong to a class.
Classes, as in other languages, contained a collection of
properties and methods (functions), and objects could
be instantiated from them using the new operator.
Single inheritance was supported, allowing users to
The OObject OOriented
Evolution oof PPHP
By Zeev Suraski
One of the key ingredients in the upcoming version 5 of PHP will be the Zend Engine 2.0, with support for a brand
new object-oriented programming model. This article describes the evolution of the object-oriented programming sup-
port in PHP, covering the new features and changes that are scheduled for PHP 5.
FEATURES
The Object Oriented Evolution of PHP
extend (or specialize) the scope of an existing class
without having to write it from scratch or copy it.
Finally, PHP 4.0 also added the ability to call methods
of a specific class, both from within and outside object
contexts.
One of the biggest twists in PHP’s history was the fact
that despite the very limited functionality, and despite
a host of problems and limitations, object oriented pro-
gramming in PHP thrived and became the most popu-
lar paradigm for the growing numbers of off-the-shelf
PHP applications. This trend, which was mostly unex-
pected, caught PHP in a sub-optimal situation. The fact
that objects were not behaving like objects in other OO
languages, and were instead behaving like associating
arrays was beginning to show.
The limitations of the
old Object Model

replicas of them. So, while their clones end up being
married inside wed(), the real $joe and $joanne
remain within a safe distance from the sacrament of
holy matrimony, in their protected outer-scope.
Of course, PHP 3 and 4 did give you an option to
force your variables to be passed by reference, conse-
quently allowing functions to change the arguments
that were passed to them in the outer scope. If we
defined wed()’s prototype like this:
then Joanne and Joe would have had better luck (or
not, depending on your point of view).
However, it gets more complicated than that. For
instance, what if you want to return an object from a
function, by reference? What if you want to make
modifications to $this inside the constructor, without
worrying about what may happen when it gets copied
back from new’s result into the container variable?
Don't know what I'm talking about? Say hallelujah.
While PHP 3 and 4 did address these problems to a
certain extent by providing syntactic hacks to pass
around objects by reference, they never addressed the
core of the problem:
The Answer – Zend Engine 2
When we were finally convinced that objects are
indeed special creatures and deserve their own distinct
behavior, it was only the first step. We had to come up
with a way of doing this without interfering with the
rest of the semantics of PHP, and preferably, without
having to rewrite the whole of PHP itself. Luckily, the
solution came in the form of a big light bulb that

19
FEATURES
The Object Oriented Evolution of PHP
ago. His idea was to replace objects with object han-
dles. The object handles would essentially be numbers,
indices in a global object table. Much like any other
kind of variables, they will be passed and returned by
value. Thanks to this new level of indirection we will
now be moving around handles to the objects and not
the objects themselves. In effect, this feature means
that PHP will behave as if the objects themselves are
passed by reference.
Let’s go back to Joe and Joanne. How would wed()
behave differently now? First, $joanne and $joe will
no longer be objects, but rather, object handles, let’s
say 4 and 7 respectively. These integer handles point to
slots in some global objects table where the actual
objects sit. When we send them to wed(), the local
variables $bride and $groom will receive the values 4
and 7; setHusband() will change the object refer-
enced by 4; setWife() will change the object refer-
enced by 7; and when wed() returns, $joanne and
$joe will already be living the first day of the rest of
their lives together.
What does that mean
to end-users?
Alright, so the ending to the story is now more idyl-
lic, but what does it mean to PHP developers? It means
quite a number of things. First, it means that your
applications will run faster, as there will be much less

interaction with external component models, such as
Java, COM/DCOM and .NET through overloading.
In comparison to the Zend Engine 1 in PHP 4.0,
which first introduced this sort of integration, the new
implementation is much quicker, more complete, more
reliable and even easier to maintain and extend. This
means that PHP 5.0 will play very nicely in your exist-
ing Java or .NET based setup, as you will be able to use
your existing components inside PHP transparently, as
if they were regular PHP objects. Unlike PHP 4.0, that
had a special implementation for such overloaded
objects, PHP 5.0 uses the same interface for all objects,
including native PHP objects. This feature ensures that
PHP objects and overloaded objects behave in exactly
the same way.
Finally, the Zend Engine 2 also brings exception han-
dling to PHP. To date, the sad reality is that most devel-
opers write code that does not handle error situations
gracefully. It’s not uncommon to see sites that spit out
cryptic database errors to your browser, instead of dis-
playing a well-phrased ‘An error has occurred’ kind of
message. With PHP, the key reason for this is that han-
dling error situations is a daunting task – you actually
have to check for the return value of each and every
function. Since set_error_handler() was added,
this issue became slightly easier to manage, as it was
possible to centralize error handling – but it still left a
lot to be desired. Adding exception handling to PHP
will allow developers both fine-grained error recovery,
but more important it will facilitate graceful applica-

oped. When we had to build the php|a site, we did-
n’t even look at any other options—we simply
designed the website the way we wanted it and put it
together. The reason is simple: after so many years of
being in this business, I have a pretty good under-
standing of how things work and can take care of
most things more quickly than I can learn how to use
a new product that would do the same in my place
(plus, let’s face it, one always likes to think that his
own stuff is better than something an automated
script can generate).
Unfortunately, this approach does not always work.
Building things from scratch—even when it comes to
reusing some of your own code from previous proj-
ects—takes time, and time is money. When budget-
ary considerations must take precedence over person-
al pride and the general laziness that all programmers
sport, it’s necessary to look beyond one’s personal war
chest and start from solid building blocks that take
care of most basic (and some advanced) aspects of a
good website.
It’s therefore with quite a bit of interest that I look at
the LogiCreate product that we received from Tap
Internet for review this month. Now, it’s important to
understand that the version Tap sent us is a develop-
ment snapshot; as such, some of the kinks still need to
be worked out, but this really seems to affect only the
installation part of the application, and for the rest I
can’t really say that the product exhibits any major
flaws. I wish our “development snapshots” were quite

As with other similar systems,
an entire LogiCreate application
can be managed through an
easy-to-use web-based interface.
Unlike other similar systems,
LogiCreate takes a security-cen-
tric approach to the entire appli-
cation. Most functions can only
be managed by users who have
the proper permissions, and it’s
possible to push almost all data
that is published through the
website through an approval
process to provide complete
control over it.
What’s more, unlike most con-
tent management systems and
web application frameworks,
LogiCreate seems to have been
built with the understanding that
a developer might want to work with something more
than the templates offered by the framework. As
such, the creation of custom templates and custom
scripts is not only supported, but also encouraged as a
way to provide a more flexible environment for the
programmer.
The Installation Process
As I mentioned above, this is the only area where the
version of LogiCreate that we received still needs a sig-
nificant amount of work. The creation of a new

ranging from a “welcome page” to a complete con-
February 2003 · PHP Architect · www.phparch.com
23
Figure 1
REVIEWS
tent management system.
The modules can be adminis-
tered through the Hercules
Control Center (affectionately
referred to as “Herc”), a backend
web-based application that
allows you to control the individ-
ual settings of each aspect of your
website. As I mentioned earlier,
Herc provides a very well-
thought-out user management
system, complete with grouping
and permissions at both the user
and group level. Thus, for exam-
ple, if I want to publish a new
news item and type it into the
system (Figure 3), it will be
“parked” into a special repository
until it can be verified and
approved by someone who has
the correct permissions to do so.
Herc also provides a complete
statistical system that can be used
to create reports on the kind of
traffic that your site receives

lar template. In fact, that’s the whole point of
LogiCreate’s philosophy: the modules, classes and
procedures that it provides are just there to help you
by providing a simple framework on which you can
build your own specialized functionality.
Documentation
This is probably another area in which LogiCreate
needs a bit of help. The user documentation, com-
February 2003 · PHP Architect · www.phparch.com
24
Figure 2
A non-technical person who is
just looking for a quick solu-
tion to his problems probably
won’t care that he can't mess
around with the source code.
REVIEWS
posed primarily of Herc’s user manual, is of excellent
quality and very clear. For some reason, however, it is
distributed separately from the Herc interface itself.
This makes it difficult for a user to get help from the
system, and risks negating the advantage of having an
interface like Herc in the first place. If I were to devel-
op a production system based on LogiCreate, inte-
grating the help in the Herc web pages would certain-
ly be on my to-do list.
The developer’s manual is a bit sparse, but otherwise
functional enough to be quite complete. It includes
information on how to create new templates and how
to modify (or integrate with) the application frame-

php|a


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status