Completed
Push — master ( 771a9f...9588c8 )
by Alexander
27:00
created

Migration::endCommand()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\db;
9
10
use yii\base\Component;
11
use yii\di\Instance;
12
use yii\helpers\StringHelper;
13
14
/**
15
 * Migration is the base class for representing a database migration.
16
 *
17
 * Migration is designed to be used together with the "yii migrate" command.
18
 *
19
 * Each child class of Migration represents an individual database migration which
20
 * is identified by the child class name.
21
 *
22
 * Within each migration, the [[up()]] method should be overridden to contain the logic
23
 * for "upgrading" the database; while the [[down()]] method for the "downgrading"
24
 * logic. The "yii migrate" command manages all available migrations in an application.
25
 *
26
 * If the database supports transactions, you may also override [[safeUp()]] and
27
 * [[safeDown()]] so that if anything wrong happens during the upgrading or downgrading,
28
 * the whole migration can be reverted in a whole.
29
 *
30
 * Note that some DB queries in some DBMS cannot be put into a transaction. For some examples,
31
 * please refer to [implicit commit](http://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html). If this is the case,
32
 * you should still implement `up()` and `down()`, instead.
33
 *
34
 * Migration provides a set of convenient methods for manipulating database data and schema.
35
 * For example, the [[insert()]] method can be used to easily insert a row of data into
36
 * a database table; the [[createTable()]] method can be used to create a database table.
37
 * Compared with the same methods in [[Command]], these methods will display extra
38
 * information showing the method parameters and execution time, which may be useful when
39
 * applying migrations.
40
 *
41
 * For more details and usage information on Migration, see the [guide article on Migration](guide:db-migrations).
42
 *
43
 * @author Qiang Xue <[email protected]>
44
 * @since 2.0
45
 */
46
class Migration extends Component implements MigrationInterface
47
{
48
    use SchemaBuilderTrait;
49
50
    /**
51
     * @var Connection|array|string the DB connection object or the application component ID of the DB connection
52
     * that this migration should work with. Starting from version 2.0.2, this can also be a configuration array
53
     * for creating the object.
54
     *
55
     * Note that when a Migration object is created by the `migrate` command, this property will be overwritten
56
     * by the command. If you do not want to use the DB connection provided by the command, you may override
57
     * the [[init()]] method like the following:
58
     *
59
     * ```php
60
     * public function init()
61
     * {
62
     *     $this->db = 'db2';
63
     *     parent::init();
64
     * }
65
     * ```
66
     */
67
    public $db = 'db';
68
69
    /**
70
     * @var int max number of characters of the SQL outputted. Useful for reduction of long statements and making
71
     * console output more compact.
72
     * @since 2.0.13
73
     */
74
    public $maxSqlOutputLength;
75
76
    /**
77
     * @var bool indicates whether the console output should be compacted.
78
     * If this is set to true, the individual commands ran within the migration will not be output to the console.
79
     * Default is false, in other words the output is fully verbose by default.
80
     * @since 2.0.13
81
     */
82
    public $compact = false;
83
84
    /**
85
     * Initializes the migration.
86
     * This method will set [[db]] to be the 'db' application component, if it is `null`.
87
     */
88 21
    public function init()
89
    {
90 21
        parent::init();
91 21
        $this->db = Instance::ensure($this->db, Connection::className());
92 21
        $this->db->getSchema()->refresh();
93 21
        $this->db->enableSlaves = false;
94 21
    }
95
96
    /**
97
     * @inheritdoc
98
     * @since 2.0.6
99
     */
100 7
    protected function getDb()
101
    {
102 7
        return $this->db;
103
    }
104
105
    /**
106
     * This method contains the logic to be executed when applying this migration.
107
     * Child classes may override this method to provide actual migration logic.
108
     * @return bool return a false value to indicate the migration fails
109
     * and should not proceed further. All other return values mean the migration succeeds.
110
     */
111 1
    public function up()
112
    {
113 1
        $transaction = $this->db->beginTransaction();
114
        try {
115 1
            if ($this->safeUp() === false) {
116
                $transaction->rollBack();
117
                return false;
118
            }
119 1
            $transaction->commit();
120
        } catch (\Exception $e) {
121
            $this->printException($e);
122
            $transaction->rollBack();
123
            return false;
124
        } catch (\Throwable $e) {
0 ignored issues
show
Bug introduced by
The class Throwable does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
125
            $this->printException($e);
126
            $transaction->rollBack();
127
            return false;
128
        }
129
130 1
        return null;
131
    }
132
133
    /**
134
     * This method contains the logic to be executed when removing this migration.
135
     * The default implementation throws an exception indicating the migration cannot be removed.
136
     * Child classes may override this method if the corresponding migrations can be removed.
137
     * @return bool return a false value to indicate the migration fails
138
     * and should not proceed further. All other return values mean the migration succeeds.
139
     */
140
    public function down()
141
    {
142
        $transaction = $this->db->beginTransaction();
143
        try {
144
            if ($this->safeDown() === false) {
145
                $transaction->rollBack();
146
                return false;
147
            }
148
            $transaction->commit();
149
        } catch (\Exception $e) {
150
            $this->printException($e);
151
            $transaction->rollBack();
152
            return false;
153
        } catch (\Throwable $e) {
0 ignored issues
show
Bug introduced by
The class Throwable does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
154
            $this->printException($e);
155
            $transaction->rollBack();
156
            return false;
157
        }
158
159
        return null;
160
    }
161
162
    /**
163
     * @param \Throwable|\Exception $e
164
     */
165
    private function printException($e)
166
    {
167
        echo 'Exception: ' . $e->getMessage() . ' (' . $e->getFile() . ':' . $e->getLine() . ")\n";
168
        echo $e->getTraceAsString() . "\n";
169
    }
170
171
    /**
172
     * This method contains the logic to be executed when applying this migration.
173
     * This method differs from [[up()]] in that the DB logic implemented here will
174
     * be enclosed within a DB transaction.
175
     * Child classes may implement this method instead of [[up()]] if the DB logic
176
     * needs to be within a transaction.
177
     *
178
     * Note: Not all DBMS support transactions. And some DB queries cannot be put into a transaction. For some examples,
179
     * please refer to [implicit commit](http://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html). If this is the case,
180
     * you should still implement `up()` and `down()`, instead.
181
     *
182
     * @return bool return a false value to indicate the migration fails
183
     * and should not proceed further. All other return values mean the migration succeeds.
184
     */
185
    public function safeUp()
186
    {
187
    }
188
189
    /**
190
     * This method contains the logic to be executed when removing this migration.
191
     * This method differs from [[down()]] in that the DB logic implemented here will
192
     * be enclosed within a DB transaction.
193
     * Child classes may implement this method instead of [[down()]] if the DB logic
194
     * needs to be within a transaction.
195
     *
196
     * Note: Not all DBMS support transactions. And some DB queries cannot be put into a transaction. For some examples,
197
     * please refer to [implicit commit](http://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html). If this is the case,
198
     * you should still implement `up()` and `down()`, instead.
199
     *
200
     * @return bool return a false value to indicate the migration fails
201
     * and should not proceed further. All other return values mean the migration succeeds.
202
     */
203
    public function safeDown()
204
    {
205
    }
206
207
    /**
208
     * Executes a SQL statement.
209
     * This method executes the specified SQL statement using [[db]].
210
     * @param string $sql the SQL statement to be executed
211
     * @param array $params input parameters (name => value) for the SQL execution.
212
     * See [[Command::execute()]] for more details.
213
     */
214
    public function execute($sql, $params = [])
215
    {
216
        $sqlOutput = $sql;
217
        if ($this->maxSqlOutputLength !== null) {
218
            $sqlOutput = StringHelper::truncate($sql, $this->maxSqlOutputLength, '[... hidden]');
219
        }
220
221
        $time = $this->beginCommand("execute SQL: $sqlOutput");
222
        $this->db->createCommand($sql)->bindValues($params)->execute();
223
        $this->endCommand($time);
224
    }
225
226
    /**
227
     * Creates and executes an INSERT SQL statement.
228
     * The method will properly escape the column names, and bind the values to be inserted.
229
     * @param string $table the table that new rows will be inserted into.
230
     * @param array $columns the column data (name => value) to be inserted into the table.
231
     */
232
    public function insert($table, $columns)
233
    {
234
        $time = $this->beginCommand("insert into $table");
235
        $this->db->createCommand()->insert($table, $columns)->execute();
236
        $this->endCommand($time);
237
    }
238
239
    /**
240
     * Creates and executes an batch INSERT SQL statement.
241
     * The method will properly escape the column names, and bind the values to be inserted.
242
     * @param string $table the table that new rows will be inserted into.
243
     * @param array $columns the column names.
244
     * @param array $rows the rows to be batch inserted into the table
245
     */
246
    public function batchInsert($table, $columns, $rows)
247
    {
248
        $time = $this->beginCommand("insert into $table");
249
        $this->db->createCommand()->batchInsert($table, $columns, $rows)->execute();
250
        $this->endCommand($time);
251
    }
252
253
    /**
254
     * Creates and executes an UPDATE SQL statement.
255
     * The method will properly escape the column names and bind the values to be updated.
256
     * @param string $table the table to be updated.
257
     * @param array $columns the column data (name => value) to be updated.
258
     * @param array|string $condition the conditions that will be put in the WHERE part. Please
259
     * refer to [[Query::where()]] on how to specify conditions.
260
     * @param array $params the parameters to be bound to the query.
261
     */
262
    public function update($table, $columns, $condition = '', $params = [])
263
    {
264
        $time = $this->beginCommand("update $table");
265
        $this->db->createCommand()->update($table, $columns, $condition, $params)->execute();
266
        $this->endCommand($time);
267
    }
268
269
    /**
270
     * Creates and executes a DELETE SQL statement.
271
     * @param string $table the table where the data will be deleted from.
272
     * @param array|string $condition the conditions that will be put in the WHERE part. Please
273
     * refer to [[Query::where()]] on how to specify conditions.
274
     * @param array $params the parameters to be bound to the query.
275
     */
276
    public function delete($table, $condition = '', $params = [])
277
    {
278
        $time = $this->beginCommand("delete from $table");
279
        $this->db->createCommand()->delete($table, $condition, $params)->execute();
280
        $this->endCommand($time);
281
    }
282
283
    /**
284
     * Builds and executes a SQL statement for creating a new DB table.
285
     *
286
     * The columns in the new  table should be specified as name-definition pairs (e.g. 'name' => 'string'),
287
     * where name stands for a column name which will be properly quoted by the method, and definition
288
     * stands for the column type which can contain an abstract DB type.
289
     *
290
     * The [[QueryBuilder::getColumnType()]] method will be invoked to convert any abstract type into a physical one.
291
     *
292
     * If a column is specified with definition only (e.g. 'PRIMARY KEY (name, type)'), it will be directly
293
     * put into the generated SQL.
294
     *
295
     * @param string $table the name of the table to be created. The name will be properly quoted by the method.
296
     * @param array $columns the columns (name => definition) in the new table.
297
     * @param string $options additional SQL fragment that will be appended to the generated SQL.
298
     */
299 7
    public function createTable($table, $columns, $options = null)
300
    {
301 7
        $time = $this->beginCommand("create table $table");
302 7
        $this->db->createCommand()->createTable($table, $columns, $options)->execute();
303 7
        foreach ($columns as $column => $type) {
304 7
            if ($type instanceof ColumnSchemaBuilder && $type->comment !== null) {
305 7
                $this->db->createCommand()->addCommentOnColumn($table, $column, $type->comment)->execute();
306
            }
307
        }
308 7
        $this->endCommand($time);
309 7
    }
310
311
    /**
312
     * Builds and executes a SQL statement for renaming a DB table.
313
     * @param string $table the table to be renamed. The name will be properly quoted by the method.
314
     * @param string $newName the new table name. The name will be properly quoted by the method.
315
     */
316
    public function renameTable($table, $newName)
317
    {
318
        $time = $this->beginCommand("rename table $table to $newName");
319
        $this->db->createCommand()->renameTable($table, $newName)->execute();
320
        $this->endCommand($time);
321
    }
322
323
    /**
324
     * Builds and executes a SQL statement for dropping a DB table.
325
     * @param string $table the table to be dropped. The name will be properly quoted by the method.
326
     */
327 7
    public function dropTable($table)
328
    {
329 7
        $time = $this->beginCommand("drop table $table");
330 7
        $this->db->createCommand()->dropTable($table)->execute();
331 7
        $this->endCommand($time);
332 7
    }
333
334
    /**
335
     * Builds and executes a SQL statement for truncating a DB table.
336
     * @param string $table the table to be truncated. The name will be properly quoted by the method.
337
     */
338
    public function truncateTable($table)
339
    {
340
        $time = $this->beginCommand("truncate table $table");
341
        $this->db->createCommand()->truncateTable($table)->execute();
342
        $this->endCommand($time);
343
    }
344
345
    /**
346
     * Builds and executes a SQL statement for adding a new DB column.
347
     * @param string $table the table that the new column will be added to. The table name will be properly quoted by the method.
348
     * @param string $column the name of the new column. The name will be properly quoted by the method.
349
     * @param string $type the column type. The [[QueryBuilder::getColumnType()]] method will be invoked to convert abstract column type (if any)
350
     * into the physical one. Anything that is not recognized as abstract type will be kept in the generated SQL.
351
     * For example, 'string' will be turned into 'varchar(255)', while 'string not null' will become 'varchar(255) not null'.
352
     */
353
    public function addColumn($table, $column, $type)
354
    {
355
        $time = $this->beginCommand("add column $column $type to table $table");
356
        $this->db->createCommand()->addColumn($table, $column, $type)->execute();
357
        if ($type instanceof ColumnSchemaBuilder && $type->comment !== null) {
358
            $this->db->createCommand()->addCommentOnColumn($table, $column, $type->comment)->execute();
359
        }
360
        $this->endCommand($time);
361
    }
362
363
    /**
364
     * Builds and executes a SQL statement for dropping a DB column.
365
     * @param string $table the table whose column is to be dropped. The name will be properly quoted by the method.
366
     * @param string $column the name of the column to be dropped. The name will be properly quoted by the method.
367
     */
368
    public function dropColumn($table, $column)
369
    {
370
        $time = $this->beginCommand("drop column $column from table $table");
371
        $this->db->createCommand()->dropColumn($table, $column)->execute();
372
        $this->endCommand($time);
373
    }
374
375
    /**
376
     * Builds and executes a SQL statement for renaming a column.
377
     * @param string $table the table whose column is to be renamed. The name will be properly quoted by the method.
378
     * @param string $name the old name of the column. The name will be properly quoted by the method.
379
     * @param string $newName the new name of the column. The name will be properly quoted by the method.
380
     */
381
    public function renameColumn($table, $name, $newName)
382
    {
383
        $time = $this->beginCommand("rename column $name in table $table to $newName");
384
        $this->db->createCommand()->renameColumn($table, $name, $newName)->execute();
385
        $this->endCommand($time);
386
    }
387
388
    /**
389
     * Builds and executes a SQL statement for changing the definition of a column.
390
     * @param string $table the table whose column is to be changed. The table name will be properly quoted by the method.
391
     * @param string $column the name of the column to be changed. The name will be properly quoted by the method.
392
     * @param string $type the new column type. The [[QueryBuilder::getColumnType()]] method will be invoked to convert abstract column type (if any)
393
     * into the physical one. Anything that is not recognized as abstract type will be kept in the generated SQL.
394
     * For example, 'string' will be turned into 'varchar(255)', while 'string not null' will become 'varchar(255) not null'.
395
     */
396
    public function alterColumn($table, $column, $type)
397
    {
398
        $time = $this->beginCommand("alter column $column in table $table to $type");
399
        $this->db->createCommand()->alterColumn($table, $column, $type)->execute();
400
        if ($type instanceof ColumnSchemaBuilder && $type->comment !== null) {
401
            $this->db->createCommand()->addCommentOnColumn($table, $column, $type->comment)->execute();
402
        }
403
        $this->endCommand($time);
404
    }
405
406
    /**
407
     * Builds and executes a SQL statement for creating a primary key.
408
     * The method will properly quote the table and column names.
409
     * @param string $name the name of the primary key constraint.
410
     * @param string $table the table that the primary key constraint will be added to.
411
     * @param string|array $columns comma separated string or array of columns that the primary key will consist of.
412
     */
413
    public function addPrimaryKey($name, $table, $columns)
414
    {
415
        $time = $this->beginCommand("add primary key $name on $table (" . (is_array($columns) ? implode(',', $columns) : $columns) . ')');
416
        $this->db->createCommand()->addPrimaryKey($name, $table, $columns)->execute();
417
        $this->endCommand($time);
418
    }
419
420
    /**
421
     * Builds and executes a SQL statement for dropping a primary key.
422
     * @param string $name the name of the primary key constraint to be removed.
423
     * @param string $table the table that the primary key constraint will be removed from.
424
     */
425
    public function dropPrimaryKey($name, $table)
426
    {
427
        $time = $this->beginCommand("drop primary key $name");
428
        $this->db->createCommand()->dropPrimaryKey($name, $table)->execute();
429
        $this->endCommand($time);
430
    }
431
432
    /**
433
     * Builds a SQL statement for adding a foreign key constraint to an existing table.
434
     * The method will properly quote the table and column names.
435
     * @param string $name the name of the foreign key constraint.
436
     * @param string $table the table that the foreign key constraint will be added to.
437
     * @param string|array $columns the name of the column to that the constraint will be added on. If there are multiple columns, separate them with commas or use an array.
438
     * @param string $refTable the table that the foreign key references to.
439
     * @param string|array $refColumns the name of the column that the foreign key references to. If there are multiple columns, separate them with commas or use an array.
440
     * @param string $delete the ON DELETE option. Most DBMS support these options: RESTRICT, CASCADE, NO ACTION, SET DEFAULT, SET NULL
441
     * @param string $update the ON UPDATE option. Most DBMS support these options: RESTRICT, CASCADE, NO ACTION, SET DEFAULT, SET NULL
442
     */
443
    public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
444
    {
445
        $time = $this->beginCommand("add foreign key $name: $table (" . implode(',', (array) $columns) . ") references $refTable (" . implode(',', (array) $refColumns) . ')');
446
        $this->db->createCommand()->addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete, $update)->execute();
447
        $this->endCommand($time);
448
    }
449
450
    /**
451
     * Builds a SQL statement for dropping a foreign key constraint.
452
     * @param string $name the name of the foreign key constraint to be dropped. The name will be properly quoted by the method.
453
     * @param string $table the table whose foreign is to be dropped. The name will be properly quoted by the method.
454
     */
455
    public function dropForeignKey($name, $table)
456
    {
457
        $time = $this->beginCommand("drop foreign key $name from table $table");
458
        $this->db->createCommand()->dropForeignKey($name, $table)->execute();
459
        $this->endCommand($time);
460
    }
461
462
    /**
463
     * Builds and executes a SQL statement for creating a new index.
464
     * @param string $name the name of the index. The name will be properly quoted by the method.
465
     * @param string $table the table that the new index will be created for. The table name will be properly quoted by the method.
466
     * @param string|array $columns the column(s) that should be included in the index. If there are multiple columns, please separate them
467
     * by commas or use an array. Each column name will be properly quoted by the method. Quoting will be skipped for column names that
468
     * include a left parenthesis "(".
469
     * @param bool $unique whether to add UNIQUE constraint on the created index.
470
     */
471 6
    public function createIndex($name, $table, $columns, $unique = false)
472
    {
473 6
        $time = $this->beginCommand('create' . ($unique ? ' unique' : '') . " index $name on $table (" . implode(',', (array) $columns) . ')');
474 6
        $this->db->createCommand()->createIndex($name, $table, $columns, $unique)->execute();
475 6
        $this->endCommand($time);
476 6
    }
477
478
    /**
479
     * Builds and executes a SQL statement for dropping an index.
480
     * @param string $name the name of the index to be dropped. The name will be properly quoted by the method.
481
     * @param string $table the table whose index is to be dropped. The name will be properly quoted by the method.
482
     */
483
    public function dropIndex($name, $table)
484
    {
485
        $time = $this->beginCommand("drop index $name on $table");
486
        $this->db->createCommand()->dropIndex($name, $table)->execute();
487
        $this->endCommand($time);
488
    }
489
490
    /**
491
     * Builds and execute a SQL statement for adding comment to column.
492
     *
493
     * @param string $table the table whose column is to be commented. The table name will be properly quoted by the method.
494
     * @param string $column the name of the column to be commented. The column name will be properly quoted by the method.
495
     * @param string $comment the text of the comment to be added. The comment will be properly quoted by the method.
496
     * @since 2.0.8
497
     */
498
    public function addCommentOnColumn($table, $column, $comment)
499
    {
500
        $time = $this->beginCommand("add comment on column $column");
501
        $this->db->createCommand()->addCommentOnColumn($table, $column, $comment)->execute();
502
        $this->endCommand($time);
503
    }
504
505
    /**
506
     * Builds a SQL statement for adding comment to table.
507
     *
508
     * @param string $table the table whose column is to be commented. The table name will be properly quoted by the method.
509
     * @param string $comment the text of the comment to be added. The comment will be properly quoted by the method.
510
     * @since 2.0.8
511
     */
512
    public function addCommentOnTable($table, $comment)
513
    {
514
        $time = $this->beginCommand("add comment on table $table");
515
        $this->db->createCommand()->addCommentOnTable($table, $comment)->execute();
516
        $this->endCommand($time);
517
    }
518
519
    /**
520
     * Builds and execute a SQL statement for dropping comment from column.
521
     *
522
     * @param string $table the table whose column is to be commented. The table name will be properly quoted by the method.
523
     * @param string $column the name of the column to be commented. The column name will be properly quoted by the method.
524
     * @since 2.0.8
525
     */
526
    public function dropCommentFromColumn($table, $column)
527
    {
528
        $time = $this->beginCommand("drop comment from column $column");
529
        $this->db->createCommand()->dropCommentFromColumn($table, $column)->execute();
530
        $this->endCommand($time);
531
    }
532
533
    /**
534
     * Builds a SQL statement for dropping comment from table.
535
     *
536
     * @param string $table the table whose column is to be commented. The table name will be properly quoted by the method.
537
     * @since 2.0.8
538
     */
539
    public function dropCommentFromTable($table)
540
    {
541
        $time = $this->beginCommand("drop comment from table $table");
542
        $this->db->createCommand()->dropCommentFromTable($table)->execute();
543
        $this->endCommand($time);
544
    }
545
546
    /**
547
     * Prepares for a command to be executed, and outputs to the console
548
     * 
549
     * @param string $description the description for the command, to be output to the console.
550
     * @return float the time before the command is executed, for the time elapsed to be calculated.
551
     * @since 2.0.13
552
     */
553 7
    protected function beginCommand($description)
554
    {
555 7
        if (!$this->compact) {
556 7
            echo "    > $description ...";
557
        }
558 7
        return microtime(true);
559
    }
560
561
    /**
562
     * Finalizes after the command has been executed, and outputs to the console the time elapsed
563
     * 
564
     * @param float the time before the command was executed.
565
     * @since 2.0.13
566
     */
567 7
    protected function endCommand($time)
568
    {
569 7
        if (!$this->compact) {
570 7
            echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
571
        }
572 7
    }
573
}
574