Tài liệu Matchmaker Make Me a Match pdf

68 465 0
Tài liệu Matchmaker Make Me a Match pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

VOLUME III - ISSUE MARCH 2004 The Magazine For PHP Professionals Matchmaker Make Me a Match Using the Amazon.com API through PHP and XML-RPC Explore your HTML code with Tidy www.phparch.com PHP And WAP: Past, Present & Future Testing Automation With PHP PHP Ahoy! A Look at: php | Cruise Bahamas 2004 Plus: Tips & Tricks, Security Corner, Product Reviews and much more 3UHSDUH\RXUVHOIIRU3+3« /HDUQ2EMHFW2ULHQWHG3URJUDPPLQJ ZLWKRYHU3UDFWLFDO3+36ROXWLRQV 0R QH \% DFN *8 $5 $ *HWWKLVVHWRIWZRQHZERRNV 17 ((  7KH3+3$QWKRORJ\9ROXPH,)RXQGDWLRQV 7KH3+3$QWKRORJ\9ROXPH,,$SSOLFDWLRQV /HDUQWREXLOGIDVWVHFXUHDQGUHOLDEOH 2EMHFW2ULHQWHG3+3DSSOLFDWLRQVXVLQJ SURIHVVLRQDO:HEGHYHORSPHQWWHFKQLTXHV 3UHYHQW64/LQMHFWLRQDWWDFNV 6HQG 3DUVH+70/HPDLO )LOWHUXVHUVXEPLWWHGFRQWHQW &DFKHSDJHVIRUIDVWHUDFFHVV &UHDWH\RXURZQ566IHHGV 3URGXFHFKDUWV JUDSKV :ULWH3URIHVVLRQDO(UURUKDQGOLQJURXWLQHV &UHDWHVHDUFKIULHQGO\85/V $QGRWKHUSUDFWLFDODSSOLFDWLRQV %X\ERWKERRNVWRJHWKHUIRURQO\ 6$9( H Z H HD V HO 3/86ả3+3$UFKLWHFWÃUHDGHUVJHWDQH[WUDRII RQO\XQWLO$SULOWK 7R2UGHU12:YLVLWô SKSDUFKLWHFWVLWHSRLQWFRP TABLE OF CONTENTS php|architect Departments Features Editorial Connecting to Amazon.com Web Services with NuSOAP by Alessandro Sfondrini I N D E X What’s New! 16 34 Matchmaker, Matchmaker Make Me A Match: An Introduction to Regular Expressions Book Review Flash MX 2004 for Rich Internet Applications by George Schlossnagle 42 Product Review Mambo Open Source: Content Management System 28 Automated Testing For PHP Applications by Dr James McCaffrey 59 Security Corner Shared Hosting by Chris Shiflett 35 PHP Ahoy! A look at php|cruise by Marco Tabini 63 Tips & Tricks By John W Holmes 47 WAP: Past, Present and Future by Andrea Trasatti 66 exit(0); I Am Jack's Total Lack of Linux Support By Marco Tabini 53 Tidying up your HTML in PHP5 by John Coggeshall March 2004 ● PHP Architect ● www.phparch.com You’ll never know what we’ll come up with next ! W E N Existing subscribers can upgrade to the Print edition and save! Login to your account for more details php|architect Visit: http://www.phparch.com/print for more information or to subscribe online The Magazine For PHP Professionals php|architect Subscription Dept P.O Box 54526 1771 Avenue Road Toronto, ON M5M 4N5 Canada Name: Address: _ City: _ State/Province: ZIP/Postal Code: _ Your charge will appear under the name "Marco Tabini & Associates, Inc." Please allow up to to weeks for your subscription to be established and your first issue to be mailed to you *US Pricing is approximate and for illustration purposes only Choose a Subscription type: Canada/USA International Surface International Air Combo edition add-on (print + PDF edition) $ 83.99 $111.99 $125.99 $ 14.00 CAD CAD CAD CAD ($59.99 ($79.99 ($89.99 ($10.00 US*) US*) US*) US) Country: _ Payment type: VISA Mastercard American Express Credit Card Number: Expiration Date: _ E-mail address: Phone Number: Signature: Date: *By signing this order form, you agree that we will charge your account in Canadian dollars for the “CAD” amounts indicated above Because of fluctuations in the exchange rates, the actual amount charged in your currency on your credit card statement may vary slightly **Offer available only in conjunction with the purchase of a print subscription To subscribe via snail mail - please detach/copy this form, fill it out and mail to the address above or fax to +1-416-630-5057 EDITORIAL E D I T O R I A L R A N T S I 'm sure you're familiar with the Chinese proverb "may you live in interesting times." Even though I rarely think of my professional life as dull and boring, the last month has been particularly exciting As promised in my exit(0) column from last month's issue, if you look through the middle of the magazine you'll find a full report (in colour!) on the best conference I have ever attended—our very own php|cruise (forgive me for a bit of professional price—eight months of prep work will that to you) Things went so well that we're working on another cruise—this time going to Alaska in the fall—and plan on making php|c an annual event for many years to come All good things come to an end, of course, and, once back from the cruise, it's back to work Luckily for us, work means bringing you yet another great issue of php|architect—and I personally consider that another good thing Like every month, we've got some great content waiting for you in the following pages The one I'm most proud of is George Schlossnagle's regular expressions article Regexes are something that pretty much every programmer has to deal with, but that very few among us really know how to use In fact, I've seen developers write extremely complicated code with the explicit purpose of getting around having to use a regular expression—and that is just plain wrong After all, using the best solution for each problem is what being a programmer is all about Thus, I approached George about writing an article on regular expressions—and it became quickly evident that one article would not even come close to covering the complexity of regex Now, everyone knows that I always try my best to stay away from multi-part articles for a multitude of reasons, but in this case I felt that the topic more than deserved our attention over multiple issues and, therefore, George's article is the first in a series of three Over the next three months, he will take you for a ride from the basics (which are covered in this issue) to the more complex and exotic aspects of regular expressions, thus hopefully providing the PHP world with a definitive guide to this topic If regular expressions are not your bag, one of the other topics covered in this month's issue is certain to tickle your fancy For example, you may want to read Alessandro Sfondrini's excellent article on using the Amazon.com API directly from your PHP website, or Andrea Trasatti's look at the world of WAP As you can probably imagine, both Andrea and Alessandro hail from my native Italy—and that alone makes their articles more than worth reading There, my monthly heritage tax is now paid up! As I'm sure you've noticed, in the past few months we've been publishing material about testing practices quite frequently As larger and larger projects are devel- php|architect Volume III - Issue March, 2004 Publisher Marco Tabini Editorial Team Arbi Arzoumani Peter MacIntyre Eddie Peloke Graphics & Layout Arbi Arzoumani Managing Editor Emanuela Corso Director of Marketing J Scott Johnson scott@phparch.com Account Executive Shelley Johnston shelley@phparch.com Authors John Coggeshall, John Holmes, Dr James McCaffrey, George Schlossnagle, Alessandro Sfondrini, Chris Shiflett, Andrea Trasatti php|architect (ISSN 1709-7169) is published twelve times a year by Marco Tabini & Associates, Inc., P.O Box 54526, 1771 Avenue Road, Toronto, ON M5M 4N5, Canada Although all possible care has been placed in assuring the accuracy of the contents of this magazine, including all associated source code, listings and figures, the publisher assumes no responsibilities with regards of use of the information contained herein or in all associated material Contact Information: General mailbox: info@phparch.com Editorial: editors@phparch.com Subscriptions: subs@phparch.com Sales & advertising: sales@phparch.com Technical support: support@phparch.com Copyright © 2003-2004 Marco Tabini & Associates, Inc — All Rights Reserved Continued on page March 2004 ● PHP Architect ● www.phparch.com NEW STUFF N E W S T U F F What’s New! ing the ability to access low-level socket operations on streams PHP 5.0 Beta PHP.net has announced the release of PHP 4.3.5 RC1 This fourth beta of PHP is also scheduled to be the last one (barring unexpected surprises, that did occur with beta 3) This beta incorporates dozens of bug fixes since Beta 3, rewritten exceptions support, improved interfaces support, new experimental SOAP support, as well as lots of other improvements, some of which are documented in the ChangeLog Some of the key features of PHP include: • PHP features the Zend Engine • XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library (http://www.xmlsoft.org/) • SQLite has been bundled with PHP For more information on SQLite, please visit their website • A new SimpleXML extension for easily accessing and manipulating XML as PHP objects It can also interface with the DOM extension and vice-versa • Streams have been greatly improved, includ- March 2004 ● PHP Architect ● www.phparch.com PHP.net also announced the release of PHP 4.3.5 RC This will be the last release candidate prior to the final release, so please test it as much as possible For more information visit http://www.php.net/ ZEND Optimizer 2.5.1 Zend has announced the release of Zend Optimizer 2.5.1 Zend.com describes the Optimizer as: "a free application that runs the files encoded by the Zend Encoder and Zend SafeGuard Suite, while enhancing the running speed of PHP applications Benefits: • Enables users to run files encoded by the Zend Encoder • Increases runtime performance up to 40%." Get more information from Zend.com NEW STUFF Zend Launches New PHP5 In-Depth Articles Section Zend Technologies have launched a new version of their Developer's Corner on the zend.com website PHP5 In-depth showcases articles from many well-known PHP authors on the new features of PHP For more information, check out http://www.zend.com/php/in-depth.php DEV Web Management System Dev is small, but powerful and very flexible content management system for web portals System is licensed as freeware under the terms of GNU/GPL license It is absolutely free for non-commercial and commercial use Based on php4 + MySQL technology This project allows the user to publish articles, evaluate article by taking the pool, publish short news and create back-ends in xml format, manage download lists, Manage advertisement on your site, Be informed about events on your site, create system reports and export them into MS Excel or XML format and much more For more information visit: http://dev-wms.sourceforge.net/ PhpMyAdmin 2.5.6 Phpmyadmin.net has released their latest version of phpMyAdmin PHPMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web "Welcome to this new version, aimed at stabilization of the 2.5 branch Meanwhile, work is continuing on the new 2.6 branch PhpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields." For more information visit: www.phpmyadmin.net PhpSQLiteAdmin 0.2 PhpSQLiteAdmin is a Web interface for the administration of SQLite databases Version 0.2 comes with some new features and a lot of internal cleanups and refactoring PhpSQLiteAdmin is still in an early stage of development It comes free of charge and without warranty For more information visit: www.phpsqliteadmin.net phpMyEdit 5.4 phpMyEdit generates PHP code for displaying/editing MySQL tables in HTML All you need to is to write a simple calling program (a utility to this is included) Looking for a new PHP Extension? Check out some of the latest offerings from PECL ps 1.1.0 ps is an extension similar to the pdf extension but for creating PostScript files Its api is modeled after the pdf extension Memcache 0.2 Memcached is a caching daemon designed especially for dynamic web applications to decrease database load by storing objects in memory This extension allows you to work with memcached through handy OO interface This extension allows you to call the functions made available by libstatgrab library POP3 1.0 The POP3 extension makes it possible for a PHP script to connect to and interact with a POP3 mail server It is based on the PHP streams interface and requires no external library Fileinfo 0.1 This extension allows retrieval of information regarding vast majority of file This information may include dimensions, quality, length etc Additionally it can also be used to retrieve the mime type for a particular file and for text files proper language encoding March 2004 ● PHP Architect ● www.phparch.com NEW STUFF It includes a huge set of table manipulation functions (record adition, change, view, copy, and remove), table sorting, filtering, table lookups, and more Several minor bugs were fixed A few new options were added Major features include tabs support, the ability to specify SQL expressions for fields when writing to the database, the ability to define new triggers, and more All eval() calls were removed due to security and performance reasons Some code was optimized Several parts of the documentation were updated A lot of new language files were added and updated For more information visit: http://platon.sk/projects/ phpMyEdit/ ionCube Releases New Encoder UK-based ionCube has released a new version of their compiled code PHP encoding tools New features include a choice of ASCII or binary encoded file formats and optional support for OpenSource extensions such as mmcache Prices start at a special price of $159 in their March 20% off sale For further information, please visit the homepage of the Encoder: Editorial: Contiuned from page oped using PHP, serious testing processes are going to become an integral part of every good developer's arsenal of programming tools What we never quite considered is that PHP is a great testing platform even for those projects that are not written using it Thankfully, James McCaffrey came to the rescue and provided us with a wonderful article on the subject Our final article this month is about the new Tidy extension, which author John Coggeshall has recently introduced in PHP You may have already heard about the Tidy project, which provides a series of libraries capable of parsing and automatically required documents written in markup languages like HTML or XML Tidy brings an important set of capabilities to PHP, and I'm happy to have the author of the extension introduce us to it That's it for this month—time for me to go tend to my sunburn while I start working on the next issue Until then, happy readings! http://www.ioncube.com/sa_encoder.php php|a Check out some of the hottest new releases from PEAR Mail_Queue 1.1 Class to handle mail queue managment.Wrapper for PEAR::Mail and PEAR::DB (or PEAR::MDB).It can load, save and send saved mails in background and also backup some mails The Mail_Queue class puts mails in a temporary container waiting to be fed to the MTA (Mail Transport Agent) and send them later (eg every few minutes) by crontab or in other way XML_Transformer 0.9.1 With the XML/Transformer class one can easily bind PHP functionality to XML tags, thus transforming the input XML tree into an output XML tree without the need for XSLT Net_LMTP 0.7.0 Provides an implementation of the RFC2033 LMTP using PEAR's Net_Socket and Auth_SASL class Text_Wiki 0.8.3 Abstracts parsing and rendering rules for Wiki markup in structured plain text March 2004 ● PHP Architect ● www.phparch.com Connecting to Amazon.com Web Services with NuSOAP F E A T U R E by Alessandro Sfondrini Have you ever wanted to add an online shop to your website but gave up on the idea because you lack the expertise and resources to run it? Using SOAP, you can connect to Amazon Web Services and create a PHP application to remotely browse and search products, add them to Amazon shopping carts or wish lists and, yes, you can even earn money on every purchase performed from your site I n the article "Exploring the Google API with SOAP," which appeared in the January issue of php|a, I showed you what SOAP is and how it can be used together with PHP We used a SOAP-encoded document to perform a search using the Google Engine, then we parsed the response to display the results on our website To perform these operations, we wrote an application from scratch; this approach can be great to understand how SOAP works, but when a customer asks you to implement a SOAP-based feature in an application, you can't waste your time in that way In this case, there are some libraries that will make your coding quicker and easier: one of these is NuSOAP, which allows you to send Remote Procedure Calls (RPCs) over HTTP This article will show you how we can use the Amazon.com API with NuSOAP to perform searches and display product details, without having to sort through a lot of SOAP syntax: if you have had an opportunity to read my previous article, you will notice how much shorter an application written this way is, and how much time can actually be saved by using this method What are Amazon Web Services? Amazon.com is one of the most widely known on-line shops You can find and buy almost everything, from books to toys to power tools Several years ago, Amazon launched a very successful affiliate program, which they later expanded in their Web Services program Why would you want to use Amazon Web Services March 2004 ● PHP Architect ● www.phparch.com (AWS)? For instance, if your website is about Literature, you may want to allow your users to look for books in the (huge) Amazon database directly from your pages, without redirecting them to Amazon.com You can provide them with a detailed description of each book and, when they decide to buy one, you can add it directly to their Amazon shopping cart When the time comes to complete the purchase, you can redirect the user directly to the Amazon website, where the checkout process actually takes place and you receive credit for your affiliate referral It is important to understand that AWS are designed only to retrieve information about products and create, as well as populate, shopping carts, not to perform payments: this must be done directly on the Amazon website-the reason being, of course, one of security for the customer's personal information In any case, a significant portion of the transaction is performed from your website This results in a benefit both for you and for your users, since you can offer your customers a nearly seamless user experience and collect your referral fees Access to AWS, as well as to the affiliate program, requires you to register with the Amazon Associates Program and obtain an Associates ID, which will identi- REQUIREMENTS PHP: 4.1 and higher OS: Any Other software:: NuSOAP 0.6.4 Code Directory: webs-nusoap ... Enumerations—Enumerators allow you to specify how many times a character class or sub-pattern appears This allows for conven- 17 FEATURE Matchmaker, Matchmaker Make Me A Match Second, if you test this pattern... control chatacter Matches any character :digit: Any digit (same as \d) \w An alphanumeric character or the underscore character :graph: Any alphanumeric or punctuation character \W Anything not a \w... PHP based applications Please visit http://www.favorhosting.com/phpa/ call 1-866-4FAVOR1 now for information March 2004 ● PHP Architect ● www.phparch.com 15 Matchmaker, Matchmaker Make Me A Match

Ngày đăng: 11/12/2013, 02:15

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan