PHPackages                             fccn/webapp-tools-common - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. fccn/webapp-tools-common

ActiveLibrary[Framework](/categories/framework)

fccn/webapp-tools-common
========================

A collection of common tools to be used when developing web applications

1.0.1(8y ago)013412MITPHPPHP &gt;=5.5.0

Since Nov 3Pushed 8y ago3 watchersCompare

[ Source](https://github.com/fccn/wt-common)[ Packagist](https://packagist.org/packages/fccn/webapp-tools-common)[ RSS](/packages/fccn-webapp-tools-common/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (2)

Webapp tools - Common tools collection
======================================

[](#webapp-tools---common-tools-collection)

This collection provides common utilities for the webapp skeleton project, such as site configuration singleton loader a singleton file logger and a collection of utility functions for generating content.

Installation
------------

[](#installation)

You can install this collection in your project using composer

```
composer require fccn/webapp-tools-common

```

Collection components
---------------------

[](#collection-components)

The following components are part of this collection.

### Site configuration loader

[](#site-configuration-loader)

This is a singleton class that provides a centralized location for the application configuration. The configuration is loaded from a single PHP file, containing an array with all configuration options. It is also possible to use multiple configuration files as long as the main configuration file that is loaded by the configuration loader requires the remaining configuration files.

#### Configuration

[](#configuration)

The path to the configuration file can be defined in the *CONFIG\_FILE* variable. Just add in your code `define("CONFIG_FILE", );` before loading this collection. If the path to the configuration file is not set it defaults to config.php on the root folder.

An example of the possible content of the configuration file is shown below:

```
$c = array(
  "install_path"    => $fs_root,
  "base_path"       => "",
  "assets_path"     => $fs_root."/assets",
  "logfile_path"    => $fs_root."/logs/test.log",
  "logfile_level"     => "DEBUG",
));
```

The configuration file needs to follow a set of directives in order for it to be correctly loaded in the configuration loader:

- the configuration settings must be in the form of key =&gt; value
- the settings must be defined inside an array named *$c*
- you can define other variables in the configuration but the configuration loader will only look for the key value pairs inside *$c*

A sample of a configuration file can be found in **samples/config\_sample.php**. The

#### Usage

[](#usage)

To access the configuration loader use `\Fccn\Lib\SiteConfig::getInstance()`. To get the configuration value use the get() method, for example, to get the value for *logfile\_path* use `\Fccn\Lib\SiteConfig::getInstance()->get('logfile_path')`.

You can also add new configurations or replace a configuration on demand by using the set() method `\Fccn\Lib\SiteConfig::getInstance()->set('key','value')`. However, these values are not permanently stored in the configuration file.

### File logger

[](#file-logger)

The file logger is a configurable wrapper for Monolog. It provides a singleton class for writing debug, notice, info, warn and error messages. It uses the configuration loader to load the settings for the path to the logfile and the log level.

#### Configuration

[](#configuration-1)

The following key-value pairs need to be added to the application configuration file *$c* array:

```
$c = array(
    ...
    "logfile_path"    => "path-to-log-file",
    "logfile_level"     => "DEBUG|ERROR|INFO|NOTICE|WARNING",
    ...
  )
```

#### Usage

[](#usage-1)

To write a log line you can use the error(), warn(), info(), notice() and debug() methods. For example to write a warning log line use `\Fccn\Lib\FileLogger::warn('some warning')`.

To get the singleton instance of the file logger use `\Fccn\Lib\FileLogger::getInstance()`

### Web application utilities

[](#web-application-utilities)

This presents a collection of utilities that are used by the webapp skeleton project. At this moment the following functions are available:

- compress\_params - turns an array of parameters into a compressed string to use on GET requests
- decompress\_params - retrieve the array of parameters from the compressed string from the method above

#### Configuration

[](#configuration-2)

No configuration is required to use the web application utilities

#### Usage

[](#usage-2)

```
//compress parameters to use on a GET request
\Fccn\Lib\WebAppUtils::compress_params('param1' => 'val1', 'param2' => 2)

//retrieve parameters from a GET parameter
\Fccn\Lib\WebAppUtils::decompress_params($_GET['params']);
```

Testing
-------

[](#testing)

This project uses codeception for testing. To run the tests call `composer test` on the root of the project folder.

Contributing
------------

[](#contributing)

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/fccn/wt-common/tags).

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

3111d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6efba5d9e65dd75d8c1abb0fc271d6516d58df27c558da0e14ef1ed0a8b1cf35?d=identicon)[pcosta](/maintainers/pcosta)

---

Tags

frameworkpsr7fccn

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/fccn-webapp-tools-common/health.svg)

```
[![Health](https://phpackages.com/badges/fccn-webapp-tools-common/health.svg)](https://phpackages.com/packages/fccn-webapp-tools-common)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[mako/framework

Mako Framework

249170.3k23](/packages/mako-framework)[gotzmann/comet

Modern PHP framework for building blazing fast REST APIs and microservices

68816.2k1](/packages/gotzmann-comet)[yorcreative/laravel-scrubber

A laravel package that scrubs sensitive information for you.

15467.2k2](/packages/yorcreative-laravel-scrubber)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
