Package swlib

Version1.0
Checksum7f485f63db2fc48bfede1c5e2074e8375f879c20
Download/repository/swlib/swlib.zip
Download SHA1d79b074be29e3c67473c56fed3b1f36fe8da8a92
Download MD5a417f5d1368d2ea7e787770fdc73dfb8
License
The SW PHP Library is an open source package 
written by Stefan Wilhelm (cerberos@AtWillys.de),
and licensed under the GPL:

    SwLib
    Copyright (C) 2010 Stefan Wilhelm

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
Readme
Hi there

	For documentation about the SW PHP library please 
	refer to http://www.atwillys.de, or write me an email
	for further ideas, questions and contributions:
	cerberos@atwillys.de.

	Enjoy your project,

Cheers

	Stefan
Contents
Rss2Feed.class.php
class Rss2Feed
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionProvides rendering one or more RSS channels into a RSS XML text.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
GeoIpLookup.class.php
class GeoIpLookup
Packagede.atwillys.sw.php.swlib.util
Version1.0
DescriptionPerforms a lookup at http://ipinfodb.com
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
UserVerificationImage.class.php
class UserVerificationImage
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionCreates a verification image for human user verification.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
ZipFile.class.php
class ZipFile
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionWrapper class for ZipArchive with exceptions. Provides simple functions to compress, list and extract files or folders (recursively).
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
UsesZipException
ZipException.class.php
class ZipException extends Exception
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionException thrown by class ZipFile
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
XmlConverter.class.php
class XmlConverter
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionXML handling. Generates XML output from an associative cascaded array.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2006-2010
Versioning.class.php
final class Versioning
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionLibrary version checking and reporting class. Scans a package source directory for files, builds SHA1 and MD5 checksums for of each file and (if PHP) fetches additional information about documented classes and interfaces. The static function publishModule() allows to zip a package source directory and generate info files containing the checksums, details, version, readme and license and publish all this in a reporitory folder (which has to be writable). The function checkModuleVersion() performs a HTTP lookup to a repository generated by the function publishModule(), compares version, checksum and details and reports a recommendation if the the package has to be updated or not.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
version
UtcDate.class.php
class UtcDate implements IDate
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionUTC refered dates and related operations.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
UsesIDate
UnitTest.class.php
abstract class UnitTest
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionUnit test base class.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
Tracer.class.php
class Tracer
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionMain tracing class, can be extended. Traces to output window when Tracer::stop() is called if the trace level > 0 or an uncaught Exception occured. - Name of recipient: $GLOBALS['config']['admin.name'] - EMail of recipient: $GLOBALS['config']['admin.email'] The trace level is automatically set if $_GET['trace'] > 0 The trace level is saved in $_SESSION. There is the possibility to set a default trace level using - define('TRACER_DEFAULT_LEVEL', <INT VALUE>). This should be for debugging only. If you want to force the Tracer being off (not seen by any unauthenticated user) simply call Tracer::disable();
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
swlib.class.php
final class swlib
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionSW PHP Library Core class. Organizes autoloading, settings import/export, and initializes all classes/modules to enable the features: - Exception handling - Tracing - Session management - Output bufferung - Update check of the whole package de.atwillys.sw.php.swLib Furthermore, it normalizes the GET,POST, etc input according to magic quotes (which are ALL removed).
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
UsesTracer, EException, OutputBuffer, Session
ShellProcess.class.php
class ShellProcess
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionShell execution wrapper. Provides executing a shell program, passing input to the STDIN of the process (virtually typing in the console window), and fetching STDOUT (normal output) and STDERR (error output). Furthermore the child process is terminated if the script is finished. This prevents higher cpu load for no reason. You can specify not to terminate the process as well. The output is passed to the callback methods onStdOut() and onStdErr(), which just print the contents. Overload these methods to handle the output yourself. All overloadable methods: - onProcessStarted(): Called when the process was just started - onProcessFinished(): Called when the process exists - onProcessRunning(): Called regularely when the process is running - onStdOut(): STDOUT processing - onStdErr(): STDERR processing
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2009-2010
Session.class.php
class Session
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionSession management wrapper. This class can be used to replace the PHP standard session handling. Principally this class does nothing differemt, but the class can be easily replaced with a database-based session handling or the like.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
ResourceFile.class.php
class ResourceFile implements ITracable
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionResource file class, implemented to manage downloads and uploads of files. Provides HTTP-Range (partial download), ETAG, If-Modified-Since, auto detection of the mime type, and cache control. Base for downloadable or requestable resources saved in a database or as files. Provides mime type handling and output with http header information.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
UsesFileSystem, Tracer
readme
PhpCode.class.php
final class PhpCode implements ITracable
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionPHP code information and execution. The evaluateSandboxed() should work even if PEAR is not installed (no class SandBox), but safemode should be disabled because PHP has to be executed in the shell. This means longer processing time as well.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
UsesTracer
OutputBuffer.class.php
class OutputBuffer implements ITracable
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionEnables auto output buffering by calling ob_start() at construction and ob_end_flush() on destruction. You can overload the onEnd() method to add special processes to the buffered content. It is also possible to create instances, e.g. $ob = new OutputBuffer(); print "Something"; $content = $ob->getContents();
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
UsesTracer
MySqlException.class.php
class MySqlException extends Exception
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionException thrown by class MySql and MySqlAdministration
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
MySqlAdministration.class.php
class MySqlAdministration extends MySql
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionMySQL backup / restore and administrative tools. Backups the whole database (or only a part) into a ZIP file, including an info file. The restore function accepts the ZIP file and is able to restore the database (with table creations).
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2009-2010
UsesTracer, MySql, MySqlException, FileSystem, ZipFile
MySql.class.php
class MySql implements ITracable
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionMySQL wrapper, which provides auto connect/disconnect, normal SQL query, escaping, and special query methods like queryInsertInto(), queryDeleteFrom(), queryUpdate(), query to objects, query information about the database or tables - all kind of queries you use regularely.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
UsesMySqlException, Tracer
MenuTreeRenderer.class.php
class MenuTreeRenderer extends MenuRenderer
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionStandard implementation of rendering for class Menu. In this case a tree menu is rendered.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
UsesMenuRenderer
MenuRenderer.class.php
class MenuRenderer
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionMenu rendering for class Menu. Overload the functions of this class to define the way your menu is rendered.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
Menu.class.php
class Menu
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionRecursive Menu managing class. Accepts a cascaded associative array with defined entries. The keys of these entries are configurable, but the functionality is: - There is a reference the node list (the cascaded array) - Each entry has an optional children entry that contains similar sub nodes. If children are defined, the class will recursively process this entries. - Each entry has an optional key/value pair that defines if the entry is hidden. In this case the enry will be skipped. - Each entry has an optional key/value pair that defines if the entry is active. This will be marked in the renderer to perform an alternative rendering output (e.g. text-color:red) - There is a rendering class that contains only callbacks for "Start Menu", "End Menu", "Open Folder", "Close Folder", "Menu Item".
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
UsesMenuRenderer
MathException.class.php
class MathException extends Exception
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionException thrown by the class Math. The EException throws this exceptions as well in case of a "division by zero" warning.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
Math.class.php
class Math
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionMath class for tasks that have to do with statistics and other Math stuff. IMPORTANT: Take care with the variable types you use! PHP has functions that return float instead of double. This is a big issue of this language. Try to avoid type conversion from double to other types and back.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
UsesMathException
Mailer.class.php
class Mailer
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionSimple SMTP EMail wrapper class. Nothing special.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
UsesIEMailContact
LocalDate.class.php
class LocalDate extends UtcDate implements IDate
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionLocal time refered dates: same as UtcDate for local date/times. It is assumed that $datetime (if numeric) is a local timestamp (form time() )
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
UsesUtcDate, IDate
license
LaTexRenderer.class.php
class LaTeXRenderer
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionRenders LaTeX to a png image. The rendering class has an own cache based on the checkums of the fomulas. If a new formula is entered specified, then the rendering process will run, and create the cache file. The callback onTexFilter() can be overloaded to add an own filter, e.g. to prevent too long texts, shell commands or require HTTP authentication to render formulas.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
ITracable.class.php
interfaceITracable
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionDefines if a class is ITracable. Implemented in all classes that require the Tracer.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2006-2010
InterfaceITracable
IniFile.class.php
class IniFile
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionInitialisation file access. Load/save availability. Sections and keys are accessable using the public data array.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2008-2010
index.php
IEMailContact.class.php
interfaceIEMailContact
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionEMail contact interface, used in class Mailer and implemented in class EMailContact.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2006-2010
InterfaceIEMailContact
IDate.class.php
interfaceIDate
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionUTC/Local date interface. Implemented in class UtcDate, LocalDate.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2005-2010
InterfaceIDate
HttpRequest.class.php
class HttpRequest
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionHttp socket request wrapper
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2008-2010
ClassHttpRequest
HttpAuthentificationException.class.php
class HttpAuthentificationException extends Exception
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionHttp authentification exception, thrown if the authentication fails
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2008-2010
HttpAuthentification.class.php
class HttpAuthentification
Packagede.atwillys.sw.php.swLib
DescriptionHttp authentification wrapper with external user management. The registered users are passed in the constructor/function addUser in an associative array, where the keys are the user login names and the values the ENCRYPTED passwords. The encryption function is the UNIX crypt(). The static function createPassword() can be used as well. To activate the feature call try { HttpAuthentification::requireAuthentication(); } catch(HttpAuthentificationException $e) { ... }
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2008-2010
UsesHttpAuthentificationException
GregorianMonthCalendarRenderer.class.php
class GregorianMonthCalendarRenderer
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionGegorian Month Calendar renderer. Overwrite this class if you want to have an alterantive rendered representation of the month calendar.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
UsesGregorianCalendar, GregorianCalendarEvent
GregorianDayCalendarRenderer.class.php
class GregorianDayCalendarRenderer
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionGegorian Day Calendar renderer class. Overwrite this class if you want a different rendered representation.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
UsesGregorianCalendar, GregorianCalendarEvent
GregorianCalendarEventController.class.php
class GregorianCalendarEventController
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionGegorian Calendar event controller. Overwrite the methods to customize the controller (load from file, from database etc. The class ist not abstract because it will be instantiated by the calendar if no derived controller is specified. This class methods returns empty date, which have no effect.)
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
UsesGregorianCalendarEvent
GregorianCalendarEvent.class.php
class GregorianCalendarEvent
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionBase class for Gegorian Calendar Events. Events are defined using a unique identifier (e.g. the primary key of a database or file), a start timestamp and an end timestamp. The configuration of the GregorianCalendar class decides if these timestamps are interpreted as local or UTC. Further "fixed" properties are the type of event (e.g. "meeting", "festival" ...) and an associative data array that contains variable information about the particular event. All keys in the array can be accessed like properties (if e.g. $data = array( 'where' => 'there', 'who' => 'me', 'why' => 'because' ); Then $event->where === 'there'. Note that you should choose "PHP-variable-name-conform" array keys for this, alternatively you can use the data getter: $event->getData("who") === "me".
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
GregorianCalendar.class.php
class GregorianCalendar
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionGegorian Calendar management with the ability to render day calendars and month calendars using the corresponding rendering classes. Also manages the events for selected time spans.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
UsesGregorianCalendarEvent, GregorianCalendarEventController, GregorianDayCalendarRenderer, GregorianMonthCalendarRenderer
FileSystemException.class.php
class FileSystemException extends Exception
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionException thrown by class FileSystem
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
FileSystem.class.php
class FileSystem
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionFileSystem operations (in general wrappers for already existing PHP functions) with exceptions. Implemented static functions are e.g. checking if a file, directory, link exists, recursively find files and folders with filtering, single command file I/O, file basename, dirname, extension, and retrieving system directories and temporary files.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010
UsesFileSystemException
EMailContact.class.php
class EMailContact implements IEMailContact
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionEMail contact is a base class for the class Mailer. It can be easily be extended to any other addressbook or user class (Note that it might be be better to write an own user class and implement IEMailContact instead of using this class).
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2006-2010
UsesIEMailContact
EException.class.php
class EException extends Exception
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionImplements global error, assertion and exception handling. Errors, warnings and messages are categorized and either thrown as exception or only traced (e.g. warnings, messagses). A global exception handler catches uncaught exceptions, traces the details and prints a HTML error text (without details, as a MySqlException('You have an error near SELECT * form users where password=...') is nothing to be seen by the user. Assertions are only traced.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2006-2010
UsesException, (optional) Tracer
Cache.class.php
class Cache
Packagede.atwillys.sw.php.swLib
Version0.1
DescriptionCache management class with GZ compression and uncompress caching of contents and files. Package caches are stored in sub directories. Each resource is defined by the SHA1 checksum. NOTE: THIS CLASS IS BEING DEVELOPED
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2010
ArrayFilter.class.php
class ArrayFilter
Packagede.atwillys.sw.php.swLib
Version1.0
DescriptionProvides static functions for simple array filtering and finding tasks.
AuthorStefan Wilhelm
LicenseGPL
CopyrightStefan Wilhelm, 2007-2010