PHPackages                             contao-community-alliance/dc-general-data-provider-php-globals-config-file - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. contao-community-alliance/dc-general-data-provider-php-globals-config-file

ActiveLibrary[File &amp; Storage](/categories/file-storage)

contao-community-alliance/dc-general-data-provider-php-globals-config-file
==========================================================================

File data provider for contao-community-alliance/dc-general

1.0-RC3(8y ago)08912LGPL-3.0-or-laterPHPPHP &gt;=5.3

Since Mar 18Pushed 8y ago4 watchersCompare

[ Source](https://github.com/contao-community-alliance/dc-general-data-provider-php-globals-config-file)[ Packagist](https://packagist.org/packages/contao-community-alliance/dc-general-data-provider-php-globals-config-file)[ Docs](http://c-c-a.org/)[ RSS](/packages/contao-community-alliance-dc-general-data-provider-php-globals-config-file/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (4)Used By (2)

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

[](#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
-----------------

[](#dca-usage-example)

```
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
--------------

[](#output-example)

The produces file look like this:

```
