-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathdcms2.sql
368 lines (303 loc) · 142 KB
/
dcms2.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- 主机: 127.0.0.1
-- 生成日期: 2014 年 05 月 22 日 05:20
-- 服务器版本: 5.5.27
-- PHP 版本: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- 数据库: `dcms2`
--
-- --------------------------------------------------------
--
-- 表的结构 `tbl_category`
--
CREATE TABLE IF NOT EXISTS `tbl_category` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`root` int(10) unsigned DEFAULT NULL,
`lft` int(10) unsigned NOT NULL,
`rgt` int(10) unsigned NOT NULL,
`level` smallint(5) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`summary` varchar(255) NOT NULL,
`seo_title` varchar(255) NOT NULL,
`seo_keywords` varchar(255) NOT NULL,
`seo_description` varchar(255) NOT NULL,
`created_by` int(11) NOT NULL,
`updated_by` int(11) NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `root` (`root`),
KEY `lft` (`lft`),
KEY `rgt` (`rgt`),
KEY `level` (`level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=88 ;
--
-- 转存表中的数据 `tbl_category`
--
INSERT INTO `tbl_category` (`id`, `root`, `lft`, `rgt`, `level`, `name`, `summary`, `seo_title`, `seo_keywords`, `seo_description`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(83, 83, 1, 10, 1, 'root', '', '', '', '', 1, 1, 1400228463, 1400228463),
(84, 83, 2, 3, 2, 'Yii Framework', '', '', '', '', 1, 1, 1400228477, 1400597374),
(85, 83, 4, 5, 2, 'DCMS', '', 'the best cms', 'dcms yii2', 'the best cms for everyone', 1, 1, 1400228502, 1400654313),
(86, 83, 6, 7, 2, 'Forum', '', '', '', '', 1, 1, 1400228518, 1400597420),
(87, 83, 8, 9, 2, 'Other', '', '', '', '', 1, 1, 1400596376, 1400597429);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_comment`
--
CREATE TABLE IF NOT EXISTS `tbl_comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) NOT NULL,
`type` tinyint(4) NOT NULL DEFAULT '0',
`content` text NOT NULL,
`status` tinyint(4) NOT NULL,
`create_time` int(11) NOT NULL,
`author` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`ip` varchar(255) NOT NULL,
`up` int(11) NOT NULL DEFAULT '0',
`down` int(11) NOT NULL DEFAULT '0',
`post_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=87 ;
--
-- 转存表中的数据 `tbl_comment`
--
INSERT INTO `tbl_comment` (`id`, `parent_id`, `type`, `content`, `status`, `create_time`, `author`, `email`, `url`, `ip`, `up`, `down`, `post_id`, `user_id`) VALUES
(86, 0, 1, 'i like it', 1, 1400679732, '', '', '', '127.0.0.1', 0, 0, 3, 1);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_config`
--
CREATE TABLE IF NOT EXISTS `tbl_config` (
`key` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `tbl_config`
--
INSERT INTO `tbl_config` (`key`, `value`) VALUES
('signup', 'a:4:{s:11:"allowSignup";s:1:"1";s:7:"message";s:39:"Signup will be open in the near future.";s:8:"holdUser";s:0:"";s:15:"signupVerifyWay";s:1:"1";}'),
('siteInfo', 'a:10:{s:8:"siteName";s:5:"DCMS ";s:7:"siteUrl";s:0:"";s:9:"siteTitle";s:22:"DCMS - Easy to use cms";s:12:"siteKeywords";s:5:"DCMS ";s:15:"siteDescription";s:5:"DCMS ";s:10:"adminEmail";s:0:"";s:13:"siteCopyright";s:49:"Copyright @ 2014 CMSBOOM.COM All Rights Reserved.";s:8:"statCode";N;s:6:"closed";s:1:"1";s:7:"message";s:16:"Website upgrade!";}');
-- --------------------------------------------------------
--
-- 表的结构 `tbl_link`
--
CREATE TABLE IF NOT EXISTS `tbl_link` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL,
`logo` varchar(255) NOT NULL,
`position` tinyint(3) unsigned NOT NULL DEFAULT '0',
`target` tinyint(3) unsigned NOT NULL DEFAULT '0',
`type` tinyint(3) unsigned NOT NULL DEFAULT '0',
`visible` tinyint(3) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- 转存表中的数据 `tbl_link`
--
INSERT INTO `tbl_link` (`id`, `name`, `url`, `logo`, `position`, `target`, `type`, `visible`) VALUES
(1, 'fircms', 'http://www.fircms.com/', '', 0, 1, 0, 1),
(2, 'yincart', 'http://www.yincart.com/', '', 0, 1, 0, 1),
(3, '杰奇', 'http://www.jieqi.com/', '', 0, 1, 0, 1),
(4, 'itfeed', 'http://www.itfeed.com/', '', 0, 1, 0, 1);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_lookup`
--
CREATE TABLE IF NOT EXISTS `tbl_lookup` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
`code` int(11) NOT NULL,
`type` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
`position` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `tbl_lookup`
--
INSERT INTO `tbl_lookup` (`id`, `name`, `code`, `type`, `position`) VALUES
(1, 'Slides', 1, '{{post}}type', 1),
(2, 'Headline', 2, '{{post}}type', 2),
(3, 'Recommend', 3, '{{post}}type', 3),
(5, 'publish', 1, '{{post}}status', 1),
(6, 'draft', 2, '{{post}}status', 2),
(7, 'pending', 3, '{{post}}status', 3);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_nav`
--
CREATE TABLE IF NOT EXISTS `tbl_nav` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`root` int(10) unsigned DEFAULT NULL,
`lft` int(10) unsigned NOT NULL,
`rgt` int(10) unsigned NOT NULL,
`level` smallint(5) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`target` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
KEY `root` (`root`),
KEY `lft` (`lft`),
KEY `rgt` (`rgt`),
KEY `level` (`level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
--
-- 转存表中的数据 `tbl_nav`
--
INSERT INTO `tbl_nav` (`id`, `root`, `lft`, `rgt`, `level`, `name`, `url`, `target`) VALUES
(1, 1, 1, 12, 1, 'Top navs', '', 0),
(4, 1, 2, 3, 2, 'Home', 'http://127.0.0.1/dcms2/web/', 0),
(5, 1, 4, 5, 2, 'About', 'http://127.0.0.1/dcms2/web/page/view?name=about', 0),
(6, 1, 6, 7, 2, 'Contact', 'http://127.0.0.1/dcms2/web/page/view?name=contact', 0),
(8, 1, 8, 9, 2, 'DCMS', '', 0),
(9, 1, 10, 11, 2, 'Forum', '', 0);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_page`
--
CREATE TABLE IF NOT EXISTS `tbl_page` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
`seo_title` varchar(255) NOT NULL,
`seo_keywords` varchar(255) NOT NULL,
`seo_description` varchar(255) NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tbl_page`
--
INSERT INTO `tbl_page` (`id`, `name`, `title`, `content`, `seo_title`, `seo_keywords`, `seo_description`, `created_at`, `updated_at`) VALUES
(1, 'about', '关于我们', '美观,易用,安全,一直是我们所追求的!', '', '', '', 1400570468, 1400666728),
(2, 'contact', '联系我们', '<div class="page-header" style="margin:20px 0px 30px;">\r\n <h4>\r\n 技术支持\r\n </h4>\r\n</div>\r\nQQ群:236534985\r\n<div class="page-header" style="margin:20px 0px 30px;">\r\n <h4>\r\n 商务合作\r\n </h4>\r\n</div>\r\nQQ:863155629<br />\r\nEmail:business@cmsboom.com <br />\r\n<p>\r\n 注: 以上联系方式不接受技术咨询,遇到技术问题请到QQ群内提问。\r\n</p>', '', '', '', 1400572262, 1400572512);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_post`
--
CREATE TABLE IF NOT EXISTS `tbl_post` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(10) NOT NULL,
`title` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`thumbnail` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`summary` varchar(255) NOT NULL,
`source` varchar(255) NOT NULL,
`writer` varchar(255) NOT NULL,
`content` text NOT NULL,
`tags` varchar(255) NOT NULL,
`seo_title` varchar(255) NOT NULL,
`seo_keywords` varchar(255) NOT NULL,
`seo_description` varchar(255) NOT NULL,
`published_at` int(11) NOT NULL,
`views` int(11) NOT NULL,
`likes` int(11) NOT NULL,
`comment_count` int(11) NOT NULL,
`disallow_comment` tinyint(4) NOT NULL,
`status` tinyint(4) NOT NULL,
`created_by` int(11) NOT NULL,
`updated_by` int(11) NOT NULL,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `tbl_post`
--
INSERT INTO `tbl_post` (`id`, `category_id`, `title`, `type`, `thumbnail`, `url`, `summary`, `source`, `writer`, `content`, `tags`, `seo_title`, `seo_keywords`, `seo_description`, `published_at`, `views`, `likes`, `comment_count`, `disallow_comment`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(3, 84, 'Yii 2.0 Beta is released', '3', '/dcms2/web/upload/post/201405/205552uzwxzw325orjx3qo.png', '', '', 'yii framework', 'Jane', '<p style="color:#666666;font-size:14px;font-family:微软雅黑;background-color:#FFFFFF;">\r\n <span style="font-weight:bold;"> </span> \r\n</p>\r\n<div class="date" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;background-color:#FFFFFF;color:#999999;font-family:Arial, sans-serif;">\r\n <div class="date" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;background-color:#FFFFFF;color:#999999;font-family:Arial, sans-serif;">\r\n APR 13, 2014\r\n </div>\r\n <div class="content" style="margin:10px 0px 0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;background-color:#FFFFFF;color:#222222;font-family:Arial, sans-serif;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n We are very pleased to announce the Beta release of Yii Framework version 2. You can <a href="http://www.yiiframework.com/download/">download it from yiiframework.com</a>.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n This Beta release includes hundreds of new features, changes and bug fixes that have been made since the <a href="http://www.yiiframework.com/news/76/yii-2-0-alpha-is-released/">alpha release</a>. We will review the most important ones in the following. But first, we would like to answer some commonly asked questions regarding Beta.\r\n </p>\r\n <h2 style="font-size:23px;vertical-align:baseline;background-color:transparent;">\r\n Commonly Asked Questions\r\n </h2>\r\n <ul style="vertical-align:baseline;background-color:transparent;">\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n <strong>What does Beta mean?</strong> Beta means feature and design freeze. After Beta and before GA (General Availability), we will mainly focus on fixing bugs and finishing documentation. We will no longer introduce major new features or significant design changes. There may still be changes that will break BC (Backward Compatibility), but we will try to minimize them and will record clearly the BC-breaking changes.\r\n </p>\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n <strong>When will GA be released?</strong> We do not have an exact date for that yet. Since our focus next is mainly on bug fixes and documentation, we expect it will not take long to reach GA.\r\n </p>\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n <strong>Can I use Beta for my projects?</strong> Do not use Beta if your project is on a tight schedule and you are not familiar with Yii 2.0 yet. Otherwise, you may consider using Yii 2 Beta, provided that you are comfortable with occasional BC-breaking changes. We have heard there are already many projects built on 2.0 master and are working well. Also keep in mind that the minimum PHP version required is 5.4.\r\n </p>\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n <strong>Are there any documentation for 2.0?</strong> Yes, we have <a href="http://www.yiiframework.com/doc-2.0/guide-index.html">The Definitive Guide</a> and <a href="http://www.yiiframework.com/doc-2.0/">the API documentation</a>. And we are still adding more contents to the former.\r\n </p>\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n <strong>How can I upgrade my applications written in 1.1 to 2.0?</strong> Please refer to <a href="http://www.yiiframework.com/doc-2.0/guide-upgrade-from-v1.html">Upgrading from Yii 1.1</a>. Note that since 2.0 is a complete rewrite of 1.1, the upgrade will not be trivial. However, if you are familiar with 1.1, you will find many similarities in 2.0, which should help you to adopt 2.0 more quickly.\r\n </p>\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n <strong>How can I upgrade from 2.0 alpha?</strong> If you are updating alpha version via Composer you need to remove everything except .gitignore from vendor directory and re-run composer. This is a one-time thing that will not be required for any future releases. Please check the <a href="https://github.com/yiisoft/yii2/blob/2.0.0-beta/framework/CHANGELOG.md">CHANGELOG</a> file in the release to find out more details about the BC-breaking changes.\r\n </p>\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n <strong>How can I follow the 2.0 development?</strong> All development activities of Yii 2.0 can be found on GitHub:<a href="https://github.com/yiisoft/yii2">https://github.com/yiisoft/yii2</a>. You may watch or star this project to receive development updates. You may also follow our twitter updates at <a href="https://twitter.com/yiiframework">https://twitter.com/yiiframework</a>.\r\n </p>\r\n </li>\r\n </ul>\r\n <h2 style="font-size:23px;vertical-align:baseline;background-color:transparent;">\r\n Major Changes since 2.0 Alpha\r\n </h2>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n You may find a complete list of changes in the <a href="https://github.com/yiisoft/yii2/blob/2.0.0-beta/framework/CHANGELOG.md">CHANGELOG</a>. Below we are summarizing the most important new features and changes.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Structure\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Yii 2 now follows the <a href="https://github.com/php-fig/fig-standards/blob/master/proposed/psr-4-autoloader/psr-4-autoloader.md">PSR-4 standard</a> for its class autoloading. This results in three improvements:\r\n </p>\r\n <ul style="vertical-align:baseline;background-color:transparent;">\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Simpler framework directory structure.\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Simpler extensions directory structure.\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n We''ve dropped PEAR-style class naming resulting in simpler and faster autoloading.\r\n </li>\r\n </ul>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Controller classes are now required to be namespaced and must be located under Module::controllerNamespace, unless you use controller mapping via Module::controllerMap.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n We have added back the support for grouping controllers by subdirectories, which is also supported in 1.1.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Usability\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Usability is one of the highest priorities for the Yii team. That''s why we''re spending lots of time choosing good names for everything, making code work with IDEs better resulting in more pleasant daily development experience.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n We''ve adopted PSR-1 and PSR-2 and got out of the box support from various IDEs, <a href="https://github.com/squizlabs/PHP_CodeSniffer">code style checkers</a> and <a href="https://github.com/fabpot/PHP-CS-Fixer">automatic formatters</a>.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Performance\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n The most notable change is that session is not started until it is actually used. This allows applications to not waste resources on starting sessions unnecessarily.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n If you are using MarkDown in your project, you may find the MarkDown formatting speed is significantly improved. This is because Carsten Brandt (cebe) built a new MarkDown library from scratch after analyzing all existing solutions. The new library is much fast and is easier to be extended. It also supports GitHub flavored format and many other features.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Security\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Yii now uses <em>masked</em> CSRF tokens to prevent <a href="http://breachattack.com/">BREACH</a> type of exploits.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n RBAC biz rules were refactored, which results in a more flexible yet safer solution. We have eliminated the use of eval()for biz rules.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n RESTful API framework\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n A long wanted feature in Yii is the built-in support for RESTful API development. This finally came into reality with the Beta release. Due to the limit of this article, we will not expand the details here. You may refer to <a href="http://www.yiiframework.com/doc-2.0/guide-rest.html">The Definitive Guide</a> for details. Below we mainly summarize the supported features as of now:\r\n </p>\r\n <ul style="vertical-align:baseline;background-color:transparent;">\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Quick prototyping with support for common APIs for ActiveRecord;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Response format negotiation (supporting JSON and XML by default);\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Customizable object serialization with support for selectable output fields;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Proper formatting of collection data and validation errors;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Efficient routing with proper HTTP verb check;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Support for OPTIONS and HEAD verbs;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Authentication;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Authorization;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Support for HATEOAS;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n HTTP Caching;\r\n </li>\r\n <li style="vertical-align:baseline;background-color:transparent;">\r\n Rate limiting.\r\n </li>\r\n </ul>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Dependency Injection and Service Locator\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Many users were asking why Yii does not provide a Dependency Injection (DI) Container. The fact is that Yii has long been providing a similar facility known as Service Locator - the Yii application instance. Now we have formally extracted out the service locator as a reusable component yii\\di\\ServiceLocator. Like before, the Yii application and also modules are both service locators. You may obtain a service (aka. application component in 1.1 terminology) using the expression Yii::$app->get(''something'').\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Besides Service Locator, we also implemented a DI Container yii\\di\\Container to help you develop code in a less coupled way. Our internal profiling shows this DI container is one of the fastest among most notable PHP DI implementations. You may use Yii::$container->set() to configure default settings of classes. The oldYii::$objectConfig is dropped in favor of this new implementation.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Testing\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Yii got integration with the <a href="https://github.com/yiisoft/yii2-codeception">Codeception testing framework</a>. It allows you to test an application as a whole simulating user actions and verifying if resulting output is correct. In contrast with PhpUnit''s selenium support it doesn''t require a browser so it''s easier to install for CI server and runs much faster.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Yii also added more support for building test fixtures, which is often a tedious and time consuming task when building tests. In particular, a <a href="http://www.yiiframework.com/doc-2.0/guide-test-fixture.html">fixture framework</a> is developed to unify the fixture definition and management. We created the <a href="https://github.com/yiisoft/yii2-faker">faker extension</a> by integrating the "faker" library to help you create some realistically-looking faked fixture data.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Both the "basic" and "advanced" application templates now come with tests, including unit tests, functionality tests and acceptance tests. This will give a good start for Test-Driven development.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Model Validation\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n There are many useful enhancements to the model validation feature.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n The UniqueValidator and ExistValidator now support validating multiple columns. Below are some examples about the unique validation rule declaration:\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> a1 needs to be unique</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">unique</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> a1 needs to be unique, but column a2 will be used to check the uniqueness of the a1 value</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">unique</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">targetAttribute</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a2</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> a1 and a2 need to be unique together, and they both will receive an error message</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a2</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">unique</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">targetAttribute</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a2</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> a1 and a2 need to unique together, only a1 will receive the error message</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">unique</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">targetAttribute</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a2</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> a1 needs to be unique by checking the uniqueness of both a2 and a3 (using a1 value)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">unique</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">targetAttribute</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a2</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">a3</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span></pre>\r\n </div>\r\n </div>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Validations can be done conditionally (aka. conditional validation). This is supported by the addition of two propertieswhen and whenClient to each validator. The following example shows how to require the "state" input only when the country is selected as "USA":\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">state</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">required</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">when</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">function</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$model</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">return</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$model</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">country</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> == </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Country</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">USA</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">}</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">whenClient</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">function (attribute, value) {\r\n return $(''#country'').value == ''USA'';\r\n }</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span></pre>\r\n </div>\r\n </div>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Sometimes, you may want to do some ad-hoc data validation without the trouble of writing new model classes. You can accomplish this with the help of the new yii\\base\\DynamicModel. For example,\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">public</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">function</span> <span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">actionSearch</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$name</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$email</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$model</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> = </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">DynamicModel</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">validateData</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">compact</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">name</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">email</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">name</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">email</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">string</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">max</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-number" style="vertical-align:baseline;background-color:transparent;color:maroon;">128</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">email</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">email</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">if</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$model</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">hasErrors</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> validation fails</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">}</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">else</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> validation succeeds</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">}</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">}</span></pre>\r\n </div>\r\n </div>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Database and Active Record\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Database-related features are one of the strongest sides of Yii. They were quite interesting when alpha was released and now beta brought more improvements and features. Among support for SQL databases we have ActiveRecord implementations for <a href="http://www.elasticsearch.org/">elasticsearch</a>, <a href="http://redis.io/">redis</a> and <a href="http://sphinxsearch.com/docs/">Sphinx search</a> already. The Beta version now brings support for the<a href="https://www.mongodb.org/">mongodb</a> document storage.\r\n </p>\r\n <h4 style="font-size:19px;vertical-align:baseline;background-color:transparent;">\r\n Nested Transaction Support\r\n </h4>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Yii now supports nested transactions. As a result, you can safely start a transaction without worrying if there is already an existing transaction enclosing it.\r\n </p>\r\n <h4 style="font-size:19px;vertical-align:baseline;background-color:transparent;">\r\n Join Queries\r\n </h4>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n We added ActiveQuery::joinWith() to support creating JOIN SQL statements using the AR relations you have already declared. This is especially useful when you want to filter or sort by columns from foreign tables. For example,\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> find all orders and sort the orders by the customer id and the order id. also eager loading "customer"</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$orders</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> = </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Order</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">find</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">joinWith</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">customer</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">orderBy</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">customer.id, order.id</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">all</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> find all orders that contain books, and eager loading "books"</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$orders</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> = </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Order</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">find</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">innerJoinWith</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">books</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">all</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">;</span></pre>\r\n </div>\r\n </div>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n This feature is especially useful when displaying relational columns in a GridView. It became very easy making them sortable and filterable using joinWith().\r\n </p>\r\n <h4 style="font-size:19px;vertical-align:baseline;background-color:transparent;">\r\n Data Typecasting\r\n </h4>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n ActiveRecord will now convert data retrieved from the database to proper types. For example, if you have an integer column type, after the corresponding ActiveRecord instance is populated, you will find the type attribute gets an integer value, rather than a string value.\r\n </p>\r\n <h4 style="font-size:19px;vertical-align:baseline;background-color:transparent;">\r\n Searching\r\n </h4>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n To facilitate building search functionality, we have added the Query::filterWhere() method which will automatically remove empty filter values. For example, if you have a search form with name and email filter fields. You may use the following code to build the search query. Without this method, you would have to check if the user has entered anything in a filter field, and if not you will not put it in the query condition. filterWhere() will only add non-empty fields to the condition.\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$query</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> = </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">User</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">find</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">filterWhere</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">[</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">name</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Yii</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$app</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">request</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">get</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">name</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">email</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Yii</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$app</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">request</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">get</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">email</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">]</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">;</span></pre>\r\n </div>\r\n </div>\r\n <h4 style="font-size:19px;vertical-align:baseline;background-color:transparent;">\r\n Batch Query\r\n </h4>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n To support big data query, we have added the batch query feature which brings back data in batches instead of all at once. This allows you to keep the server memory usage under a limit. For example,\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">use</span> <span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">yii</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">\\</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">db</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">\\</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Query</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$query</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> = </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">new</span> <span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Query</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> -></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">from</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">user</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> -></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">orderBy</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">id</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">foreach</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$query</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">batch</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">as</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$users</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> $users is an array of 100 or fewer rows from the user table</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">}</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> or if you want to iterate the row one by one</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">foreach</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$query</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">each</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">as</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$user</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> $user represents one row of data from the user table</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">}</span></pre>\r\n </div>\r\n </div>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n You may use batch with ActiveRecord too. For example,\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> fetch 10 customers at a time</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">foreach</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Customer</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">find</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">batch</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-number" style="vertical-align:baseline;background-color:transparent;color:maroon;">10</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">as</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$customers</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> </pre>\r\n </div>\r\n </div>\r\n </div>\r\n</div>', 'yii, ', '', '', '', 0, 1120, 2, -4, 0, 1, 1, 1, 1399629616, 1400679454);
INSERT INTO `tbl_post` (`id`, `category_id`, `title`, `type`, `thumbnail`, `url`, `summary`, `source`, `writer`, `content`, `tags`, `seo_title`, `seo_keywords`, `seo_description`, `published_at`, `views`, `likes`, `comment_count`, `disallow_comment`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(4, 84, 'Yii 1.1.14 is released', '3', '/dcms2/web/upload/post/201405/212620sf43xw8177kwg8f7.png', '', '', 'yii framework', 'RED', '<div class="date" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;background-color:#FFFFFF;color:#999999;font-family:Arial, sans-serif;">\r\n AUG 11, 2013\r\n</div>\r\n<div class="content" style="margin:10px 0px 0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;background-color:#FFFFFF;color:#222222;font-family:Arial, sans-serif;">\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n We are very pleased to announce that Yii Framework version 1.1.14 is released. You can download it at<a href="http://www.yiiframework.com/download/">yiiframework.com/download/</a>.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n In this release, we fixed more than 80 bugs and introduced more than 60 minor enhancements and features. We addedCPasswordHelper that provides secure and up to date way to store and verify password hashes; We added CRedisCacheto support using Redis for caching purpose; and Yii can now be installed as a <a href="https://packagist.org/packages/yiisoft/yii">Composer package</a>. For the complete list of changes in this release, please see <a href="https://raw.github.com/yiisoft/yii/1.1.14/CHANGELOG">the change log</a>.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n We have received significant contributions to this release from our community users (e.g. creocoder, tom--, paystey, Ragazzo, antoncpu, Yiivgeny) to this release. We hereby thank their effort in making this release available.\r\n </p>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Below we summarize the main enhancements introduced in this release:\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n New helper class CPasswordHelper\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n CPasswordHelper that provides secure and up to date way to store and verify password hashes. Usage is extremely easy:\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> generate hash that will be stored to DB, $password is from accout creation form</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$hash</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> = </span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">CPasswordHelper</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">hashPassword</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$password</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> $hash is what we''ve saved to DB, $password is from login form</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">if</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">CPasswordHelper</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">verifyPassword</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$password</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$hash</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> password is good</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">else</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> password is bad</span></pre>\r\n </div>\r\n </div>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n New methodCDbCommandBuilder::createMultipleInsertCommand()\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n There''s now CDbCommandBuilder::createMultipleInsertCommand() to support insertion of multiple records in a single query:\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$builder</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Yii</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">app</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">db</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">schema</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">commandBuilder</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$command</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=</span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$builder</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">createMultipleInsertCommand</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">tbl_post</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">title</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">record 1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">text</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">text1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">title</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">record 2</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">text</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">text2</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$command</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">execute</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">;</span></pre>\r\n </div>\r\n </div>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n New cache component CRedisCache\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n You can now configure application to use Redis as cache backend via protected/config/main.php, components section:\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> ...</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">components</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">cache</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">class</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">CRedisCache</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">hostname</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">localhost</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">port</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-number" style="vertical-align:baseline;background-color:transparent;color:maroon;">6379</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">database</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-number" style="vertical-align:baseline;background-color:transparent;color:maroon;">0</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span></pre>\r\n </div>\r\n </div>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Installing Yii as a <a href="https://packagist.org/packages/yiisoft/yii">Composer package</a>:\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Yii is now can be installed using <a href="https://packagist.org/packages/yiisoft/yii">Composer</a> by adding the following to composer.json.\r\n </p>\r\n<pre>"yiisoft/yii": "dev-master"\r\n</pre>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Logging out a user after specified time\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n If you need a user to be logged out after specified time was passed regardless of his activity you now can use:\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> ...</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">components</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">user</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> ...</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">absoluteAuthTimeout</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-number" style="vertical-align:baseline;background-color:transparent;color:maroon;">60</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">*</span><span class="hl-number" style="vertical-align:baseline;background-color:transparent;color:maroon;">60</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">*</span><span class="hl-number" style="vertical-align:baseline;background-color:transparent;color:maroon;">24</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">,\r\n)</span></pre>\r\n </div>\r\n </div>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n RANGE support for file downloading\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n When using CHttpRequest::sendFile Yii is now responding to RANGE requests. That means faster downloads when client is using multiple threads to download multiple parts of the file.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Using through option with BELONGS_TO\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n "through" option can now be used with CActiveRecord::BELONGS_TO. For details <a href="http://www.yiiframework.com/doc/guide/1.1/en/database.arr#relational-query-with-through">check the guide</a>.\r\n </p>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Selective logging of global variables\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n CLogFilter::$logVars can now be array of arrays intended for designating particular items of the $GLOBALS. For example,\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">components</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">log</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">class</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">CLogRouter</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">routes</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">class</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">system.logging.CWebLogRoute</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">filter</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">class</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">system.logging.CLogFilter</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">logVars</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">_COOKIE</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> old syntax, < 1.1.14</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">_SERVER</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">,</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">REMOTE_ADDR</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> new syntax, >= 1.1.14</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">_SERVER</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">,</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">HTTP_USER_AGENT</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> new syntax, >= 1.1.14</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">,</span></pre>\r\n </div>\r\n </div>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n The configuration shown above would log this:\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$_COOKIE</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=</span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">__utma</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">111872281.473431406.1366046648.1366046648.1366046648.1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">__utmz</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">111872281.1366046648.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">cartVisible</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">96ab4aec0c2977c9b793d4ba009eb3ce</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">...</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">PHPSESSID</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">vb8pk7obs3q2lc7bl8ield7si7</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$_SERVER</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">.</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">REMOTE_ADDR</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">::1</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span> <span class="hl-var" style="vertical-align:baseline;background-color:transparent;color:blue;">$_SERVER</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">.</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">HTTP_USER_AGENT</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span></pre>\r\n </div>\r\n </div>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n New formatter CLocalizedFormatter\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n The new formatter class CLocalizedFormatter allows formatting values according to current locale. For example,\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">components</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">format</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">class</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">system.utils.CLocalizedFormatter</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">locale</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">en_US</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">germanFormat</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">class</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">system.utils.CLocalizedFormatter</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">locale</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">de_DE</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">russianFormat</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">class</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">system.utils.CLocalizedFormatter</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">locale</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">=></span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">ru_RU</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">,</span></pre>\r\n </div>\r\n </div>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">echo</span> <span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Yii</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">app</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">format</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">formatDatetime</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">time</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> . </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-special" style="vertical-align:baseline;background-color:transparent;color:navy;">\\n</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">echo</span> <span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Yii</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">app</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">germanFormat</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">formatDatetime</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">time</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> . </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-special" style="vertical-align:baseline;background-color:transparent;color:navy;">\\n</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">echo</span> <span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">Yii</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">::</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">app</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">russianFormat</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">-></span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">formatDatetime</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">time</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> . </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-special" style="vertical-align:baseline;background-color:transparent;color:navy;">\\n</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">"</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">; </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> Expected result/output:</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> Jul 7, 2013 9:34:56 PM</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> 07.07.2013 21:34:56</span> <span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">//</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;"> 07.07.2013, 21:34:56</span></pre>\r\n </div>\r\n </div>\r\n <h3 style="font-size:21px;vertical-align:baseline;background-color:transparent;">\r\n Generating attribute labels from column comments\r\n </h3>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n Gii is now able to use table columns'' comments as the attribute labels of a new generated model. For example, if a table is defined as follows,\r\n </p>\r\n<pre>CREATE TABLE `tbl_user` (\r\n `id` int(11) NOT NULL AUTO_INCREMENT,\r\n `first_name` varchar(100) NOT NULL COMMENT ''Имя:'',\r\n `last_name` varchar(100) NOT NULL COMMENT ''Nachname:'',\r\n `title` varchar(50) NOT NULL COMMENT ''Title (e.g. Mr., Mrs., etc.):'',\r\n PRIMARY KEY (`id`)\r\n) ENGINE=InnoDB AUTO_INCREMENT=1;\r\n</pre>\r\n <p style="vertical-align:baseline;background-color:transparent;">\r\n The generated attributeLabels method would be (in case the option "Use Column Comments as Attribute Labels" in Gii is checked):\r\n </p>\r\n <div class="hl-code" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:gray;">\r\n <div class="hl-main" style="margin:0px;padding:0px;border:0px;font-size:12px;vertical-align:baseline;background-color:transparent;font-family:''Courier New'', Courier, monospace;">\r\n<pre><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">/*</span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">*\r\n *</span><span class="hl-inlinedoc" style="vertical-align:baseline;background-color:transparent;color:blue;"> @return </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">array customized attribute labels (name=>label) </span><span class="hl-comment" style="vertical-align:baseline;background-color:transparent;font-style:italic;">*/</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">public</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">function</span> <span class="hl-identifier" style="vertical-align:baseline;background-color:transparent;color:green;">attributeLabels</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">)</span> <span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">{</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">return</span> <span class="hl-reserved" style="vertical-align:baseline;background-color:transparent;color:black;font-weight:bold;">array</span><span class="hl-brackets" style="vertical-align:baseline;background-color:transparent;color:olive;">(</span> <span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">id</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">ID</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">first_name</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">Имя:</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;">, </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">last_name</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-code" style="vertical-align:baseline;background-color:transparent;"> => </span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span><span class="hl-string" style="vertical-align:baseline;background-color:transparent;color:red;">Nachname:</span><span class="hl-quotes" style="vertical-align:baseline;background-color:transparent;color:red;">''</span></pre>\r\n </div>\r\n </div>\r\n</div>', 'yii', '', '', '', 1399713304, 1039, 0, 0, 0, 1, 1, 1, 1399714187, 1400679442);
INSERT INTO `tbl_post` (`id`, `category_id`, `title`, `type`, `thumbnail`, `url`, `summary`, `source`, `writer`, `content`, `tags`, `seo_title`, `seo_keywords`, `seo_description`, `published_at`, `views`, `likes`, `comment_count`, `disallow_comment`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(7, 85, 'DCMS v2.0 is released', '2', '/dcms2/web/upload/post/201405/213342zi7511i8tstt75ei.png', '', '', 'CMSBOOM', 'ff', '<h3>\r\n <strong>Beautiful, easy to use, safe cms</strong> \r\n</h3>', 'DCMS', '', '', '', 1400679171, 0, 0, 0, 0, 1, 1, 1, 1400679318, 1400679341);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_source`
--
CREATE TABLE IF NOT EXISTS `tbl_source` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- 转存表中的数据 `tbl_source`
--
INSERT INTO `tbl_source` (`id`, `name`, `url`) VALUES
(1, 'BBC', 'http://www.bbc.co.uk/'),
(2, 'Techcrunch', ''),
(3, 'CMSBOOM', 'http://www.cmsboom.com/');
-- --------------------------------------------------------
--
-- 表的结构 `tbl_tag`
--
CREATE TABLE IF NOT EXISTS `tbl_tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`frequency` int(11) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
--
-- 转存表中的数据 `tbl_tag`
--
INSERT INTO `tbl_tag` (`id`, `name`, `frequency`) VALUES
(7, 'yii', 2),
(8, 'DCMS', 1);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_user`
--
CREATE TABLE IF NOT EXISTS `tbl_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`avatar` varchar(255) NOT NULL,
`auth_key` varchar(32) NOT NULL,
`password_hash` varchar(255) NOT NULL,
`password_reset_token` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`role` smallint(6) NOT NULL DEFAULT '10',
`status` smallint(6) NOT NULL DEFAULT '10',
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tbl_user`
--
INSERT INTO `tbl_user` (`id`, `username`, `avatar`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `role`, `status`, `created_at`, `updated_at`) VALUES
(1, 'admin', '/dcms2/web/upload/avatar/182124gwttlmaad0ms2t7t.png', '2MdieSAZQ22aNP54r3vtlDN6IplMz-8n', '$2y$13$/teKh.FIM5g0zoO9n5YMBuojW5UcXjkvnwYMz1T8igLeesHKU0nq2', NULL, 'admin@admin.com', 10, 10, 1399269736, 1400681953),
(2, 'jane', '', 'J1ovG-eQ-rzCtIiJ2saH6avaV9RaMXSG', '$2y$13$gnHusAF/J6OD3al6mu1.QeohRnEUyB5MgggohusaIk3ds0CBZgyYq', NULL, 'jane@qq.com', 10, 10, 1400227693, 1400227693);
-- --------------------------------------------------------
--
-- 表的结构 `tbl_writer`
--
CREATE TABLE IF NOT EXISTS `tbl_writer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tbl_writer`
--
INSERT INTO `tbl_writer` (`id`, `name`) VALUES
(1, 'Jane'),
(2, 'RED');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;