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