Nephtali

A PHP web framework that functions beautifully

Nephtali

Download Nephtali

Download the most recent release of Nephtali [ nephtali_3_0_7.zip (62.6 KB) ] from Google Code.

No, Nephtali isn't another MVC framework, so please keep reading. Nephtali is a PHP framework that takes inspiration from the new functional capabilities of PHP 5.3 and newer, provides a simple API contained within one file, and utilizes a micro controller architecture with embedded views. A quick list of features includes:

  • Integrated input validation and automatic output escaping.
  • Restful input validation, html fragment retrieval, and debugging all automatically provided.
  • Markup and PHP are cleanly separated.
  • Micro-controllers (as opposed to page- or front-controllers) handle the display of page regions, allowing fine-grained reuse and region-specific error handling.
  • Try generating the PHP code using Nedit, Nephtali's web-based code generator. You can quickly generate the core code for your pages and then refine it to meet your custom needs.

Markup for pages is placed in a novel location these days:
Within the page of the requested resource.

Nephtali uses XML comments to map out dynamic regions of pages, making it very easy to work with your favorite editor and craft the markup just as you want (no sifting through PHP.)

 <!--pipe:announcements-->
     <!--view:default-->
     <h3>Announcements</h3>
     <ul>
         <!--data-->
         <li><h4><a href="{link}">{title}</a></h4>
             <p>{description}</p>
         </li>
         <!--data-->
     </ul>
     <!--view:default-->
 <!--pipe:announcements-->

Nephtali automatically provides REST-ful API access to the dynamic content regions (pipes) and data validation rules (ports) of any page.

For an example, you can view the html fragment for the announcements column on this page, or view the JSON error feedback for an invalid search (longer than 50 characters) using the search form on this page.

Utilizing the javascript library of your choice, you can easily utilize the API to implement client-side input validation (Nephtali does provide a plugin for jquery that facilitates this work), or update the state of the content of the current page without requesting a new page.

A team of security experts created a list of top-25 security issues. Nephtali was designed from the ground up to help developers address these issues, including:

  • Integrated input validation and XSS filtering (CWE-20 and CWE-79, respectively.)
  • Server-side validation automatically provides REST-based calls for form validation, enabling progressively enhanced, client-side validation (CWE-602.)

  • File uploads are automatically checked for path issues (CWE-73.)
  • Automatic output escaping (CWE 116.)
  • Error handling for each individual dynamic region of a page (CWE-209.)
  • Strong encryption facilitated (CWE-327.)
  • DB functions make use of PDO prepared statements to prevent SQL injection (CWE-89), and the namespace is composed of read-only functions (sources), and write functions (actions), avoiding use of unnecessary privileges (CWE-250.)

Additionally, Nephtali constitutes a relatively small, simple code base and no feature was (or will be) added without careful analysis in light of Nephtali's security directives.

Screenshot of debug outputOne of the most important features of any development environment is the ability to quickly identify why things aren't working. Nephtali comes with the ability to turn your web browser into your debug output display.

When running in 'dev' mode, Nephtali saves information on the last 10 requests to pages in the site, including the Get, Post, Cookie and Session variables, the Nephtali ports (ports handle input validation in Nephtali for Get, Post, Cookie, and File data), and watched variables [i.e., variables you've added to the debug output with the function n\watch().]

You merely add the get variable nmode=debug to any PHP page to view output. For the sake of demonstration, the Nephtali website is running in 'dev' mode, so you can view a live version of debug output automatically available in any Nephtali website. Just pop the link open in a new tab and browse around the site to see the feedback (you'll have to refresh the page to see the most recent records.)

In his book entitled "The Elements of User Experience", Jesse James Garrett states that the user experience design process "is all about ensuring that no aspect of the user's experience with your site happens without your conscious, explicit intent." This is a tall order for some web frameworks, as this requires tremendous flexibility.

Does your web framework allow you to build upon the work already completed by information architects, UX professionals, front-end developers, and graphic designers, or does it require everyone to follow its lead?

Because Nephtali makes no assumptions about the any aspect of the application design, it can be inserted into any step of the user experience design process without issue. All of the HTML prototype code can be used as is by merely adding a few html comments. All of the current directory structure can be used as is. The javascript code can be used as is. The web forms can be used as is.

In short, Nephtali frees you from having to worry about whether something will work with your web framework and lets you focus on the most important question:
Will this work well for my users?

Installing Nephtali takes a couple minutes.

  1. Download the latest release of Nephtali
  2. Unzip it and upload setup.php to the public directory of your site.
  3. View setup.php in your browser and follow the instructions.

(The upgrade process for this PHP framework is even easier.)

Recent blog entries

  • Templates are here

    As I was working on integrating the caching capabilities (coming soon), I realized I should have a firm grasp of what any templating system might be. And, as I “mighted” through a few days, eventually the templating system simply was Check it out, it’s simple, relatively efficient, and you can even nest templates if [...]

  • What’s coming next?

    Currently I’m working on integrating a caching mechanism that will automatically integrate your tool of choice (APC, memcache, etc.) at several possible levels of granularity within a page request (whole page, pipe region, persistence.) I hope to have the caching integrated within the next 2 weeks. Once I have the caching in place, I would like [...]

  • Hooray! CPanel now supports PHP 5.3

    I’ve been eagerly following the thread over at cPanel.net that was detailing progress on support for PHP 5.3. Today I noticed support was here starting with PHP 5.3.1. CPanel powers many webhosts, and this support means that the new capabilities of PHP 5.3 are now coming to the masses. I’m hopeful web hosts will beginning offering [...]

  • Accommodating SVG in (X)HTML 5

    (X)HTML 5 is just around the corner, and the improved support for SVG is impressive. However, HTML 5 has been a moving target for quite some time, and full support for the new features will take some time. In terms of current SVG support, it appears that browsers that build on Webkit (e.g., Safari, Chrome) will [...]

  • Parallel processing for web requests

    The newest release of Nephtali takes a new approach to parallel processing. In the earlier releases, Nephtali made it easy for the developer to make any pipe process in parallel, but this came at a great cost to the server. Running a fast server, this would still lead to better page-load times. However, if resources were [...]

  • Wiki now in place for documentation

    Well, those who know me know I’m not great at keeping up on documentation. Those days are hopefully over. The most recent release of Nephtali includes docblocks, which will be used to generate Javadoc-like documentation for the site. Additionally, the documentation section of the website is now a wiki, so hopefully those who benefit from Nephtali [...]

  • Adios, objects.

    Nephtali has gone through many transitions, and the most recent involves a complete refactoring of the code-base to make use of the new namespace features and functional programming enhancements ushered in by PHP 5.3. So, those stuck in server environments without PHP >= 5.3 will not be able to install the most recent release of [...]

Sites using Nephtali

  • Nephtali

    THE website for information on the nephtali web framework. Yes, we eat our own dogfood and love it :)

  • Audible Business

    Nephtali powers the online ordering tools for clients allowing them to conveniently make orders in a few simple steps (clients only.)

  • Rogers Wildlife Art

    The site incorporates a simple admin that allows the artist to manage the sculptures displayed on the site. Nephtali also provides the search and contact form capabilities.

  • Community Economic Development Association of Michigan (CEDAM)

    Nephatli powers the various feeds and client admin and members-only section for the site.

  • Michigan Humanities Council

    Powers a custom admin, site search, and RSS feeds.

Copyright © 2007 - 2009, Adam J. Richardson of Envision Internet Consulting, unless otherwise noted.
A special thanks to Davin Granroth for tolerating hours of incessant questions.

The Nephtali web framework is released under the MIT License.