| 1 |
<?php |
| 2 |
|
| 3 |
$container = new ResponsiveMenu\Routing\Container(); |
| 4 |
|
| 5 |
$container['option_helpers'] = function($c) { |
| 6 |
include dirname(__FILE__) . '/option_helpers.php'; |
| 7 |
return $option_helpers; |
| 8 |
}; |
| 9 |
|
| 10 |
$container['default_options'] = function($c) { |
| 11 |
include dirname(__FILE__) . '/default_options.php'; |
| 12 |
return $default_options; |
| 13 |
}; |
| 14 |
|
| 15 |
$container['database'] = function($c) { |
| 16 |
return new ResponsiveMenu\Database\WpDatabase; |
| 17 |
}; |
| 18 |
|
| 19 |
$container['option_factory'] = function($c) { |
| 20 |
return new ResponsiveMenu\Factories\OptionFactory( |
| 21 |
$c['default_options'], |
| 22 |
$c['option_helpers'] |
| 23 |
); |
| 24 |
}; |
| 25 |
|
| 26 |
$container['option_repository'] = function($c) { |
| 27 |
return new ResponsiveMenu\Repositories\OptionRepository( |
| 28 |
$c['database'], |
| 29 |
$c['option_factory'], |
| 30 |
$c['default_options'] |
| 31 |
); |
| 32 |
}; |
| 33 |
|
| 34 |
$container['option_service'] = function($c) { |
| 35 |
return new ResponsiveMenu\Services\OptionService( |
| 36 |
$c['option_repository'], |
| 37 |
$c['option_factory'] |
| 38 |
); |
| 39 |
}; |
| 40 |
|
| 41 |
$container['current_version'] = function($c) { |
| 42 |
return '3.0.8'; |
| 43 |
}; |
| 44 |
|
| 45 |
$container['old_version'] = function($c) { |
| 46 |
return get_option('RMVer'); |
| 47 |
}; |
| 48 |
|
| 49 |
$container['old_options'] = function($c) { |
| 50 |
return get_option('RMOptions'); |
| 51 |
}; |
| 52 |
|
| 53 |
$container['migration'] = function($c) { |
| 54 |
return new ResponsiveMenu\Database\Migration( |
| 55 |
$c['database'], |
| 56 |
$c['option_service'], |
| 57 |
$c['default_options'], |
| 58 |
$c['current_version'], |
| 59 |
$c['old_version'], |
| 60 |
$c['old_options'] |
| 61 |
); |
| 62 |
}; |
| 63 |
|
| 64 |
$container['admin_view'] = function($c) { |
| 65 |
return new ResponsiveMenu\View\AdminView; |
| 66 |
}; |
| 67 |
|
| 68 |
$container['front_view'] = function($c) { |
| 69 |
return new ResponsiveMenu\View\FrontView; |
| 70 |
}; |
| 71 |
|
| 72 |
$container['admin_controller'] = function($c) { |
| 73 |
return new ResponsiveMenu\Controllers\Admin( |
| 74 |
$c['option_service'], |
| 75 |
$c['admin_view'] |
| 76 |
); |
| 77 |
}; |
| 78 |
|
| 79 |
$container['front_controller'] = function($c) { |
| 80 |
return new ResponsiveMenu\Controllers\Front( |
| 81 |
$c['option_service'], |
| 82 |
$c['front_view'] |
| 83 |
); |
| 84 |
}; |
| 85 |
|