5
|
1 <?xml version='1.0' encoding='utf-8'?>
|
|
2 <Application id="app" type="Benzin::Web::Application">
|
|
3 <requestCharset>utf-8</requestCharset>
|
|
4 <securityFactory type="IMPL::Object::Factory">
|
|
5 <factory>IMPL::Config</factory>
|
|
6 <method>spawn</method>
|
|
7 <parameters>security.xml</parameters>
|
|
8 </securityFactory>
|
|
9 <connections type="HASH">
|
|
10 <doxLibrary type="HASH">
|
|
11 <dsn>DBI:mysql:database=test;host=localhost;mysql_socket=/tmp/mysql-benzin.sock;mysql_enable_utf8=1
|
|
12 </dsn>
|
|
13 <user>root</user>
|
|
14 <password />
|
|
15 <AutoCommit>1</AutoCommit>
|
|
16 <mysql_enable_utf8>1</mysql_enable_utf8>
|
|
17 <on_connect_do>set names utf8</on_connect_do>
|
|
18 </doxLibrary>
|
|
19 </connections>
|
|
20 <handlers type="ARRAY">
|
|
21
|
|
22 <!-- Настройка контроллера для вызова методов предметной области -->
|
|
23 <item type="IMPL::Web::Handler::RestController">
|
|
24
|
|
25 <!-- Корневой ресурс -->
|
|
26 <resourceFactory>Benzin::Web::Resources::RootResource
|
|
27 </resourceFactory>
|
|
28 </item>
|
|
29
|
|
30 <!-- Представления -->
|
|
31 <item type="IMPL::Web::Handler::ViewSelector">
|
|
32
|
|
33 <!-- Используя расширения в именах ресурсов можно форсировать определенный
|
|
34 тип представления -->
|
|
35 <types type="HASH">
|
|
36 <json>application/json</json>
|
|
37 <html>text/html</html>
|
|
38 </types>
|
|
39
|
|
40 <!-- Сами представления -->
|
|
41 <views type="ARRAY">
|
|
42
|
|
43 <!-- HTML, используется шаблонизатор -->
|
|
44 <item id="html-view" type="IMPL::Web::Handler::TTPresenter">
|
|
45 <contentType>text/html</contentType>
|
|
46 <contentCharset>utf-8</contentCharset>
|
|
47 <options type="HASH">
|
|
48 <INCLUDE_PATH type="ARRAY">
|
|
49 <item type="IMPL::Config::Reference">
|
|
50 <target>IMPL::Config</target>
|
|
51 <AppDir>view</AppDir>
|
|
52 </item>
|
|
53 <item type="IMPL::Config::Reference">
|
|
54 <target>IMPL::Config</target>
|
|
55 <AppDir>shared_view</AppDir>
|
|
56 </item>
|
|
57 </INCLUDE_PATH>
|
|
58 <INTERPOLATE>1</INTERPOLATE>
|
|
59 <POST_CHOMP>1</POST_CHOMP>
|
|
60 <ENCODING>utf-8</ENCODING>
|
|
61 <COMPILE_DIR>/tmp/ttc</COMPILE_DIR>
|
|
62 </options>
|
|
63 <includes type='ARRAY'>
|
|
64 <item>components</item>
|
|
65 </includes>
|
|
66 <globals id="globals" type="HASH">
|
|
67 <cdn type="IMPL::Config::Include">cdn.xml</cdn>
|
|
68 <site type="HASH">
|
|
69 <name>ImpLab.org</name>
|
|
70 </site>
|
|
71 <aliases type="HASH">
|
|
72 <form>IMPL::Web::View::TTFormContainer</form>
|
|
73 </aliases>
|
|
74 </globals>
|
|
75 </item>
|
|
76
|
|
77 <!-- JSON используется преобразование в JSON -->
|
|
78 <item type="IMPL::Web::Handler::JSONView">
|
|
79 <transform>Benzin::JSON</transform>
|
|
80 </item>
|
|
81 </views>
|
|
82 </item>
|
|
83
|
|
84 <item type="IMPL::Web::Handler::LocaleHandler">
|
|
85 <locales type="ARRAY">
|
|
86 <item>ru-RU</item>
|
|
87 <item>en-US</item>
|
|
88 </locales>
|
|
89 <default>en-US</default>
|
|
90 </item>
|
|
91
|
|
92 <item type="Benzin::Web::EnvAuthHandler" />
|
|
93 <!-- модуль аутентификации по cookies -->
|
|
94
|
|
95 <item type="IMPL::Web::Handler::SecureCookie" />
|
|
96
|
|
97 <!-- Обработчик ошибок, также использует шаблонизатор -->
|
|
98 <item type="IMPL::Web::Handler::ErrorHandler">
|
|
99 <contentType>text/html</contentType>
|
|
100 <view id="tt-view" type="IMPL::Web::View::TTView">
|
|
101 <options type="HASH">
|
|
102 <INCLUDE_PATH type="ARRAY">
|
|
103 <item type="IMPL::Config::Reference">
|
|
104 <target>IMPL::Config</target>
|
|
105 <AppDir>view</AppDir>
|
|
106 </item>
|
|
107 <item type="IMPL::Config::Reference">
|
|
108 <target>IMPL::Config</target>
|
|
109 <AppDir>shared_view</AppDir>
|
|
110 </item>
|
|
111 </INCLUDE_PATH>
|
|
112 <INTERPOLATE>1</INTERPOLATE>
|
|
113 <POST_CHOMP>1</POST_CHOMP>
|
|
114 <ENCODING>utf-8</ENCODING>
|
|
115 <COMPILE_DIR>/tmp/ttc</COMPILE_DIR>
|
|
116 </options>
|
|
117 <layoutBase>layout</layoutBase>
|
|
118 <viewBase>errors</viewBase>
|
|
119 <layout>default</layout>
|
|
120 <includes type='ARRAY'>
|
|
121 <item>includes</item>
|
|
122 </includes>
|
|
123 <globals refid="globals" />
|
|
124 </view>
|
|
125 <errors type="HASH">
|
|
126 <error extname="500">500</error>
|
|
127 <error extname="404">404</error>
|
|
128 <error extname="403">403</error>
|
|
129 <error extname="401">401</error>
|
|
130 </errors>
|
|
131 <fallback>500</fallback>
|
|
132 </item>
|
|
133 </handlers>
|
|
134 </Application> |