GhostMVC: Difference between revisions

From Adam Colton
Jump to navigation Jump to search
Line 80: Line 80:
==Installer==
==Installer==
This needs to be updated and I really need to give some more thought to the user module. Also, might be nice to include some other modules (though I don't know what).
This needs to be updated and I really need to give some more thought to the user module. Also, might be nice to include some other modules (though I don't know what).
===User Model===
Based off Moon-Jumper user.
Properties
*email
*name
*passhash
*salt
*hash algorithm
*id
Methods
*User User(name, password, email="") --How to return errors?
*User User::Get(name, password)
*User User::GetByEmail(email, password)
*errorArr setEmail(email, sendConfirm=true)
*errorArr User::ConfirmEmail(hash)
*errorArr changePassword(password)
*errorArr changeName(name)
*errorArr sendResetPassword(email)
*errorArr User::ConfirmResetPassword(hash)


==Module Names==
==Module Names==

Revision as of 12:52, 27 July 2012

GhostMVC IDE

Core

Use a profiler on some basic pages to see what takes the most time. Any improvements to the core could be substantial.

Add subdomains to usable data

Add a wildcard character to routes to limit to exact match (no trailing data). Use case: if I want to route all traffic of a certain type from [SiteRoot]/[Model] to a specific function (other than index) I cannot because it will still match [SiteRoot]/[Model]/[Method].

Hook for libraries to call when they are loaded and when the call is closing (after the "after" hook).

Move Home_Controller, Defualt_controller and Default_method to hooks

Add useful errors:

  • When including anything, do a try

After the route has been determined, clear out the route object to clear up memory.

Add HTTP verbs to routing.

Create a redirect at the same level as view

Libraries

Look into memcache, output buffering

Database

  • Finish 'having' functions in database library
  • Update database library to throw useful errors
    • data array is not included in update
  • Database to support limits
  • Multiple inserts
  • Database row and row_array (only returns one and auto-adds "limit 1")
  • Find a way to make database connections persistent in such a way that the user can have several, they will open as needed, close (via hooks) and can be used for mysql_real_escape_string.
  • Database Where to accept associative array or key value pairs
  • Allow subqueries using Database library objects.
  • Store all the values and run mysql_escape against them right before the query is run.

(this requires the the library hook in core) Have the constants defined with tails so that MYSQL_HOST becomes MYSQL_HOST_DEFAULT allow a range such as MYSQL_HOST_QUIZ, MYSQL_HOST_JOURNAL (using Moon-Jumper as an example). User the constant function (http://dk.php.net/manual/en/function.constant.php) to dynamically access them. Store each connection persistently in an array indexed by host and user, then close all the connections when the request finishes (or allow the user to manually close the connections early).

Parameterized SQL

Use PDO. Seems simple enough, put ? where user data goes then bind data to position. The important (and tricky) part is keeping the data in order so that it will line up with the correct position. http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/

http://projects.adamcolton.net/pdo/

Layout

Need to finish (and touch up) the html class.

Allow user to set headers and return codes.

Validation

Add phone numbers, sql-scrubbing... Look up common regex patterns and add those in. Some sort of a mass form validator would be nice, with the ability to pass back an array of errors.

Utilities

Edit

Add 'New' buttons to model, view, controller and resources in Edit utility.

Move this into a more IDE like environment with the files in an UL on the left and the editor being tabbed (possibly split-able).

Test Framework

Good base class, need to rename a lot of the methods to follow the camel casing that I choose. I also want to finish turning this into a real test interface where I can run a subset of tests.

For a first step, I would like to detect anytime a model or test is updated (by last modified date) and automatically re-run the tests when it changes. This way, every time I upload code, the unit tests will be run automatically. This could be very cool because I could set up the page on another computer or a tablet and it will provide feedback while I work.

Form Utility

Form builder utility. Select the controller, name the form (used as function name, view name and form id), add inputs and select their type. The utility automatically stubs out the view, both controller methods (name and _name) and the submit hook so that the post variables are passed as arguments.

Publish Utility

Use FTP to publish to another destination. Needs a process for 'popping' configs off a stack. Allow user to show all files, different by date, different by size and both. Use this (http://scrivna.com/blog/php-file-diff) to show the file differences.

Database

Add modify table to database utility

Move the whole thing into more of a tabbed view (rather than modal). So that you can see each table, keep queries that you've run around. A query builder would be nice.

Allow Database::select to be used for where_in.

For debugging, create a logging option that will store all queries in a log.

Installer

This needs to be updated and I really need to give some more thought to the user module. Also, might be nice to include some other modules (though I don't know what).

User Model

Based off Moon-Jumper user.

Properties

  • email
  • name
  • passhash
  • salt
  • hash algorithm
  • id

Methods

  • User User(name, password, email="") --How to return errors?
  • User User::Get(name, password)
  • User User::GetByEmail(email, password)
  • errorArr setEmail(email, sendConfirm=true)
  • errorArr User::ConfirmEmail(hash)
  • errorArr changePassword(password)
  • errorArr changeName(name)
  • errorArr sendResetPassword(email)
  • errorArr User::ConfirmResetPassword(hash)

Module Names

One principle I like is to give things gibberish or unrelated names rather than meaningful but generic names (think about Access, it makes searching and naming difficult). For that reason I want to pull in names of ghosts and ghost-like things to name them.

  • Test Framework - Osiris (Egyptian god that tests spirits for the afterlife)
  • Jacob Marley (ghost from A Christmas Carol)
  • Casper
  • Banshee (wails when someone is about to die, maybe an error catching framework)