You are on page 1of 5

SkullPuppy

version 1.0
A PHP Application Framework Released by Flying Monkey Army

Technical Documentation

December 2009

SP_Base
Public Functions:
__construct ( array $config ) When initializing the base class, you can specify an array of configuration options that can later be modified or retrieved using the setConfig() and getConfig methods respectively. setConfig ( string $option, $value ) This method sets or modifies one of the configuration settings for a base class. getConfig ( [ string $option ] ) This method retrieves the values set in one of a base class' configuration settings.

SP_Event
Public Functions:
bind ( ) setConfig ( $option, $value ) getConfig ( [ $option ] )

static SP_HTTP
Public Functions:
location ( string $link ) The location method will send page headers to redirect a page to the given link value. The link must be a controller action value and can be given in the following format: ?controller&action&varibale=value post ( string $url, $data ) This method allows you to post data to a URL resource. The value of data must be a URLencoded query string. Once finished, it will return the content of the page, otherwise false for a failure.

static SP_Registry
Public Functions:
setKey ( string $key, $value ) This method sets a key to the given value

getKey ( [ string $key ] ) This method retrieves the value of a key stored in the registry. If no key is specified, it will return an associative array of the entire registry. yesno ( $value ) This method will return a 'yes' or 'no' for the given value. r_yesno ( $value ) This method will return an int 1 for 'yes', or an int 0 for 'no'.

SP_SQL
Public Properties:
id result resource

Public Functions:
__construct ( [string $server, string $username, string $password] [, boolean $load_auth] ) When initializing the SP_SQL class, it will attempt to make a connection to a SQL database using the settings stored in this class. These settings can be loaded from the Registry, specified using the class' methods, or manually passed to the constructor's parameter list. The $load_auth parameter can either be listed 4 th (after $server, $username and $password) or by itself as the only paramter. By passing AUTO_LOAD to this parameter, it will automatically load the authentication information from the Registry. If no parameters are passed, it is assumed that the $load_auth param is true. setDb ( string $database ) Using this method will set the active database you are querying against on your db server. query ( string $query_string [, constant $type ]) This method executes a SQL query against the database. The value of $type defines the type of array to be returned in the result. It takes one of the followinf values: MYSQL_ASSOC, MYSQL_NUM, or MYSQL_BOTH. If $type is left empty, it defaults to MYSQL_BOTH.

static final SP_Version


Public Functions:
checkVersion ( string $version ) This will check the current version of SkullPuppy against the version number you specify. If the version is equal to or newer than the version specified, then it will return true. If SkullPuppy is

older than the version specified it will return false.

SP_View
Public Functions:
render ( ) Calling this method will render the output for the current view object. setScript ( string $value ) This method is used to change the values of the view script. getScript ( ) This method retrieves the value of the current view script.

SP_Security_Auth
Public Functions:
setUsername ( string $username ) Using this method sets the username for the security object. getUsername ( ) This retrieves the username of the security object. isPassword ( string $password [, resource $sql_object ] ) This method will compare the given password to a password retrieved from a SQL database. By default, it will use the settings from the Registry to determine the login credentials and the database to connect to. If you specify a SQL resource object, it will use that object to connect with instead. mkPassword ( string $password ) The return value of this method will be a hash of the given password value. setGroups ( string $username ) Using this method sets the user groups for the security object. getGroups ( ) This method retrieves the user groups of the security object. setStatus ( string $username ) Using this method sets the user status for the security object. getStatus ( ) This retrieves the user status of the security object.

ImportSession ( [ string $prefix ] ) This method will set the username, groups and Status of the security object using values taken from the current session. By default, it searches for the session variables username, groups, and status to fulfill this task, but you can adjust the variables it searches for by adding a prefix to the variable name and specifying that in the method parameter. exportSession ( [ string $prefix ] ) Using this method will fill the session variables username, groups, and status with data from the security object's protected properties. If you specify a prefix in the method parameter, it will adjust the name of the session variables it will overwrite with the prefix you specify.

static final SP_Security_Crypt


Public Functions:
hash ( string $algorithm, string $string [, $key ] ) Creates a hash of the supplied string using the given algorithm and optional key. crypt ( string $mode, string $string [, string $key ] ) Use this method to encrypt or decrypt strings in 3Des using and optional key.

SP_Security_Parse
Public Functions:
mq ( string $variable ) Use this method to Make Query-able a given variable or array. This will add slashes to the value of the given variable or to the values of all its indexes if it is an array. secure ( string $variable , string $expression ) Use this method to restrict the types of characters allowed in a given variable. Any characters that are not expressly allowed with be stripped out. For example, if you have a variable called $myID and wish to allow only numbers, you would pass the following: SP_Security_Parse::secure($myID, 0-9); get ( ) This will return a query-able version of all $_GET variables. post ( ) This will return a query-able version of all $_POST variables. date ( ) This method returns the current date and time in the following format: "Y-n-j G:i:s"

You might also like