@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $this->title = Yii::t('audit', 'Error #{id}', ['id' => $model->id]); |
12 | 12 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']]; |
13 | 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Errors'), 'url' => ['index']]; |
14 | -$this->params['breadcrumbs'][] = '#' . $model->id; |
|
14 | +$this->params['breadcrumbs'][] = '#'.$model->id; |
|
15 | 15 | |
16 | 16 | echo Html::tag('h1', $this->title); |
17 | 17 | |
@@ -44,16 +44,15 @@ discard block |
||
44 | 44 | 'line', |
45 | 45 | [ |
46 | 46 | 'header' => Yii::t('audit', 'Called'), |
47 | - 'value' => function ($data) { |
|
47 | + 'value' => function($data) { |
|
48 | 48 | return |
49 | 49 | isset($data['type']) ? |
50 | - (( isset($data['class']) ? $data['class'] : '[unknown]') . $data['type'] . $data['function']) : |
|
51 | - $data['function']; |
|
50 | + ((isset($data['class']) ? $data['class'] : '[unknown]').$data['type'].$data['function']) : $data['function']; |
|
52 | 51 | } |
53 | 52 | ], |
54 | 53 | [ |
55 | 54 | 'header' => Yii::t('audit', 'Args'), |
56 | - 'value' => function ($data) { |
|
55 | + 'value' => function($data) { |
|
57 | 56 | $out = '<a class="args-toggle glyphicon glyphicon-plus" href="javascript:void(0);"></a>'; |
58 | 57 | $out .= '<pre style="display:none;">'; |
59 | 58 | $out .= !empty($data['args']) ? VarDumper::dumpAsString($data['args']) : ''; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | <?php foreach ($values as $name => $value): ?> |
28 | 28 | <tr> |
29 | 29 | <th><?= Html::encode($name) ?></th> |
30 | - <td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES | ENT_SUBSTITUTE, |
|
30 | + <td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, |
|
31 | 31 | \Yii::$app->charset, true) ?></td> |
32 | 32 | </tr> |
33 | 33 | <?php endforeach; ?> |
@@ -12,7 +12,8 @@ discard block |
||
12 | 12 | |
13 | 13 | <p>Empty.</p> |
14 | 14 | |
15 | -<?php else: ?> |
|
15 | +<?php else { |
|
16 | + : ?> |
|
16 | 17 | |
17 | 18 | <div class="table-responsive"> |
18 | 19 | <table class="table table-condensed table-bordered table-striped table-hover request-table" |
@@ -30,7 +31,9 @@ discard block |
||
30 | 31 | <td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES | ENT_SUBSTITUTE, |
31 | 32 | \Yii::$app->charset, true) ?></td> |
32 | 33 | </tr> |
33 | - <?php endforeach; ?> |
|
34 | + <?php endforeach; |
|
35 | +} |
|
36 | +?> |
|
34 | 37 | </tbody> |
35 | 38 | </table> |
36 | 39 | </div> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $this->title = Yii::t('audit', 'Mail #{id}', ['id' => $model->id]); |
12 | 12 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']]; |
13 | 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Mails'), 'url' => ['index']]; |
14 | -$this->params['breadcrumbs'][] = '#' . $model->id; |
|
14 | +$this->params['breadcrumbs'][] = '#'.$model->id; |
|
15 | 15 | |
16 | 16 | if (Audit::getInstance()->hasMethod('renderEmail')) { |
17 | 17 | Audit::getInstance()->renderEmail($this, $model); |
@@ -21,5 +21,5 @@ discard block |
||
21 | 21 | $parser->setText($model->data); |
22 | 22 | echo $parser->getMessageBody('htmlEmbedded'); |
23 | 23 | } else { |
24 | - echo Html::tag('pre', $model->data) . Html::tag('br') . 'Please register a renderEmail panel function or install php-mime-mail-parser for better functionality'; |
|
24 | + echo Html::tag('pre', $model->data).Html::tag('br').'Please register a renderEmail panel function or install php-mime-mail-parser for better functionality'; |
|
25 | 25 | } |
@@ -15,8 +15,7 @@ |
||
15 | 15 | |
16 | 16 | if (Audit::getInstance()->hasMethod('renderEmail')) { |
17 | 17 | Audit::getInstance()->renderEmail($this, $model); |
18 | -} |
|
19 | -elseif (class_exists('\PhpMimeMailParser\Parser')) { |
|
18 | +} elseif (class_exists('\PhpMimeMailParser\Parser')) { |
|
20 | 19 | $parser = new \PhpMimeMailParser\Parser(); |
21 | 20 | $parser->setText($model->data); |
22 | 21 | echo $parser->getMessageBody('htmlEmbedded'); |
@@ -43,13 +43,15 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function export() |
45 | 45 | { |
46 | - if (!\Yii::$app) |
|
47 | - // Things like this can happen in tests etc, but it is too late for us to do anything about that. |
|
46 | + if (!\Yii::$app) { |
|
47 | + // Things like this can happen in tests etc, but it is too late for us to do anything about that. |
|
48 | 48 | return; |
49 | + } |
|
49 | 50 | |
50 | 51 | $module = $this->module; |
51 | - if (!$module->entry || empty($module->panels)) |
|
52 | - return; |
|
52 | + if (!$module->entry || empty($module->panels)) { |
|
53 | + return; |
|
54 | + } |
|
53 | 55 | |
54 | 56 | $entry = $module->entry; |
55 | 57 | |
@@ -60,11 +62,12 @@ discard block |
||
60 | 62 | $records = array_filter($records); |
61 | 63 | |
62 | 64 | if (!empty($records)) { |
63 | - if ($module->batchSave) |
|
64 | - $entry->addBatchData($records, false); |
|
65 | - else { |
|
66 | - foreach ($records as $type => $record) |
|
67 | - $entry->addData($type, $record, false); |
|
65 | + if ($module->batchSave) { |
|
66 | + $entry->addBatchData($records, false); |
|
67 | + } else { |
|
68 | + foreach ($records as $type => $record) { |
|
69 | + $entry->addData($type, $record, false); |
|
70 | + } |
|
68 | 71 | } |
69 | 72 | } |
70 | 73 | } |
@@ -77,8 +80,7 @@ discard block |
||
77 | 80 | { |
78 | 81 | if ($this->exportAtIntervals) { |
79 | 82 | parent::collect($messages, $final); |
80 | - } |
|
81 | - else { |
|
83 | + } else { |
|
82 | 84 | $this->messages = array_merge($this->messages, static::filterMessages($messages, $this->getLevels(), $this->categories, $this->except)); |
83 | 85 | if ($final) { |
84 | 86 | $this->export(); |
@@ -11,11 +11,11 @@ |
||
11 | 11 | { |
12 | 12 | $this->createTable(self::TABLE, [ |
13 | 13 | 'id' => Schema::TYPE_PK, |
14 | - 'entry_id' => Schema::TYPE_INTEGER . ' NOT NULL', |
|
15 | - 'created' => Schema::TYPE_DATETIME . ' NOT NULL', |
|
16 | - 'type' => Schema::TYPE_STRING . '(20) NOT NULL', |
|
17 | - 'message' => Schema::TYPE_TEXT . ' NOT NULL', |
|
18 | - 'origin' => Schema::TYPE_STRING . '(512)', |
|
14 | + 'entry_id' => Schema::TYPE_INTEGER.' NOT NULL', |
|
15 | + 'created' => Schema::TYPE_DATETIME.' NOT NULL', |
|
16 | + 'type' => Schema::TYPE_STRING.'(20) NOT NULL', |
|
17 | + 'message' => Schema::TYPE_TEXT.' NOT NULL', |
|
18 | + 'origin' => Schema::TYPE_STRING.'(512)', |
|
19 | 19 | 'data' => Schema::TYPE_BINARY, |
20 | 20 | ], $this->db->driverName === 'mysql' ? 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB' : null); |
21 | 21 |
@@ -11,8 +11,8 @@ |
||
11 | 11 | { |
12 | 12 | $this->createTable(self::TABLE, [ |
13 | 13 | 'id' => Schema::TYPE_PK, |
14 | - 'entry_id' => Schema::TYPE_INTEGER . ' NOT NULL', |
|
15 | - 'type' => Schema::TYPE_STRING . '(255) NOT NULL', |
|
14 | + 'entry_id' => Schema::TYPE_INTEGER.' NOT NULL', |
|
15 | + 'type' => Schema::TYPE_STRING.'(255) NOT NULL', |
|
16 | 16 | 'data' => Schema::TYPE_BINARY, |
17 | 17 | ], ($this->db->driverName === 'mysql' ? 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB' : null)); |
18 | 18 |
@@ -11,9 +11,9 @@ |
||
11 | 11 | { |
12 | 12 | $this->createTable(self::TABLE, [ |
13 | 13 | 'id' => Schema::TYPE_PK, |
14 | - 'entry_id' => Schema::TYPE_INTEGER . ' NOT NULL', |
|
15 | - 'created' => Schema::TYPE_DATETIME . ' NOT NULL', |
|
16 | - 'successful' => Schema::TYPE_INTEGER . ' NOT NULL', |
|
14 | + 'entry_id' => Schema::TYPE_INTEGER.' NOT NULL', |
|
15 | + 'created' => Schema::TYPE_DATETIME.' NOT NULL', |
|
16 | + 'successful' => Schema::TYPE_INTEGER.' NOT NULL', |
|
17 | 17 | 'from' => Schema::TYPE_STRING, |
18 | 18 | 'to' => Schema::TYPE_STRING, |
19 | 19 | 'reply' => Schema::TYPE_STRING, |
@@ -12,14 +12,14 @@ |
||
12 | 12 | $this->createTable(self::TABLE, [ |
13 | 13 | 'id' => Schema::TYPE_PK, |
14 | 14 | 'entry_id' => Schema::TYPE_INTEGER, |
15 | - 'user_id' => Schema::TYPE_INTEGER . ' NULL', |
|
16 | - 'action' => Schema::TYPE_STRING . ' NOT NULL', |
|
17 | - 'model' => Schema::TYPE_STRING . ' NOT NULL', |
|
18 | - 'model_id' => Schema::TYPE_STRING . ' NOT NULL', |
|
15 | + 'user_id' => Schema::TYPE_INTEGER.' NULL', |
|
16 | + 'action' => Schema::TYPE_STRING.' NOT NULL', |
|
17 | + 'model' => Schema::TYPE_STRING.' NOT NULL', |
|
18 | + 'model_id' => Schema::TYPE_STRING.' NOT NULL', |
|
19 | 19 | 'field' => Schema::TYPE_STRING, |
20 | 20 | 'old_value' => Schema::TYPE_TEXT, |
21 | 21 | 'new_value' => Schema::TYPE_TEXT, |
22 | - 'created' => Schema::TYPE_DATETIME . ' NOT NULL', |
|
22 | + 'created' => Schema::TYPE_DATETIME.' NOT NULL', |
|
23 | 23 | ], ($this->db->driverName === 'mysql' ? 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB' : null)); |
24 | 24 | |
25 | 25 | if ($this->db->driverName != 'sqlite') { |
@@ -11,14 +11,14 @@ |
||
11 | 11 | { |
12 | 12 | $this->createTable(self::TABLE, [ |
13 | 13 | 'id' => Schema::TYPE_PK, |
14 | - 'created' => Schema::TYPE_DATETIME . ' NOT NULL', |
|
15 | - 'user_id' => Schema::TYPE_INTEGER . ' DEFAULT 0', |
|
16 | - 'duration' => Schema::TYPE_FLOAT . ' NULL', |
|
17 | - 'ip' => Schema::TYPE_STRING . '(45) NULL', |
|
18 | - 'request_method' => Schema::TYPE_STRING . '(16) NULL', |
|
19 | - 'ajax' => Schema::TYPE_INTEGER . '(1) DEFAULT 0 NOT NULL', |
|
20 | - 'route' => Schema::TYPE_STRING . '(255) NULL', |
|
21 | - 'memory_max' => Schema::TYPE_INTEGER . ' NULL', |
|
14 | + 'created' => Schema::TYPE_DATETIME.' NOT NULL', |
|
15 | + 'user_id' => Schema::TYPE_INTEGER.' DEFAULT 0', |
|
16 | + 'duration' => Schema::TYPE_FLOAT.' NULL', |
|
17 | + 'ip' => Schema::TYPE_STRING.'(45) NULL', |
|
18 | + 'request_method' => Schema::TYPE_STRING.'(16) NULL', |
|
19 | + 'ajax' => Schema::TYPE_INTEGER.'(1) DEFAULT 0 NOT NULL', |
|
20 | + 'route' => Schema::TYPE_STRING.'(255) NULL', |
|
21 | + 'memory_max' => Schema::TYPE_INTEGER.' NULL', |
|
22 | 22 | ], ($this->db->driverName === 'mysql' ? 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB' : null)); |
23 | 23 | |
24 | 24 | $this->createIndex('idx_user_id', self::TABLE, ['user_id']); |