Skip to content
jstrese edited this page Oct 13, 2011 · 3 revisions

Programming TODO

PHP 5.3

With the introduction of PHP 5.3 there were several changes that could be implemented into NGen to improve performance. There were also a couple of syntax modifications that could be used iirc.

Error Display

This is still problematic in several scenarios.

  • Pinpoint scenarios that make our error handling fail
  • Implement measures or re design our model to support these scenarios

Sessions

Ensure that the Session "driver" is finished and is feature complete (for now).

Database Drivers

The current database "drivers" are very, very lacking. They need to be more beneficial, as they seem like stumps right now..

Smarty 3.0 -> 3.1

Convert our current Smarty 3.0 implementation to Smarty 3.1.

Important 3.1 changes can be found in the Smarty directory.

Notable changes include

  • Changes to the cache system
  • Interaction with Smarty's cache system WILL be broken until updated to adhere to the 3.1 changes
  • Certain properties are only accessible via getters/setters now
  • NOTE: While accessible through the variable, they still get passed through getters/setters so it's more efficient to use the setters/getters

Documentation / Managerial Improvements

Eliminate global functions

Encapsulate the current global functions in a static class.

Update PHPDoc

Some files still have old documentation that needs to be updated to reflect current class names, file hierarchy, and functionality.

Construct a README

A README should be constructed for GitHub.. because it wants one!

Improve coding consistency

Attempt to adhere to the Zend Framework coding style a little more.

<?php
// Only 1 class is permitted per file
class exampleClass
{
    // Notice how the brackets are on a new line
    // only class and function brackets do this.

    // Private and static variables should start
    // with an underscore.
    private $_arga = null;
    static  $_argb = null;

    // Public variables do not start with an
    // underscore. Public variables are
    // discouraged in favor of getters/setters.
    public $argc   = null;

    /**
     *  All functions, classes, and variables should
     *  have valid PHPDoc documentation attached
     *  to them.
     */
    public function fooBaz($argBaz)
    {
        // If/Else/Elseif statements should have
        // a space before and after the parentheses
        // and the first bracket should be on the
        // same line as the IF.
        if ($argBaz === true) {
            return false;
        }

        return true;
    }
}

function exampleFunction($arga)
{
    return $arga;
}
//don't use ?>, it's unnecessary and can cause unforeseen issues