phpLights framework-开源

  • A1_608880
    了解作者
  • 27.1KB
    文件大小
  • gz
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 10:30
    上传日期
PHPLights是一个现代的,轻量级的,基于PHP5的应用程序开发框架。 它大量使用了PHP的面向对象功能,例如接口,抽象类和异常,从而使核心库非常精简,易于理解和扩展
phplights_2007-10-28.tar.gz
  • liblights
  • misc
  • LsToolkit.php
    636B
  • LsCookie.php
    3.2KB
  • LsException.php
    1.5KB
  • LsTemplate.php
    1.9KB
  • LsFileUpload.php
    2.5KB
  • LsContext.php
    6.2KB
  • LsInterface.php
    12.6KB
  • LsHttpHeader.php
    3.5KB
  • LsPublisher.php
    680B
  • LsVKit.php
    2.3KB
  • response
  • LsResponseCLI.php
    501B
  • LsResponseWeb.php
    799B
  • LsResponse.php
    2.1KB
  • dispatcher
  • LsDispatcherDefault.php
    2KB
  • LsDispatcher.php
    2KB
  • database
  • LsDBManagerPDO.php
    1.2KB
  • LsDBConnPDO.php
    3.4KB
  • LsDBStmtODBC.php
    632B
  • LsDBConnODBC.php
    1.4KB
  • LsDBManagerODBC.php
    710B
  • LsDatabase.php
    2.3KB
  • LsDBStmtPDO.php
    1.7KB
  • factory
  • LsFactory.php
    1.7KB
  • LsFactoryDefault.php
    2.3KB
  • view
  • LsViewPHP.php
    4.6KB
  • LsViewPHPArray.php
    998B
  • classes.php
    4.5KB
  • user
  • LsUserDefault.php
    2.5KB
  • LsAccessAll.php
    526B
  • LsAuthAll.php
    523B
  • request
  • LsRequestCLI.php
    2.3KB
  • LsRequest.php
    2KB
  • LsRequestWeb.php
    2KB
  • storage
  • LsStorageSessionNative.php
    2KB
  • LsStorage.php
    3KB
  • LsStorageSecurityAspect.php
    3.1KB
  • LsStorageHolder.php
    1.6KB
  • LsStorageConfigPHP.php
    2.4KB
  • timer
  • LsTimer.php
    735B
  • LsTimerDefault.php
    1023B
  • LsTimerNone.php
    772B
  • bridge
  • LsBridgeEzc.php
    916B
  • LsBridgeZend.php
    959B
  • LsBridgePear.php
    941B
  • LsBridgeDoctrine.php
    897B
  • controller
  • ErrorController.php
    1.1KB
  • LsController.php
    4KB
  • logger
  • LsLoggerNone.php
    948B
  • LsLoggerDirect.php
    1.2KB
  • LsLoggerView.php
    1.5KB
  • LsLogger.php
    1.4KB
  • LsLoggerSystem.php
    1.2KB
  • LsLogManager.php
    1.5KB
  • LsCore.php
    5.9KB
  • app
  • index.php
    861B
  • config
  • stmt.php
    386B
  • resource.php
    318B
  • .htaccess
    122B
  • templates
  • css
  • debug.css
    419B
  • .htaccess
    15B
  • images
  • test_list.html
    452B
  • js
  • data
  • views
  • main.php
    620B
  • error
  • internal.php
    102B
  • notfound.php
    95B
  • badrequest.php
    92B
  • debug.php
    4.2KB
  • default
  • index.php
    671B
  • lib
  • DefaultController.php
    2.1KB
  • TestModel.php
    1.6KB
  • base.php
    894B
内容介绍
<?php /** * @author Norbert Sendetzky <norbert@linuxnetworks.de> * @license http://www.gnu.org/licenses/lgpl-3.0.html * @copyright 2007, Norbert Sendetzky * @package phpLights */ /** * Required functions for access objects * @package phpLights */ interface LsAccessIface { /** * Test if user is permited to access URL * * @param string $ctl Name of controller class * @param string $action Name of action method * @return bool */ public function hasAccess( $ctl, $action ); } /** * Required functions for auth objects * @package phpLights */ interface LsAuthIface { /** * Test if user is logged in * * @param string $who Describes a unique user * @param string $cred Secret authenticating the user * @return bool */ public function hasCreds( $who, $cred ); } /** * Required functions for bridge objects */ interface LsBridgeIface { /** * Initialize bridge */ public function __construct( $path = NULL ); /** * Bridged class loader */ public static function load( $classname ); } /** * Required functions for config objects * @package phpLights */ interface LsConfigIface { /** * Add configuration options from storage * * @param string $key Namespace for config values * @param string $dsn Location of the configuration storage * @param bool $silent Don't bail out on errors */ public function addConfig( $key, $dsn, $silent = false ); } /** * Required functions for controller objects * @package phpLights */ interface LsControllerIface { /** * Execute controller method * * @param string $action name of controller method */ public function run( $action ); } /** * Required functions for database manager objects * @package phpLights */ interface LsDBManagerIface { /** * Get database connection * * @param string $name Name of the resource in configuration * @return LsDBConnIface */ public function acquire( $name = 'db' ); /** * Release connection for reuse * * @param LsDBConnIface $conn Connection object * @param string $name Name of resource */ public function release( $conn, $name = 'db' ); } /** * Required functions for database connection objects * @package phpLights */ interface LsDBConnIface { /** * Setup connection * * @param array $config Configuration flags */ public function __construct( array $config ); /** * Start database transaction */ public function startTransaction(); /** * Commit database transaction */ public function commitTransaction(); /** * Rollback database transaction */ public function rollbackTransaction(); /** * Escape and quote value with single quotes if necessary * * @param string $data Value to escape and quote * @return string */ public function quote( $data ); /** * Execute database statement * * @param string $sql Complete SQL statement * @return LsDBStmtIface */ public function exec( $sql ); /** * Prepare database statement * * @param string $sql SQL statement, maybe with place holders * @return LsDBStmtIface */ public function prepare( $sql ); } /** * Required functions for prepared statement objects * @package phpLights */ interface LsDBStmtIface { /** * Initialize statement class * * @param mixed $handle Database connection handle */ public function __construct( $handle ); /** * Cleanup database connection */ public function close(); /** * Execute a prepared statement * * @param array $binds Replacements for placeholders */ public function execute( array $binds = array() ); /** * Retrieve next result set * * @return bool */ public function & fetch( $style = LsDBStmt::Assoc ); /** * Fetch next row from result set * * @param int $style Numerical or associative style * @return array */ public function nextResult(); } /** * Required functions for dispatcher objects * @package phpLights */ interface LsDispatcherIface { /** * Execute controller and get output * * @param int $mode Render mode * @return string|NULL */ public function run( $mode = LsDispatcher::Display ); } /** * Required functions for factory objects * @package phpLights */ interface LsFactoryIface { /** * Creates class instances * * @param string $classname Name or comma separated names of classes * @param string $interface Name of interface the classes have to implement * @param array $arglist Variable arguments for instantiated classes * @param mixed $object Aspect object given to instantiated class * @return mixed */ public function create( $name, $interface = NULL ); /** * Instantiate single class object * * @param string $classname Name of class * @param string $interface Name of interface the class has to implement * @param array $arglist Variable arguments for instantiated class * @param mixed $object Aspect object given to instantiated class * @return mixed */ public function createObject( $name, $interface = NULL, array $arglist = array(), $object = NULL ); } /** * Required functions for observer objects * @package phpLights */ interface LsListenerIface { public function notifyFrom( LsPublisherIface $p ); } /** * Required functions for logger objects * @package phpLights */ interface LsLoggerIface { /** * Return current log level * * @return int */ public function getLogLevel(); /** * Set new log level * * @param int $level New log level constant */ public function setLogLevel( $level ); /** * Save log message * * @param string $message Message which should be logged * @param int $level Log level this message applies to */ public function log( $msg, $level = LsLogger::Error ); } /** * Required functions for publisher objects * @package phpLights */ interface LsPublisherIface { public function addListener( LsListenerIface $l ); public function removeListener( LsListenerIface $l ); } /** * Required functions for request objects * @package phpLights */ interface LsRequestIface { /** * Provide easy access to available parameters * * @param string $name Path to requested parameter * @param mixed $default Returned value if requested parameter isn't available * @param string $regex PCRE string describing the expected value * @see LsStorage for common regular expressions * @return mixed */ public function get( $name, $default = NULL, $regex = NULL ); /** * Get uploaded files * @return array */ public function getFileArray(); /** * Get uploaded files as flat list * @return array */ public function getFileList(); } /** * Required functions for response objects * @package phpLights */ interface LsResponseIface { /** * Add header object to response * * @param LsHttpHeader $header Single header object */ public function addHeader( LsHttpHeader &$header ); /** * Add cookie object to response * * @param LsCookie $cookie Single cookie object */ public function addCookie( LsCookie &$cookie ); /** * Return base view * * @return LsViewIface */ public function getView(); /** * Set new base view * * @param LsViewIface $view */ public function setView( LsViewIface $view ); /** * Create and return output suitable for client * * @return string */ public function & render(); /** * Create output and write it to stdout */ public function display(); } /** * Required functions for objects which must not be instanciated more than once * @package phpLights */ interface LsSingletonIface { /** * Return single instance of an object * * @return mixed */ public static function getInstance(); } /** * Required functions for storage objects * @package phpLights */ interface LsStorageIface { /** * Test if value is available * * @param string $path Path to requested value * @return bool */ pu
评论