silverorange / site
Framework for building a website.
Requires
- php: >=8.2.0
- ext-curl: *
- ext-gd: *
- ext-iconv: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- ext-pcre: *
- aws/aws-sdk-php: ^3.0.0
- codescale/ffmpeg-php: ^3.2.0
- pear/text_password: ^1.1.1
- sentry/sentry: ^4.9
- silverorange/concentrate: ^3.1.0
- silverorange/mdb2: ^3.2.0
- silverorange/swat: ^7.10.0
- silverorange/xml_rpc2: ^2.1.0
- silverorange/xml_rpc_ajax: ^3.2.0
- symfony/mailer: ^5.4
Requires (Dev)
- friendsofphp/php-cs-fixer: 3.88.2
- mockery/mockery: ^1.6
- phpstan/phpstan: ^2.2
- phpstan/phpstan-mockery: ^2.0
- phpunit/phpunit: ^11.5
- rector/rector: ^2.4
Suggests
- ext-amqp: Allows some operations to use a message queue system.
- ext-imagick: Enables SiteImage processing abilities.
- ext-memcached: Allows caching various resources.
- ext-pnctl: Process control management for command-line applications.
- ext-redis: Allow connecting applications to a Redis data store.
- pelago/emogrifier: Inlines CSS in multipart mail messages.
- psr/log: Enables logging using the PSR logging interface.
- silverorange/admin: Enables admin components
- silverorange/jwplayer: Enables video player support.
Provides
None
Conflicts
None
Replaces
None
- dev-master
- 16.2.1
- 16.2.0
- 16.1.1
- 16.1.0
- 16.0.1
- 16.0.0
- 15.4.0
- 15.3.2
- 15.3.1
- 15.3.0
- 15.2.0
- 15.1.5
- 15.1.4
- 15.1.3
- 15.1.1
- 15.1.0
- 15.0.0
- 14.8.0
- 14.7.0
- 14.6.1
- 14.6.0
- 14.5.0
- 14.4.0
- 14.3.1
- 14.3.0
- 14.2.0
- 14.1.3
- 14.1.2
- 14.1.1
- 14.1.0
- 14.0.0
- 13.0.3
- 13.0.2
- 13.0.1
- 13.0.0
- 12.0.0
- 11.0.2
- 11.0.1
- 11.0.0
- 10.3.0
- 10.2.1
- 10.2.0
- 10.1.1
- 10.1.0
- 10.0.4
- 10.0.3
- 10.0.2
- 10.0.1
- 10.0.0
- 9.1.1
- 9.1.0
- 9.0.0
- 8.0.0
- 7.4.0
- 7.3.0
- 7.2.1
- 7.2.0
- 7.1.0
- 7.0.0
- 6.3.0
- 6.2.0
- 6.1.0
- 6.0.0
- 5.14.0
- 5.13.0
- 5.12.0
- 5.11.0
- 5.10.0
- 5.9.0
- 5.8.0
- 5.7.0
- 5.6.0
- 5.5.0
- 5.4.0
- 5.3.0
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.0
- 4.16.0
- 4.15.0
- 4.14.0
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.0
- 4.8.0
- 4.7.0
- 4.6.0
- 4.5.0
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.1
- 4.0.0
- 3.5.0
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- dev-feature-google-tag-manager
- dev-feature-google-analytics-4
- dev-feature-google-analytics-four
- dev-update-swat-6
- dev-3_4_3_emrap
This package is auto-updated.
Last update: 2026-09-09 18:09:33 UTC
README
Site is a Website framework built on top of Swat. Site provides several features in one monolothic package:
- general application framework
- command line application framework
- web application framework
- web request routing
- image processing
- media processing
- account sign in and session management
- ad referral processing
- attachment uploading
- cdn management
- user commenting
SiteApplication
This represents an application. There are two main child classes:
- SiteWebApplication, and
- SiteCommandLineApplication
SiteApplicationModule
Reusable features of applications (web or CLI) that should be available wherever there is application context are provided using a module interface.
Example provided modules are:
- database
- config
- memcache
- cd
- messages (cross-request session messages)
Modules declare their dependencies and are initialized using a tree sorting
algorithm. For example, the messages module depends on the session module.
SitePage and SitePageDecorator
Pages represent route endpoints (URLs) in a web application. The URL path is
often referred to as $source. Each page has several lifecycle hooks that can
be overridden:
init()- initialize objects that may be common to both theprocess()and build methods. Validating HTTP GET parameters can be done here.process()- runs betweeninit()andbuild(). This method is indended to contain request logic that might prevent the page from being rendered. Handling HTTP POST parameters is done here.build()- use this method to render content and pass it to the page layout. If the page request does not cause a redirect, this method is used to build the response.finalize()- use this method to collect HTML head entries or perform any other post-build operations.
Decorators are composable objects that implement the page interface. They can enable horizontal reuse of features.
SiteLayout
In a web application, each page has an associated layout. The page and layout
are created and configured in SiteWebApplication::getPage(). One or more
SitePageFactory objects may be used to select the correct page object and
layout for a request.
The page sets properties on the layout's $data object. These properties can
be used directly inside layout templates. Templates use pure immediate-mode
PHP.
Like pages, layouts have request lifecycle hooks. These hooks run before the page hooks of the same name:
init()process()build()finalize()complete()- this hook is only present in layouts and allows using data from the page'sfinalize()hook to build layout template values. It runs after the page'sfinalize()hook.
Additional Documentation
Installation
composer require silverorange/site