Hands-on Testing with PHPUnit How-to – A short, well-focused guide – #programming #bookreview

Instant Hands-on Testing with PHPUnit How-to
A practical guide to getting started with PHPUnit to improve code quality
Michael Lively
(Packt Publishing – paperback, Kindle)

PHPUnit is considered by many to be the leading tool for testing PHP code. This “Short, Fast, Focused” book (82 pages digital, 69 pages in paperback) is a recent addition to Packt Publishing’s “Instant” series. It zeroes in on how to install and use PHPUnit to create and run “easy-to-maintain tests.”

One strength of Michael Lively’s new book is his experience with PHP and PHPUnit. Another strength is the book’s step-by-step structure. It rates each key step as “Simple”, “Intermediate”, or “Advanced” and provides subheadings such as “Getting ready…”, “How to do it…”, “How it works…”, and “There’s more…” to help keep descriptions short and clear.

Code examples and screenshots also help the reader get comfortable with running tests using the PHPUnit framework.

Aside from skipping commas in some of the text, Michael Lively’s writing is clear and concise, and his descriptions and code examples have been reviewed by two experienced software developers.

The book is “written for anyone who has an interest in unit testing but doesn’t necessarily know where to start in integrating it with their project,” Lively states.

“It will provide useful tips and insights into how PHPUnit can be used with your projects and it should give you enough information to whet your appetite for the various features offered by PHPUnit.”

The code examples in Lively’s book “were written using PHP 5.3.24 and PHPUnit 3.7. All code samples were verified against a Linux box with Ubuntu 12.04 LTS.”

As with several other Packt books recently reviewed, if you use a Windows PC or a Mac instead of a Linux system, you pretty much are left on your own to figure out the installation process and certain commands.

—   Si Dunn

WordPress: The Missing Manual – Covers what you need to know & can profit from – #bookreview

WordPress: The Missing Manual
Matthew MacDonald
(O’Reilly, paperbackKindle)

It’s easy to set up and launch a basic WordPress blog. But once you do, it’s also very easy to just keep blogging and ignore the many other options and features that WordPress offers. (I’m guilty of that, which is why I’m happy to see this book.)

If you want to know more about how to use WordPress or how to improve the appearance of an existing blog, WordPress: The Missing Manual definitely should be in your hands.  Matthew MacDonald’s new book is well-written, heavily illustrated, and packed with good how-to steps and tips.

Many small businesses and numerous large companies also use WordPress to provide some or all of their web presence. MacDonald’s 545-page how-guide has essential information for these users, too.

The book is organized into five parts:

  • Part One: Starting Out with WordPress – Covers key decisions you should make before starting to use WordPress.
  • Part Two: Building a WordPress Blog – The blogging-on-WordPress basics are presented here. But: “Even if you’re planning something more exotic than JAWB (Just Another WordPress Blog, don’t skip this section,” the author urges. “The key skills you’ll learn here also underpin custom sites, like the kind you’ll learn to build in Part Four of the book.”
  • Part Three: Supercharging Your Blog – Explains how to use plug-ins to add new features to your self-hosted blog site. Shows “how to put video, music, and photo galleries on any WordPress site. Covers “how to collaborate with a whole group of authors…and how to attract boatloads of web visitors….”
  • Part Four: From Blog to Website – Shows how to “take your WordPress skills beyond the blog and learn to craft a custom website” with WordPress at its heart.
  • Part Five: Appendices – Appendix A “explains how to take a website you created on a free WordPress.com hosting service and move it to another web host to get more features.” Appendix B, meanwhile, gathers up the “useful web links” scattered throughout the book and puts them into one place organized by chapter. A link also is provided where this collection of links can be downloaded.

How popular is WordPress? It is, according to MacDonald, “ridiculously popular…stunningly popular…responsible for roughly one-sixth of the world’s websites….And one out of every five new sites runs on WordPress….”

If you choose to go the WordPress route, be sure you have WordPress: The Missing Manual with you.

Si Dunn

CouchDB and PHP Web Development Beginner’s Guide – #programming #bookreview

CouchDB and PHP Web Development Beginner’s Guide
Tim Juravich
(Packt Publishing, paperbackKindle)

CouchDB and PHP can be a formidable team when used to create web applications. 

“CouchDB is a database that completely embraces the web,” according to the Apache CouchDB website. Data is stored with JSON documents; documents can be accessed with a web browser via HTTP; and JavaScript can be used to “query, combine, and transform” documents. “You can even serve web apps directly out of CouchDB,” the site states.

Meanwhile, PHP is “a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML,” its website notes.

The new CouchDB and PHP Web Development Beginner’s Guide by Tim Juravich is an excellent source for learning how to make the two packages work together. His focus, in the book, is on developing and honing skills by discovering “the ins and outs of building a simple but powerful website using CouchDB and PHP.”

After installing CouchDB and PHP, you learn how to create and enhance a simple, Twitter-like social network called “Verge.” It is an application that “will allow users to sign up, log in, and create posts,” the author states.

CouchDB and PHP Web Development Beginner’s Guide is available through Amazon, Barnes & Noble, and Safari, and also can be ordered direct from the Packt Publishing website in digital formats as well as print.

The book is packed with how-to steps and explanatory details. And it is organized into 10 well-defined chapters.

  • Chapter 1: Introduction to CouchDB
  • Chapter 2: Setting up your Development Environment
  • Chapter 3: Getting Started with CouchDB and Futon
  • Chapter 4: Starting Your Application
  • Chapter 5: Connecting Your Application to CouchDB
  • Chapter 6: Modeling Users
  • Chapter 7: User Profiles and Modeling Posts
  • Chapter 8: Using Design Documents for Views and Validation
  • Chapter 9: Adding Bells and Whistles to Your Application
  • Chapter 10: Deploying Your Application

A key strength of this book is its structure and use of focused headings. For example, when it is time to do something at your computer, there is a “Time for action” heading, such as: “Time for action – creating new databases in CouchDB.”

The step-by-step procedures that you then perform are laid out clearly in numbered order. And you get more than a brief description or illustration of what is supposed to happen. Juravich follows up with summary paragraphs labeled “What Just Happened?”  These summaries describe the purposes of the steps just performed and what they achieved.

Also, at the end of each chapter, he includes a helpful summary of the key points he has covered.

CouchDB and PHP Web Development Beginner’s Guide is well written and follows a classic and effective teaching model: “Tell them what you are going to tell them, tell them, and then tell them what you just told them.”

Its example code files can be downloaded from the Packt website or sent to you by email after you have registered with Packt.

The second chapter includes instructions for installing Apache, PHP, Git (for version control), and CouchDB on Windows, Linux and Mac OS X machines. But it is worth noting that the author restricts most of his discussions to the Mac OS X operating system (10.5 and later) and uses Mac OS command line statements “for simplicity and brevity.”

Windows and Linux users likely will have to do some command-line translations and work with files in different locations than described. Newbies with Windows or Linux machines should wait and gain more command-line experience first or find a mentor who knows both Mac OS X and Windows or Linux before tackling this book.

Maybe someone will write a similar CouchDB-PHP book for Windows and/or Linux users soon?

Si Dunn

Drupal for Designers – Putting Drupal to work, with good planning and design up front – #bookreview

Drupal for Designers
Dani Nordin
(O’Reilly, paperbackKindle)

Drupal has (1) a lot of fans, (2) a lot of people who wonder what the heck it is, and (3) a lot of people who complain about it.

Sometimes, a Drupal user is each of these at the same time.

Officially, Drupal is “an open source content management platform powering millions of websites and applications.” Thousands of add-on modules and designs are available, and individuals, groups, organizations and companies use Drupal “to build everything from personal blogs to enterprise applications.” Indeed, some big and well-known sites use Drupal, including The Economist, Examiner.com and the White House, to name a few.

There is a learning curve, but Drupal specialist Dani Nordin’s new book can help you (1) get started with Drupal, (2) help you wrap your mind “around the way Drupal handles design challenges,” and (3) help you master important techniques and tools. You will also learn the importance of doing detailed site planning first and keeping up with version control, even if you are a solo designer.

The book focuses on Drupal 7, but much of the material can be used with Drupal 6. Some parts of the book are “version-agnostic.”

Dani Nordin also offers case studies involving two of her ongoing efforts, so readers can “see how these ideas work in the real world, with all the frustrations and moments of unexpected joy that happen in real projects.”

She adds: “Through these projects, I can show you a typical Drupal design process—from creating the project brief to ideation and sketches to prototyping and applying our look and feel to the site’s theme.”

Drupal for Designers is a compilation of three previous short guides, with new materials added. It is aimed, the author says, at “the solo site builder or small team that’s itching to do interesting things with Drupal but needs a bit of help understanding how to set up a successful Drupal project.”

To work with Drupal, you should have some familiarity with HTML and CSS, and you should be open to learning some PHP.

Drupal for Designers has 303 pages and 22 chapters that are grouped into seven parts:

  • Part 1: Discovery and User Experience
  • Part 2: Sketching, Visual Design, and Layout
  • Part 3: Setting Up a Local Development Environment
  • Part 4: Prototyping in Drupal
  • Part 5: Making It Easier to Start Projects
  • Part 6: Working with Clients
  • Part 7: Sample Documents (for designers, including a project brief, a work agreement, and a project proposal)

There is no one “right” way to use Drupal, the author notes. “Every Drupal designer and site builder has his or her own approach to creating projects….”

But careful planning and design work up front will be essential to your success, she emphasizes.

Si Dunn

PHP & MySQL: Novice to Ninja, 5th Ed. – A popular how-to guide updated – #bookreview #in #php #programming

PHP & MySQL: Novice to Ninja, 5th Edition
Kevin Yank
(SitePoint,
paperback, list price $39.95; Kindle edition, list price $29.95)

A key measure of a programming book’s usefulness and popularity is how many times it has been revised and reprinted.

Kevin Yank’s book first was published in 2001 under a different title. Eleven years later, his newly revised fifth edition is now in print and providing up-to-date hands-on guidance for those who want to use PHP and MySQL to create database-driven websites.  (By some estimates, at least 20 million websites worldwide now use PHP.)

Yank points out that “PHP is a server-side scripting language that lets you insert instructions into your web pages that your web server software (in most cases, Apache) will execute before it sends those pages to browsers that request them.”

Meanwhile, “[a] database server (in our case MySQL) is a program that can store large amounts of information in an organized format that’s easily accessible through programming languages like PHP. For example, you could tell PHP to look in the database for a list of jokes that you’d like to appear on your website.”

Yank’s fifth edition shows you how to use PHP to create a working content management system (CMS) that accesses – no surprise here – an online joke database that’s managed with MySQL. (Of course, if you think a simple joke database is lame, you can always modify a few tables and labels and create something more substantial, such as a database of vegetables you hate or celebrities or politicians you consider utterly irrelevant to your life.) 

Building a joke database (or whatever) is a pleasant way to learn the basics of PHP coding and database design and then quickly start improving your knowledge and skills as the CMS project is expanded and given more capabilities.

Yank’s book has 12 chapters and four appendices. The how-to chapters are split into short paragraphs, with numerous short code examples. A link is provided where the book’s code examples can be downloaded in a ZIP archive. And the book’s text is written in a smooth, approachable style.

PHP & MySQL: Novice to Ninja, 5th Edition is “aimed at intermediate and advanced web designers looking to make the leap into server-side programming,” Yank says. He expects readers to be familiar with “simple HTML” but “[n]o knowledge of Cascading Style Sheets (CSS) or JavaScript is assumed or required.”

He adds, however, “if you do know JavaScript, you’ll find it will make learning PHP a breeze, since these languages are quite similar.”

Si Dunn

MongoDB and PHP – Document-oriented data for web developers – #bookreview #in #programming

MongoDB and PHP
By Steve Francia
(O’Reilly,
paperback, list price $19.99; Kindle edition, list price, $14.99)

You can’t blame Steve Francia for being vocal in his praise for MongoDB®. He’s the chief solutions architect at 10gen, Inc., which develops and supports this well-respected document-oriented database.

One consequence of the current, explosive growth of social media is that “all data and experience [needs] to be personalized – on a large scale,” he writes in his new book, MongoDB and PHP. Today, the data stores and caching techniques used over in the past three decades are losing their ability to keep pace. So: “It was out of this need that MongoDB was created. A database for today’s applications, a database for today’s challenges, a database for today’s scale.”

MongoDB, according to its 10gen, Inc., website, is “a scalable, high-performance, open-source noSQL database,” written in C++. Its features include: document-oriented storage; full index support; replication and high availability; auto-sharding (horizontal scaling with a partitioning architecture); querying; rapid in-place updates; map/reduce (for batch processing of data and aggregation); and GridFS (a specification for storing large files in MongoDb).

Francia explains that MongoDB is a document database. “At the highest level of organization, it is quite similar to a relational database, but as you get closer to the data itself, you will notice a significant change in the way the data is stored. Instead of databases, tables, columns, and rows, you have databases, collections, and documents.”

Meanwhile, in PHP (PHP: Hypertext Processor), “a document is equivalent to an array …,” for all intents and purposes.

PHP, which can be downloaded from this site, “is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML,” according to the PHP Group.

Francia notes in his book that “[i]n MongoDB, the primary object is called a document. A document doesn’t have a direct correlation in the relational world. Documents do not have a predefined schema like relational database tables. A document is partly a row, in that it’s where the data is located, but it’s also part columns, in that the schema is defined in each document (not table-wide)….The best way to think of a document is as a multidimensional array.”

Meanwhile, Francia adds: “Documents map extremely well to objects and other PHP data types like arrays and even multidimensional arrays.” So PHP users contemplating building PHP applications with MongoDB will find that “the PHP array has the closest correlation of any data type. It’s nearly a 1-to-1 correlation.”

His code examples, illustrations and succinct paragraphs show how MongoDB and PHP can work together closely and effectively when building database applications.

If you have been contemplating diving into PHP and/or MongoDB, this is a worthy book to add to your learning and reference collections.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir available soon in paperback. He is the author of a detective novel, Erwin’s Law, a novella, Jump, and several other books and short stories.