webservco / framework
A PHP Framework
Requires
- php: ^8.3
- ext-fileinfo: *
- psr/log: ^3
Requires (Dev)
- pds/skeleton: ^1
- php-parallel-lint/php-console-highlighter: ^1
- php-parallel-lint/php-parallel-lint: ^1
- phpstan/phpstan: ^2
- phpstan/phpstan-deprecation-rules: ^2
- phpstan/phpstan-phpunit: ^2
- phpstan/phpstan-strict-rules: ^2
- phpunit/phpunit: ^13
- slevomat/coding-standard: ^8
- squizlabs/php_codesniffer: ^4
- webservco/coding-standards: ^2
- webservco/component-common: ^2
Suggests
- phpdocumentor/phpdocumentor: phpDocumentor v3 (global installation)
Provides
None
Conflicts
None
Replaces
None
- dev-master
- v13.34.0
- v13.33.0
- v13.32.0
- v13.31.0
- v13.30.0
- v13.29.0
- v13.28.0
- v13.27.1
- v13.27.0
- v13.26.0
- v13.25.0
- v13.24.0
- v13.23.0
- v13.22.0
- v13.21.0
- v13.20.0
- v13.10.0
- v13.9.0
- v13.8.4
- v13.8.3
- v13.8.1
- v13.8.0
- v13.7.0
- v13.6.0
- v13.5.0
- v13.4.0
- v13.3.0
- v13.2.2
- v13.2.1
- v13.2.0
- v13.1.0
- v13.0.4
- v13.0.3
- v13.0.2
- v13.0.1
- v13.0.0
- v11.81.1
- v11.81.0
- v11.11.11
- v11.11.0
- v11.10.0
- v11.9.1
- v11.9.0
- v11.8.4
- v11.8.3
- v11.8.2
- v11.8.1
- v11.8.0
- v11.7.1
- v11.7.0
- v11.6.15
- v11.6.14
- v11.6.13
- v11.6.12
- v11.6.11
- v11.6.10
- v11.6.9
- v11.6.8
- v11.6.7
- v11.6.6
- v11.6.5
- v11.6.4
- v11.6.3
- v11.6.2
- v11.6.1
- v11.6.0
- v11.5.2
- v11.5.1
- v11.5.0
- v11.4.4
- v11.4.3
- v11.4.2
- v11.4.1
- v11.4.0
- v11.3.3
- v11.3.2
- v11.3.1
- v11.3.0
- v11.2.1
- v11.2.0
- v11.1.3
- v11.1.2
- v11.1.1
- v11.1.0
- v11.0.0
- v10.x-dev
- v10.2.1
- v10.2.0
- v10.1.1
- v10.1.0
- v10.0.8
- v10.0.7
- v10.0.6
- v10.0.5
- v10.0.4
- v10.0.3
- v10.0.2
- v10.0.1
- v10.0.0
- v9.x-dev
- v9.85.0
- v9.84.0
- v9.83.2
- v9.83.1
- v9.83.0
- v9.82.0
- v9.81.5
- v9.81.4
- v9.81.3
- v9.81.2
- v9.81.1
- v9.81.0
- v9.80.0
- v9.79.0
- v9.78.1
- v9.78.0
- v9.77.0
- v9.76.3
- v9.76.2
- v9.76.1
- v9.76.0
- v9.75.2
- v9.75.1
- v9.75.0
- v9.74.1
- v9.74.0
- v9.73.0
- v9.72.0
- v9.71.0
- v9.70.6
- v9.70.5
- v9.70.4
- v9.70.3
- v9.70.2
- v9.70.1
- v9.70.0
- v9.60.1
- v9.60.0
- v9.50.0
- v9.40.1
- v9.40.0
- v9.39.8
- v9.39.7
- v9.39.6
- v9.39.5
- v9.39.4
- v9.39.3
- v9.39.2
- v9.39.1
- v9.39.0
- v9.38.3
- v9.38.2
- v9.38.1
- v9.38.0
- v9.37.0
- v9.36.0
- v9.35.0
- v9.34.2
- v9.34.1
- v9.34.0
- v9.33.0
- v9.32.2
- v9.32.1
- v9.32.0
- v9.31.0
- v9.30.0
- v9.29.1
- v9.29.0
- v9.28.0
- v9.27.4
- v9.27.3
- v9.27.2
- v9.27.1
- v9.27.0
- v9.26.0
- v9.25.0
- v9.24.4
- v9.24.3
- v9.24.2
- v9.24.1
- v9.24.0
- v9.23.0
- v9.22.2
- v9.22.1
- v9.22.0
- v9.21.1
- v9.21.0
- v9.20.4
- v9.20.3
- v9.20.2
- v9.20.1
- v9.20.0
- v9.19.0
- v9.18.1
- v9.18.0
- v9.17.1
- v9.17.0
- v9.16.0
- v9.15.3
- v9.15.2
- v9.15.1
- v9.15.0
- v9.14.1
- v9.14.0
- v9.13.2
- v9.13.1
- v9.13.0
- v9.11.3
- v9.11.2
- v9.11.1
- v9.11.0
- v9.10.1
- v9.10.0
- v9.9.3
- v9.9.2
- v9.9.1
- v9.9.0
- v9.7.13
- v9.7.12
- v9.7.11
- v9.7.10
- v9.7.9
- v9.7.8
- v9.7.7
- v9.7.6
- v9.7.5
- v9.7.4
- v9.7.3
- v9.7.2
- v9.7.1
- v9.7.0
- v9.6.0
- v9.5.1
- v9.5.0
- v9.4.8
- v9.4.7
- v9.4.6
- v9.4.5
- v9.4.4
- v9.4.3
- v9.4.2
- v9.4.1
- v9.4.0
- v9.3.0
- v9.2.0
- v9.1.0
- v9.0.2
- v9.0.1
- v9.0.0
This package is auto-updated.
Last update: 2026-10-12 13:59:32 UTC
README
A PHP MVC Framework for web applications and CLI commands.
Requests are routed to controller methods and pages are plain PHP templates. Sessions, gettext translations, PDO database helpers, forms, file uploads and downloads, a cURL client and a file logger are all included, so a typical project needs very little else.
Note: This framework is considered legacy. It has been replaced by individual components, please see webservco/sandbox.
- Requires: PHP 8.3+,
ext-fileinfo,psr/log - Optional:
ext-pdo(MySQL or PostgreSQL driver),ext-curl,ext-gettext,ext-dom,ext-mbstring
Installation
composer require webservco/framework
Quick start
Projects follow the PDS skeleton layout:
bin/cli CLI entry point
config/.env.ini environment settings (not committed)
config/Router.php library settings, one file per library
public/index.php web entry point
resources/views/ PHP templates
resources/translations/ gettext translations
src/Project/App.php your Application
src/Project/OutputLoader.php your OutputLoader
src/Project/Domain/App/Controller.php
src/Project/Domain/App/Command.php
var/log/ log files
public/index.php:
use Project\App; use WebServCo\Framework\Exceptions\ApplicationException; require __DIR__ . '/../vendor/autoload.php'; try { $app = new App( // publicPath: web accessible directory. __DIR__, // projectPath: parent of publicPath if null. null, // projectNamespace: "Project" if null. null, ); $app->run(); } catch (ApplicationException $e) { echo $e->getMessage(); exit; }
src/Project/App.php:
namespace Project; use WebServCo\Framework\Application; final class App extends Application { }
config/.env.ini:
app_environment = development
config/Router.php:
return [ 'default_route' => ['App', 'home', []], 'routes' => [], ];
src/Project/Domain/App/Controller.php:
namespace Project\Domain\App; use Project\OutputLoader; use WebServCo\Framework\AbstractController; use WebServCo\Framework\Environment\Config; use WebServCo\Framework\Interfaces\ResponseInterface; final class Controller extends AbstractController { // The framework creates the controller with no arguments. public function __construct() { parent::__construct(new OutputLoader(Config::string('APP_PATH_PROJECT'))); } public function home(): ResponseInterface { $this->setData('title', 'Hello World'); // Renders resources/views/app/home.php inside resources/views/layout.php return $this->outputHtml($this->getData(), 'app/home'); } }
The last piece is an OutputLoader. It's about ten lines, and Application has the full class.
Documentation
Basics
- Application: project layout, entry points, request lifecycle, dispatching, error pages
- Configuration:
config/.env.ini, library settings files, every key the framework reads - Controllers: controllers, commands, repositories, redirects
- ArrayStorage: the
'a/b/c'key syntax used by libraries, sessions and forms - Exceptions: hierarchy, codes, HTTP status mapping
Libraries
- AbstractLibrary: data and settings storage shared by all libraries
- Config
- Cookie
- Internationalization
- Request
- Router
- Security
- Session
Output
- Output methods:
outputHtml(),outputJson(),outputCli()and friends - HtmlOutput: templates, layout, partials
- JSON
HTTP
- Response:
Http\Response, status codes, methods - CurlClient
- X-Sendfile
CLI
- Response
- Ansi: colors and styles
- Progress\Bar
- Progress\Line
- Runner: stoppable long running commands
Database
- PDO: MySQL and PostgreSQL
- AbstractObject
- DataTables: server side processing for DataTables
Files
- Files: download and inline responses, PDF, MP3, XML
- CSV
- File upload
Forms
Logging
- Log: file and output loggers, error processor, CLI processor
Helpers
- ArrayHelper
- DateHelper
- RequestHelper
- StringHelper
- Other helpers: PHP, environment, templates, errors, HTTP headers
Objects
- Objects:
fromArray(),toArray(), validated classes
Development
Related projects
webservco/webapp-skeleton
A simple webservco/framework Web Application Skeleton to help start a new project fast.
webservco/project-skeleton
A simple webservco/framework Project Skeleton. This is a blank project with no initial functionality.
webservco/api
A PHP RESTful API Framework
Development
# Start project. ddev start # Install dependencies. ddev c u # Run all validations. ddev c c # Run unit tests. ddev c test:d
More in Development.