Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • IniAdapter
  • NeonAdapter
  • PhpAdapter
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage
 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:  */
 7: 
 8: namespace Nette\DI\Config\Adapters;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * Reading and generating PHP files.
15:  *
16:  * @author     David Grudl
17:  */
18: class PhpAdapter extends Nette\Object implements Nette\DI\Config\IAdapter
19: {
20: 
21:     /**
22:      * Reads configuration from PHP file.
23:      * @param  string  file name
24:      * @return array
25:      */
26:     public function load($file)
27:     {
28:         return require $file;
29:     }
30: 
31: 
32:     /**
33:      * Generates configuration in PHP format.
34:      * @return string
35:      */
36:     public function dump(array $data)
37:     {
38:         return "<?php // generated by Nette \nreturn " . Nette\PhpGenerator\Helpers::dump($data) . ';';
39:     }
40: 
41: }
42: 
Nette 2.2 API documentation generated by ApiGen 2.8.0