Decibel offers a wide range of user interface widgets to simplify the collection and display of data. All widgets understand Decibel's object relational modelling features and can be mapped directly to model fields. As renderable components, the template for a widget can be overridden to provide a different user experience if required.
{widget type="app\decibel\widget\DDateTimeWidget" name="publishTime"}
{widget type="app\decibel\widget\DTextWidget" name="title"
multiLingual=true}
{widget type="app\decibel\widget\DLinkedObjectWidget" name="language"
linkTo="app\decibel\regional\DLanguage"}
{widget type="app\decibel\widget\DAssetWidget" name="video"}

Decibel provides a simple way to create remote procedures (or web services) and to interact with these web services using AJAX.
// Define the remote procedure.
class MyRpc extends DRemoteProcedure {
public function execute(DRequest $request) {
return 'Hello ' . $request->who;
}
}
// Execute the remote procedure via AJAX.
$.decibel.rpc.call(
'app\\MyApp\\MyRpc',
function(result) {
alert(result);
},
{
'who': 'World'
}
);
Decibel's labelling supports multi-lingual and regional translation of website content. Full support is provided for different plural rules and regional variations in formatting of numeric information.
// Label definition
results = {#count#} {#count#|result|results} found
// Use labels in a view
{label name="resultsFound" count=1}
{label name="resultsFound" count=4}
// Output
1 result found
4 results found
Decibel extends PHP's PHAR packages to provide a complete packaging and release management process. By utilising the inbuilt packaging functionality, developers can more easily follow a best-practice release management process by creating a bundle of updated code for controlled release to testing and production servers.
// Set up a package manifest describing what needs to be included.
$manifest = new DManifest();
$manifest->description = "Decibel Analytics 1.4.5 Installer";
$manifest->creatorName = 'Decibel Technology';
$manifest->creatorEmail = 'team@decibeltechnology.com';
$manifest->type = DManifest::typeInstaller;
$manifest->addPlugin('app\DecibelAnalytics\DecibleAnalytics');
// Index file to include in the package.
$files = DPackage::index(DECIBEL_PATH . 'app/DecibelAnalytics/');
// Generate the package.
$result = DPackage::create($manifest, $files);
The task scheduler provides functionality to schedule and execute tasks on a regular or one-off basis. This is perfect for ensuring that long running or resource intensive tasks occur in quiet periods, or just making sure the user doesn't have to wait for a task to complete before continuing.
Decibel's scheduling means an end to waiting for system admins to implement and manage cron jobs, placing full control back in the hands of the developer.
// Define a regular task.
class MyEvent extends DRegularEvent {
protected function execute() {
// Do something!
}
// Execute every hour.
public function getInterval() {
return 60;
}
}
Decibel uses the Observer pattern for events. Decibel provides a Dispatcher which manages a list of subscribed observers. The dispatcher is responsible for notifying all subscribed observers upon a change of state, or event.
namespace app\MyApp;
use app\decibel\authorise\DUser;
class MyClass {
public static function callback(DUser $user) {
echo("First login for user '{$user->username}'");
}
}
DUser::subscribeObserver(
array('app\MyApp\MyClass', 'callback'),
DUser::onFirstLogin
);
Decibel's Profiler provides in-depth information about the performance of code within an App. As well as the overall performance of requests, sections of code can be marked for profiling, with statistics including database queries, cache access and memory utilisation.

Performance is integral to Decibel and various caching mechanisms are utilised to ensure efficient delivery of resources over the web. Most caching, including access rights, model instances and rendered HTML occurs automatically. In addition to this, Decibel offers a "public" cache for storing the results of expensive operations.
// Perform an expensive operation.
$value = $this->doSomethingExpensive();
// Store this in the cache for 10 minutes.
$publicCache = DPublicCache::load();
$publicCache->set(get_class($this), 'cache_key', $value, time() + 600);
// Retrieve the value from the cache.
$value = $publicCache->retrieve(get_class($this), 'cache_key');
// Remove the value from the cache.
$value = $publicCache->remove(get_class($this), 'cache_key');
Backup and restoration capabilities are built into the Decibel framework. The PHP PHAR format is used, allowing backups to be checked for integrity before restoration, and even signed for security.
// Specify what to backup.
$backupOptions = new DBackupOptions();
$backupOptions->includeConfiguration = true;
$backupOptions->includeDatabase = true;
// Execute the backup and save in a PHAR file.
$backupManager = DBackupManager::load();
$backupManager->backup($backupOptions, '/home/backup/new_backup.phar');
// Restore an earlier backup.
$backupManager->restore('/home/backup/previous_backup.phar');
Decibel's flexible authorisation system allows authentication of users against any source, including Decibel's in-built user database. Identification methods, authentication methods and post-login tasks are treated as separate aspects of the login process, allowing the creation of login workflows.
class MyIdentificationMethod extends DDecibelIdentification {
public function identify(DRequest $request) {
if ($request->username == 'user1') {
return User::createFromUsername('user1');
}
return null;
}
}
Decibel audits all security and data manipulation actions to provide complete transparency as to how your App is being employed by your users. Retention management allows you to ensure that your App complies with any relevant organisation policies. Custom audit logs can also be defined.
// Define the properties of the audit record.
class MyAuditRecod extends DAuditRecord {
protected function define() {
$field = new DTextField('username', 'Username');
$this->addField($field);
$field = new DTextField('action', 'Action');
$this->addField($field);
}
}
// Add a record to the audit log.
MyAuditRecord::log(array(
'username' => 'user@test.com',
'action' => 'action1',
));
Decibel can automatically convert media including compressing, cropping and resizing images, and converting uploaded video into all required formats to ensure multi-platform support.
// Retireve the appropriate converter.
$converter = DMediaConverter::getEncoderFor(
'app\decibel\asset\DTheoraVideo',
'app\decibel\asset\DVideo'
);
// Set up properties for converted video.
$properties = new DMediaProperties();
$properties->frameWidth = 600;
$properties->frameHeight = 400;
$properties->bitRate = 256;
// Encode the video.
$converter->encode(
'/home/wwwroot/input.avi',
'/home/wwwroot/output.ogg',
'app\decibel\asset\DTheoraVideo',
$properties
);
Dependencies on server functions, configuration settings or other Apps can be enforced within XML manifests. The update system will ensure all dependencies of an App are available before proceeding with any installation, dramatically reducing the potential for dependency errors.
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<version>1.2.0</version>
<name>My App</name>
<dependencies>
<dependency type="app\decibel\packaging\DPluginDependency">
<name>app\decibel\decibel</name>
<required>6.4.0</required>
</dependency>
<dependency type="app\decibel\packaging\DPhpExtensionDependency">
<name>curl</name>
<required>true</required>
</dependency>
</dependencies>
</manifest>
Decibel uses exceptions to manage error states within the core code, as well as custom code. This provides full control to the developer over the management of errors. Additionally, Decibel provides useful information as to the potential cause of an issue and highlights areas within custom code that have or may potentially introduce issues in the future.
Security policies are integral to Decibel's authentication system. These policies ensure that any application built using the Decibel framework is compliant with organisational policy and any compliance requirements placed upon an organisation. Multiple policies can be defined and applied to different user roles.
Security policies make light work of compliance with standards that include PCI DSS compliance, and a PCI DSS compliant policy available out-of-the-box.
// Define a custom security policy.
class MyCompanyPolicy extends DSecurityPolicy {
// Set default values.
protected function initialise() {
$this->authFactorRequirement = DSecurityPolicy::authFactorsTwo;
$this->failedLoginLockout = 6;
$this->inactiveLockout = 90;
$this->lockoutLength = 30;
$this->maximumSessions = 1;
$this->minimumPasswordLength = 7;
$this->overrideCondition = DSecurityPolicy::overrideStronger;
$this->passwordAutoComplete = false;
$this->passwordLife = 90;
$this->passwordStrength = DSecurityPolicy::passwordStrengthMedium;
$this->rememberedPasswords = 4;
$this->sessionTimeout = 15;
}
}
Permissions for model instances within a Decibel App are controlled using Access Control Lists (ACLs). By default, ACLs exist for the View, Edit and Delete permissions, with the ability to create custom permissions against any defined model. All default actions (e.g. searching, editing and deleting) automatically obey defined ACLs.
// Create models.
$user = User::create();
$article = Article::create();
// Grant edit permission to the user.
$article->grant(Article::permissionEdit, $user);
// Check the grant.
if ($article->hasPermission(Article::permissionEdit, $user)) {
echo('User has permission to edit the article');
}
// Revoke the permission.
$article->revoke(Article::permissionEdit, $user);
// Try to save - this will return an unsuccessful result
// now that the permission has been revoked.
$article->save();
Decibel's Object-relational Mapping (ORM) implementation transparently manages database stucture and data persistence.
// Perform a search against the database.
$articles = Article::search()
->filterByField('publishDate', time(), '>')
->sortBy('publishDate')
->limitTo(3);
// List article titles.
foreach ($articles as $article) {
echo ($article->title . "\n");
}
Decibel is a Model-View-Controller (MVC) framework, ensuring best-practice separation of data, business logic and user interface. The model layer in Decibel completely abstracts storage of data in the database, allowing business data to be represented in a defined structure. Views provide visual representations of data through defined templates, while Controllers are the link between a user and the system. Controllers provide the user with an interface by arranging relevant views into an appropriate layout, translating user input and passing these to the Views.
The Open API architecture of Decibel allows for a vast range of one or two-way integrations to occur with any third-party database or applications. Common integrations such as Salesforce can be performed in as little as 30 minutes, and the most of complex data integrations with bespoke applications generally only take 2 to 5 days.
A wide variety of server configurations are supported, making Decibel suitable for any website, whatever the load requirement. Minimal configuration is required at the application level, and Decibel can even be integrated into standardised hosting environments like cPanel/WHM. This allows domains to be parked and configurations to be updated automatically.
Decibel utilises shared memory caching to ensure that page content is returned to the user as quickly as possible. Caching is permission-aware and handled at a core level - developers only need to tell Decibel how long content can be cached for and let Decibel do the rest.
Decibel frequently issues free updates. While working to a short, medium and long term development program, Decibel reacts quickly to the requirements of the community and the developers that pay for support.
Cutting edge updates are released in a development stream, before being promoted to the stable stream after any final issues are ironed out. Updates can be installed from the appropriate stream in minutes using Decibel's built-in package installation system.



