1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
6: * @package Nette\Config\Adapters
7: */
8:
9:
10:
11: /**
12: * Reading and generating PHP files.
13: *
14: * @author David Grudl
15: * @package Nette\Config\Adapters
16: */
17: class NConfigPhpAdapter extends NObject implements IConfigAdapter
18: {
19:
20: /**
21: * Reads configuration from PHP file.
22: * @param string file name
23: * @return array
24: */
25: public function load($file)
26: {
27: return NLimitedScope::load($file);
28: }
29:
30:
31: /**
32: * Generates configuration in PHP format.
33: * @return string
34: */
35: public function dump(array $data)
36: {
37: return "<?php // generated by Nette \nreturn " . NPhpHelpers::dump($data) . ';';
38: }
39:
40: }
41: