Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/contao-community-alliance/dc-general-data-provider-php-globals-config-file


https://github.com/contao-community-alliance/dc-general-data-provider-php-globals-config-file

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

PHP GLOBALS configuration file provider
=======================================

This data provider for the [dc-general](https://github.com/contao-community-alliance/dc-general) load and store the
data in the PHP `$GLOBALS` array, using a single php file.

DCA Usage example
-----------------

```php
use ContaoCommunityAlliance\DcGeneral\DataProvider\PhpGlobalsConfigFileProvider;

$GLOBALS['TL_DCA']['my_dca'] = array
(
'config' => array(
'dataContainer' => 'General',
),
'dca_config' => array
(
'data_provider' => array
(
'default' => array
(
'class' => 'ContaoCommunityAlliance\DcGeneral\DataProvider\PhpGlobalsConfigFileProvider',

/**
* The source filename.
*/
'source' => 'path/to/the/config.php',

/**
* The namespace definition (default=null, optional).
*/
'namespace' => 'my/dca',

/**
* The property key name pattern (default="*", optional).
*/
'pattern' => 'my_*',

/**
* Save mode (default="diff", optional)
*/
'mode' => PhpGlobalsConfigFileProvider::MODE_ALL,
)
),
),
);
```

Output example
--------------

The produces file look like this:

```php