Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
[Conférence Frameworks PHP à EPITA] - 19/03/2009 - Présentation eZ Components.pdf
1. PHP Frameworks:
Introduction to eZ Components
www.ezcomponents.org
Roland Benedetti, Gaetano Giunta
EPITA, Paris
19/3/2009
www.ez.no
2. Agenda
Introduction
●
Architecture and design
●
New in the latest releases
●
Roadmap
●
Examples of usage
●
Questions / other
●
2/21
3. eZ Components – what is it?
« a high-quality library of independent components that aid in the
development of Web-centric applications »
That is...
Not a framework
... but a set of loosely coupled components. They can be used
individually or together
Not geared exclusively towards web development
... but especially suited to web development
Available with a New BSD license and support from eZ Systems
3/21
4. Goals of the library
A solid platform to ease development of applications in PHP 5
●
relieving the coders from reinventing the wheel every time
Simple and consistent API, OO « clean » design
●
Do not impose a structure on everything: not a framework
●
Keep full binary and API compatibility as long as possible
●
High priority given to stability and regression avoidance
●
100% Open Source, clear attribution of rights
●
Developed, maintained and supported by eZ Systems
●
4/21
5. Development methodologies
Take full advantage of libraries and language functionality
●
available from PHP 5.1 (minimum supported version: 5.1.6 /
5.2.1, depending on release)
Every API is discussed and documented in a design doc before
●
being implemented
Pervasive usage of unit testing – tests are written BEFORE
●
code
Both inline (phpdoc à gogo) and offline (tutorials, reference,
●
installation guide) documentation.
Documentation is written during development, not afterwards
●
5/21
6. Architecture: class naming
Usage of a prefix, because of lack of namespacing (waiting for
●
PHP 5.3): ezcXXX
Readable: better long understandable names than short and
●
cryptic
Sometimes « adjusted » for readability
●
eg: ezcMailSmtpTransport vs. EzcMailSMTPTransport
ezcTestSuite vs. PHPUnit2_Framework_TestSuite
...and many other rules you can find on
●
http://ezcomponents.org/contributing/coding_standards.html
6/21
7. Architecture: dependencies
The less, the better...
●
... avoiding duplication of code
●
Only where necessary
●
Usage of separate
●
Components to implement them
7/21
10. Latest additions: 2008.1
New component: Document. It allows to convert documents
●
between different formats (at the moment conversion from
ReST to XHTML and DocBook is supported)
New component: Feed. It parses and generates RSS1, RSS2 and
●
ATOM feeds
New component: Search. provides a unified interface to
●
different search engine back-ends (at the moment, only a Solr
back-end is supported)
Improved: hierarchical caching in the Cache component; Cairo
●
driver support for the Graph component; binary data support in
PersistentObject, integration between Translation and
Template; etc...
10/21
11. Latest additions: 2008.2
New component: MvcTools (we are a framework after all!)
●
Improved: Document supports wiki (Confluence, Creole and
●
DokuWiki style) and eZ Publish xml formats, reads xhtml,
writes ReST
Improved: Webdav supports authentication and authorization,
●
shared and exclusive write locks
11/21
12. Roadmap: 2009.1
Focus: improve the new MVC support in eZ Components by
●
making it both more powerful and easier to use
Introduce the quot;Frameworkquot; component
Authentication: add support for OpenID 2
●
Document: support for PDF writing and the support of layouts
●
while writing; support for ODF reading and writing and the
support of layouts while writing
Search: support for the Zend_Search_Lucene backend
●
PersistentObject: automatic fetching of related objects; identity
●
mapping to avoid having 2 objects with the same db state
12/21
13. System Requirements
PHP version 5.2.1 (for 2008.2 and later)
●
Some php extensions are needed by some components, or thay
●
are transparently used to provide extra features
ex: Archive needs zlib (present in the default install of PHP) and
●
bz2, opzionally can use « posix » for management of file
permissions
Detailed list at:
●
http://ezcomponents.org/overview/requirements.html
(it includes a quick reference on compilation of missing
extensions)
13/21
14. Development environment: tips
Always develop with display_errors = On, log_errors = On,
●
error_reporting = E_ALL set in php.ini
Quiz: where is the PHP error log? And the webserver one?
●
XDebug - best friend of OOP PHP (and many others):
●
Complete stack traces
–
Step-by-step debugging (using appropriate IDE)
–
code coverage analysis (needs visualization tools)
–
Profiling (with kcachegrind/wincachegrind)
–
Sever status and configuration pages: mod_info, mod_status,
●
phpinfo.php, apc.php/eaccelerator.php/xcache.php
14/21
15. Dev. environment: more tips
Cannot do web development without: Firebug
●
Many other useful Firefox extensions: « Web developer »,
●
« YSlow », « LiveHTTPHeaders », « IETab », « Console2 »,
«Selenium IDE»
For developers on windows: UNXUTILS (from sourceforge.net)
●
In production environments:
●
Always use an opcode cache (APC, Eaccelerator, Xcache,
–
Zend)
Sever status and configuration pages: mod_info,
–
mod_status, phpinfo.php, apc.php/xcache.php/...
15/21
16. Installation 1: via PEAR
1. Set up properly PHP 5.2 and PEAR
2. Add the components.ez.no channel to the PEAR installer
pear channel-discover components.ez.no
3. Download the components
pear install -a ezc/eZComponents
To upgrade an existing installation:
●
pear upgrade ezc/eZComponents
pear help <commandname> is your friend!
●
16/21
17. Installation 2: via SVN
For developers interested in the development of the library or
needing a patch that has just been implemented
1. Set up properly PHP 5.2 and an svn client
2. Create an install directory and download the components in it
svn co http://svn.ez.no/svn/ezcomponents/trunk
3. Download and run the script tho set up the dev environment
svn co http://svn.ez.no/svn/ezcomponents/scripts
./scripts/setup-env.sh (or scriptssetup-env.bat)
It is of course possible to checkou only some components - take
●
care about dependencies!
17/21
18. Installation 3: quot;old skoolquot; (aka manually)
1. Download and decompress the tarball
wget http://ezcomponents.org/files/downloads/
ezcomponents-2008.2.1.tar.bz2
tar -xjf ezcomponents-2008.2.1.tar.bz2
3. Set up properly the PHP Include Path (there's no 2!)
18/21
19. Configuration
Include path: automatically set up by PEAR, otherwise the root
●
dir where the software has been downladed needs to be added
Autoload: all the eZComponents classes are automatically
●
loaded from ezcBase (no need to include_once/require_once)
require_once quot;Base/base.phpquot;;
function __autoload( $className )
{
ezcBase::autoload( $className );
}
NB: for installations by SVN o tarball
●
require_once quot;Base/src/base.phpquot;;
19/21
21. Questions?
Thanks for the attention!
http://ezcomponents.org
http://ez.no/community/forums/ez_components
http://lists.ez.no/mailman/listinfo/components
Gaetano Giunta
Senior consultant
eZ Systems Western Europe
email : gg@ez.no
21/21