Sledgehammer Framework

Application

Interfaces, Classes, Traits and Enums

Component
Interface for the components, the V in MVC.
Controller
Interface for Controllers, the C in MVC.
Document
A Document is a standalone component, that can't be wrapped inside another component.
Import
Iterface for importing request data.
Base
A generic php superclass.
Cache
A Cache node in the Caching graph.
CacheWrapper
Wrap an object inside a CacheWrapper to cache all method calls and properties.
Collection
Collection: Array on Steriods Provides a filtering, sorting, events and other utility functions for collections.
Csv
Een generieke snelle manier om een csv bestand in te lezen.
Curl
Curl, an HTTP/FTP response object Simplifies asynchronous requests & paralell downloads.
Connection
A PDO Database class with additional debugging functions.
DatabaseCollection
DatabaseCollection a Collection interface to a database result.
PreparedStatement
A PDOStatment subclass that logs prepared statements.
SessionHandler
Sessie gegevens 'centraal' opslaan in een database Hierdoor kan een Loadbalancer in 'round robin' mode draaien.
Sql
Query object to mutate and generate (complex) SQL queries.
Statement
PDOStatement override Adds Countable to the Database results.
Autoloader
Load class and interface definitions on demand.
DebugR
DebugR, send additional debugging information via HTTP heders.
Dump
Parses a var_dump() and renders a syntax highlighted version of var_export().
ErrorHandler
Improved errorhandling for php notices, warnings, errors and uncaught exceptions.
Logger
Logging and reporting.
PhpAnalyzer
Statically Analyzes PHP code and collects data about class and interface usage and deflarations.
PhpTokenizer
A tokenizer that gives context to tokens of php internal tokenizer.
Framework
Container voor Sledgehammer Framework functions - Module detection and initialisation - Language & locale initialisation.
Html
Html, a view compatible class for rendering raw html.
HtmlTokenizer
Een tokenizer voor htmlcode.
HttpAuthentication
Basic HTTP autentication.
InfoException
An exception with additonal information for the ErrorHander.
Json
Renders the data as Json Compatible with MVC's the Document/View inferface.
Stopwatch
Helper class for manual performance profiling.
TagIterator
Een iterator die de tags uit htmlcode haalt.
Text
Text, a string class for handeling (multibyte) strings with OOP syntax Modelled after the C# String class.
Url
Utility class for generating and manipulating urls.
CodeAnalysisTest
Scan PHP code for undefined classes.
CompareEnvironments
FlushCache
Delete the contents of the $project/tmp/ or /tmp/sledgehammer-$hash/ folder.
GenerateStaticAutoLoader
Run the generate_static_library.php script from DevUtils.
PearInstaller
PearInstaller, installs PEAR packages into your project folder.
RequiredPhpExtensionsTest
Controleer of alle benodige php extenties geinstalleerd zijn.
Wrapper
Wrap the object/array into container object Allow filters and accesscontrol to any object or array.
Canvas
Drawing lines, rectangles, etc.
Composition
A composition with layers of Graphics objects, which acts as a single graphics object.
Graphics
The Graphics class, the baseclass for all Graphics classes.
Image
An image from a .png, .jpg, .gif, or .bmp file.
TextGraphics
A layer for advanced text rendering.
ThumbnailFolder
Een Virtual folder die aan de hand van de mapnaam de afmetingen van de thumbnail bepaald.
TrueTypeFont
ycTIN - TTF class Get the information tables from TrueType font file.
Video
Uses ffmpeg to extract frames, or to convert a video.
Alert
A single alert message.
Breadcrumbs
Breadcrumb Navigation.
Button
A button element.
DescriptionList
A Description list <dl><dt><dd></dl>.
Dialog
A dialog popup with where selected choice is posted back the server.
Element
Baseclass for components based on an html element.
Form
Generate and import a Form.
Headers
Add Headers to any Component.
HttpError
HTTP error page Sends the correct HTTP header and displays an page with the error.
Input
An <input>, <textarea> or <select> element.
Nav
Nav, tabs, and pills Highly customizable list-style navigation.
Pagination
<< 1 2 3 [4] 5 6 7 8 9 10 ... 42 >>.
Template
Een component voor het weergeven van php-templates.
CrudFolder
Folder for basic CRUD operations on a Repository model.
File
Send a file from the filesystem.
Jsonp
Renders the data as in a Jsonp wrapper.
Page
The container for generating html pages.
Proxy
Serve the http headers and contents of a remote url as a local file.
Redirect
The MVC alternative to the redirect() function.
Xml
Render XML output.
Folder
Superclasse van de Virtuele mappen.
ActiveRecord
An ActiveRecord frontend for the Repository.
ArrayRepositoryBackend
A RepositoryBackend for 1 model stored in an array.
DatabaseRepositoryBackend
Repository backend for database records.
RepositoryBackend
The minimal interface for a (read-only) Repository Backend.
ModelBehavior
Overwrite the behavior for models. Sits bewteen the RepositoryBackend and the Repository.
SoftDeleteBehavior
Instead of deleting a record toggle a flag.
BelongsToPlaceholder
This Placeholder facilitates lazy loading of belongsTo relations.
CollectionView
Extract the key/value of the collection based on a propertypath.
HasManyPlaceholder
This Placeholder facilitates lazy loading of hasMany relations.
Inflector
The Inflector transforms words from singular to plural and from plural to singular.
Junction
A entry in a many-to-many relation where the link/bridge table has additional fields.
ModelConfig
Model configuration class, a formal definition of a Repository model.
Repository
Repository/DataMapper.
RepositoryCollection
A Collection containing repository instances.
RepositoryCollectionIterator
Helper class for the RepositoryCollection, which converts data to the mode instances when needed.
SimpleRecord
An ActiveRecord with (generated) properties based on the ModelConfig->properties.
EventEmitter
EventEmitter.
Singleton
Adds singleton behavior to a class.

Table of Contents

dump()  : string|void
Dumps information about a variable, like var_dump() but with improved syntax and coloring.
debugr()  : DebugR
Shorthand for sending DebugR messages.
value()  : mixed
Return the value of a variable or return null if the valiable not exist. (Prevents "Undefined variable" notices) WARNING! As a side-effect non existing variables are set to null.
array_value()  : mixed
Return the value of the array element or return null if the element doesn't exist. (Prevents "Undefined index" notices).
error()  : mixed
Report a fatal error (and stop executing).
warning()  : mixed
Report a warning.
notice()  : mixed
Report a notice.
deprecated()  : mixed
Report deprecated functionality.
report_exception()  : mixed
Report an exception.
image()  : Image
Shorthand for creating an Image object.
imagecreatefrombmp()  : resource
Create a GD resource from a BMP file.
component_to_string()  : string
Geeft de uitvoer van een component als string.
is_valid_component()  : bool
Check if $component is compatible with the Component interface, otherwise report notices.
implode_xml_parameters()  : string
Zet een array om naar xml/html parameters; array('x' => 'y') wordt ' x="y"'.
explode_xml_parameters()  : array<string|int, mixed>
Zet een string met parameters om naar een array.
merge_headers()  : array<string|int, mixed>
Merge the results from the $component->getHeaders().
append_class_to_parameters()  : mixed
Stel de $parameters['class'] in of voegt de $class toe aan de $parameters['class'].
tidy_id()  : mixed
ID and NAME must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
render()  : mixed
render($component) is an alias to $component->render() but render($component) generates a notice when the $component isn't a component compatible object instead of an fatal error.
is_component()  : bool
Check if $component is compatible with the Component interface via ducktyping.
javascript_once()  : mixed
Genereer een <script src=""> tag, mits deze al een keer gegenereerd is.
getRepository()  : DefaultRepository|Repository
Get a Repository by ID This allows instances to reference a Repository by id instead of a full php reference. Keeping the (var_)dump clean.

Functions

dump()

Dumps information about a variable, like var_dump() but with improved syntax and coloring.

dump(mixed $variable[, bool $export = false ]) : string|void
Parameters
$variable : mixed
$export : bool = false
Return values
string|void

debugr()

Shorthand for sending DebugR messages.

debugr([mixed $variable = null ]) : DebugR

debugr()->log($var); instead of \Sledgehammer\DebugR::log($var); debugr($var); instead of \Sledgehammer\DebugR::dump($var).

Parameters
$variable : mixed = null
Return values
DebugR

value()

Return the value of a variable or return null if the valiable not exist. (Prevents "Undefined variable" notices) WARNING! As a side-effect non existing variables are set to null.

value(mixed &$variable) : mixed

If you pass array element to value($var['index']) and $var didn't exist, an array is created: array('index' => null) Use \Sledgehammer\array_value() which doesn't have this side effect for array.

Example: if (value($_GET['foo']) == 'bar') { instead of if (isset($_GET['foo']) && $_GET['foo'] == 'bar') {

Parameters
$variable : mixed
Return values
mixed

array_value()

Return the value of the array element or return null if the element doesn't exist. (Prevents "Undefined index" notices).

array_value(array<string|int, mixed> $array, string $key) : mixed

Example: if (\Sledgehammer\array_value($_GET, 'foo') == 'bar') { instead of if (isset($_GET['foo']) && $_GET['foo'] == 'bar') {

Parameters
$array : array<string|int, mixed>
$key : string
Return values
mixed

error()

Report a fatal error (and stop executing).

error(string $message[, mixed $information = null ]) : mixed

It's preferred to throw Exceptions, which allows the calling code to react to the error.

Parameters
$message : string

The error

$information : mixed = null

[optional] Additional information

Return values
mixed

warning()

Report a warning.

warning(string $message[, mixed $information = null ]) : mixed
Parameters
$message : string

The warning

$information : mixed = null

[optional] Additional information

Return values
mixed

notice()

Report a notice.

notice(string $message[, mixed $information = null ]) : mixed
Parameters
$message : string

The notice

$information : mixed = null

[optional] Additional information

Return values
mixed

deprecated()

Report deprecated functionality.

deprecated([string $message = 'This functionality will no longer be supported in upcomming releases' ][, mixed $information = null ]) : mixed
Parameters
$message : string = 'This functionality will no longer be supported in upcomming releases'

The message

$information : mixed = null

[optional] Additional information

Return values
mixed

report_exception()

Report an exception.

report_exception(Exception $exception) : mixed
Parameters
$exception : Exception
Return values
mixed

image()

Shorthand for creating an Image object.

image(string $filename) : Image
Parameters
$filename : string
Return values
Image

imagecreatefrombmp()

Create a GD resource from a BMP file.

imagecreatefrombmp(string $filename) : resource
Parameters
$filename : string
Tags
link
http://php.net/gd
Return values
resource

gd

component_to_string()

Geeft de uitvoer van een component als string.

component_to_string(Component $component) : string

(Uitvoer zoals emails en header() worden niet afgevangen).

Parameters
$component : Component
Return values
string

is_valid_component()

Check if $component is compatible with the Component interface, otherwise report notices.

is_valid_component([Component &$component = '__UNDEFINED__' ]) : bool
Parameters
$component : Component = '__UNDEFINED__'
Return values
bool

implode_xml_parameters()

Zet een array om naar xml/html parameters; array('x' => 'y') wordt ' x="y"'.

implode_xml_parameters(array<string|int, mixed> $parameterArray[, string $charset = 'UTF-8' ]) : string
Parameters
$parameterArray : array<string|int, mixed>
$charset : string = 'UTF-8'

De charset van de parameters (voor htmlentities). Standaard wordt de charset van het actieve document gebruikt.

Return values
string

explode_xml_parameters()

Zet een string met parameters om naar een array.

explode_xml_parameters(string $parameterString) : array<string|int, mixed>

' x="y"' wordt array('x' => 'y').

Parameters
$parameterString : string
Return values
array<string|int, mixed>

merge_headers()

Merge the results from the $component->getHeaders().

merge_headers(array<string|int, mixed> $headers, array<string|int, mixed>|Component $component) : array<string|int, mixed>

The headers from the $component overwrites the values in $headers.

Parameters
$headers : array<string|int, mixed>
$component : array<string|int, mixed>|Component

A component or header array

Return values
array<string|int, mixed>

append_class_to_parameters()

Stel de $parameters['class'] in of voegt de $class toe aan de $parameters['class'].

append_class_to_parameters(string $class, array<string|int, mixed> &$parameters) : mixed
Parameters
$class : string
$parameters : array<string|int, mixed>
Return values
mixed

tidy_id()

ID and NAME must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

tidy_id(mixed $cdata) : mixed
Parameters
$cdata : mixed
Return values
mixed

render()

render($component) is an alias to $component->render() but render($component) generates a notice when the $component isn't a component compatible object instead of an fatal error.

render(mixed $component) : mixed
Parameters
$component : mixed
Return values
mixed

is_component()

Check if $component is compatible with the Component interface via ducktyping.

is_component([Component &$component = '__UNDEFINED__' ]) : bool
Parameters
$component : Component = '__UNDEFINED__'
Return values
bool

javascript_once()

Genereer een <script src=""> tag, mits deze al een keer gegenereerd is.

javascript_once(string $src[, string $identifier = null ]) : mixed
Parameters
$src : string
$identifier : string = null
Return values
mixed

getRepository()

Get a Repository by ID This allows instances to reference a Repository by id instead of a full php reference. Keeping the (var_)dump clean.

getRepository([string $id = 'default' ]) : DefaultRepository|Repository
Parameters
$id : string = 'default'
Return values
DefaultRepository|Repository

Search results