@@ -10,111 +10,111 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_user_tables extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - // Users |
|
16 | - $fields = [ |
|
17 | - 'id' => [ |
|
18 | - 'type' => 'int', |
|
19 | - 'constraint' => 11, |
|
20 | - 'unsigned' => true, |
|
21 | - 'auto_increment' => true |
|
22 | - ], |
|
23 | - 'email' => [ |
|
24 | - 'type' => 'varchar', |
|
25 | - 'constraint' => 255 |
|
26 | - ], |
|
27 | - 'username' => [ |
|
28 | - 'type' => 'varchar', |
|
29 | - 'constraint' => 30, |
|
30 | - 'null' => true |
|
31 | - ], |
|
32 | - 'password_hash' => [ |
|
33 | - 'type' => 'varchar', |
|
34 | - 'constraint' => 255 |
|
35 | - ], |
|
36 | - 'reset_hash' => [ |
|
37 | - 'type' => 'varchar', |
|
38 | - 'constraint' => 40, |
|
39 | - 'null' => true |
|
40 | - ], |
|
41 | - 'activate_hash' => [ |
|
42 | - 'type' => 'varchar', |
|
43 | - 'constraint' => 40, |
|
44 | - 'null' => true |
|
45 | - ], |
|
46 | - 'created_on' => [ |
|
47 | - 'type' => 'datetime', |
|
48 | - 'default' => '0000-00-00 00:00:00' |
|
49 | - ], |
|
50 | - 'status' => [ |
|
51 | - 'type' => 'varchar', |
|
52 | - 'constraint' => 255, |
|
53 | - 'null' => true |
|
54 | - ], |
|
55 | - 'status_message' => [ |
|
56 | - 'type' => 'varchar', |
|
57 | - 'constraint' => 255, |
|
58 | - 'null' => true |
|
59 | - ], |
|
60 | - 'active' => [ |
|
61 | - 'type' => 'tinyint', |
|
62 | - 'constraint' => 1, |
|
63 | - 'null' => 0, |
|
64 | - 'default' => 0 |
|
65 | - ], |
|
66 | - 'deleted' => [ |
|
67 | - 'type' => 'tinyint', |
|
68 | - 'constraint' => 1, |
|
69 | - 'null' => 0, |
|
70 | - 'default' => 0 |
|
71 | - ], |
|
72 | - 'force_pass_reset' => [ |
|
73 | - 'type' => 'tinyint', |
|
74 | - 'constraint' => 1, |
|
75 | - 'null' => 0, |
|
76 | - 'default' => 0 |
|
77 | - ], |
|
78 | - ]; |
|
13 | + public function up () |
|
14 | + { |
|
15 | + // Users |
|
16 | + $fields = [ |
|
17 | + 'id' => [ |
|
18 | + 'type' => 'int', |
|
19 | + 'constraint' => 11, |
|
20 | + 'unsigned' => true, |
|
21 | + 'auto_increment' => true |
|
22 | + ], |
|
23 | + 'email' => [ |
|
24 | + 'type' => 'varchar', |
|
25 | + 'constraint' => 255 |
|
26 | + ], |
|
27 | + 'username' => [ |
|
28 | + 'type' => 'varchar', |
|
29 | + 'constraint' => 30, |
|
30 | + 'null' => true |
|
31 | + ], |
|
32 | + 'password_hash' => [ |
|
33 | + 'type' => 'varchar', |
|
34 | + 'constraint' => 255 |
|
35 | + ], |
|
36 | + 'reset_hash' => [ |
|
37 | + 'type' => 'varchar', |
|
38 | + 'constraint' => 40, |
|
39 | + 'null' => true |
|
40 | + ], |
|
41 | + 'activate_hash' => [ |
|
42 | + 'type' => 'varchar', |
|
43 | + 'constraint' => 40, |
|
44 | + 'null' => true |
|
45 | + ], |
|
46 | + 'created_on' => [ |
|
47 | + 'type' => 'datetime', |
|
48 | + 'default' => '0000-00-00 00:00:00' |
|
49 | + ], |
|
50 | + 'status' => [ |
|
51 | + 'type' => 'varchar', |
|
52 | + 'constraint' => 255, |
|
53 | + 'null' => true |
|
54 | + ], |
|
55 | + 'status_message' => [ |
|
56 | + 'type' => 'varchar', |
|
57 | + 'constraint' => 255, |
|
58 | + 'null' => true |
|
59 | + ], |
|
60 | + 'active' => [ |
|
61 | + 'type' => 'tinyint', |
|
62 | + 'constraint' => 1, |
|
63 | + 'null' => 0, |
|
64 | + 'default' => 0 |
|
65 | + ], |
|
66 | + 'deleted' => [ |
|
67 | + 'type' => 'tinyint', |
|
68 | + 'constraint' => 1, |
|
69 | + 'null' => 0, |
|
70 | + 'default' => 0 |
|
71 | + ], |
|
72 | + 'force_pass_reset' => [ |
|
73 | + 'type' => 'tinyint', |
|
74 | + 'constraint' => 1, |
|
75 | + 'null' => 0, |
|
76 | + 'default' => 0 |
|
77 | + ], |
|
78 | + ]; |
|
79 | 79 | |
80 | - $this->dbforge->add_field($fields); |
|
81 | - $this->dbforge->add_key('id', true); |
|
82 | - $this->dbforge->add_key('email'); |
|
80 | + $this->dbforge->add_field($fields); |
|
81 | + $this->dbforge->add_key('id', true); |
|
82 | + $this->dbforge->add_key('email'); |
|
83 | 83 | |
84 | - $this->dbforge->create_table('users', true, config_item('migration_create_table_attr')); |
|
84 | + $this->dbforge->create_table('users', true, config_item('migration_create_table_attr')); |
|
85 | 85 | |
86 | - // User Meta |
|
87 | - $fields = [ |
|
88 | - 'user_id' => [ |
|
89 | - 'type' => 'int', |
|
90 | - 'constraint' => 11, |
|
91 | - 'unsigned' => true |
|
92 | - ], |
|
93 | - 'meta_key' => [ |
|
94 | - 'type' => 'varchar', |
|
95 | - 'constraint' => 255 |
|
96 | - ], |
|
97 | - 'meta_value' => [ |
|
98 | - 'type' => 'text', |
|
99 | - 'null' => true |
|
100 | - ], |
|
101 | - ]; |
|
86 | + // User Meta |
|
87 | + $fields = [ |
|
88 | + 'user_id' => [ |
|
89 | + 'type' => 'int', |
|
90 | + 'constraint' => 11, |
|
91 | + 'unsigned' => true |
|
92 | + ], |
|
93 | + 'meta_key' => [ |
|
94 | + 'type' => 'varchar', |
|
95 | + 'constraint' => 255 |
|
96 | + ], |
|
97 | + 'meta_value' => [ |
|
98 | + 'type' => 'text', |
|
99 | + 'null' => true |
|
100 | + ], |
|
101 | + ]; |
|
102 | 102 | |
103 | - $this->dbforge->add_field($fields); |
|
104 | - $this->dbforge->add_key(['user_id', 'meta_key'], true); |
|
103 | + $this->dbforge->add_field($fields); |
|
104 | + $this->dbforge->add_key(['user_id', 'meta_key'], true); |
|
105 | 105 | |
106 | - $this->dbforge->create_table('user_meta', true, config_item('migration_create_table_attr')); |
|
106 | + $this->dbforge->create_table('user_meta', true, config_item('migration_create_table_attr')); |
|
107 | 107 | |
108 | - } |
|
108 | + } |
|
109 | 109 | |
110 | - //-------------------------------------------------------------------- |
|
110 | + //-------------------------------------------------------------------- |
|
111 | 111 | |
112 | - public function down () |
|
113 | - { |
|
114 | - $this->dbforge->drop_table('users'); |
|
115 | - $this->dbforge->drop_table('user_meta'); |
|
116 | - } |
|
112 | + public function down () |
|
113 | + { |
|
114 | + $this->dbforge->drop_table('users'); |
|
115 | + $this->dbforge->drop_table('user_meta'); |
|
116 | + } |
|
117 | 117 | |
118 | - //-------------------------------------------------------------------- |
|
118 | + //-------------------------------------------------------------------- |
|
119 | 119 | |
120 | 120 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Migration_Createsessiontable extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
13 | + public function up() |
|
14 | 14 | { |
15 | 15 | $fields = array( |
16 | 16 | 'id' => array( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | //-------------------------------------------------------------------- |
49 | 49 | |
50 | - public function down () |
|
50 | + public function down() |
|
51 | 51 | { |
52 | 52 | $this->dbforge->drop_table('ci_sessions'); |
53 | 53 | } |
@@ -10,35 +10,35 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_settings_table extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - $fields = [ |
|
16 | - 'name' => [ |
|
17 | - 'type' => 'varchar', |
|
18 | - 'constraint' => 255 |
|
19 | - ], |
|
20 | - 'value' => [ |
|
21 | - 'type' => 'varchar', |
|
22 | - 'constraint' => 255, |
|
23 | - 'null' => true |
|
24 | - ], |
|
25 | - 'group' => [ |
|
26 | - 'type' => 'varchar', |
|
27 | - 'constraint' => 255 |
|
28 | - ] |
|
29 | - ]; |
|
30 | - $this->dbforge->add_field($fields); |
|
31 | - $this->dbforge->add_key(['name', 'group'], true); |
|
32 | - $this->dbforge->create_table('settings', true, config_item('migration_create_table_attr')); |
|
33 | - } |
|
13 | + public function up () |
|
14 | + { |
|
15 | + $fields = [ |
|
16 | + 'name' => [ |
|
17 | + 'type' => 'varchar', |
|
18 | + 'constraint' => 255 |
|
19 | + ], |
|
20 | + 'value' => [ |
|
21 | + 'type' => 'varchar', |
|
22 | + 'constraint' => 255, |
|
23 | + 'null' => true |
|
24 | + ], |
|
25 | + 'group' => [ |
|
26 | + 'type' => 'varchar', |
|
27 | + 'constraint' => 255 |
|
28 | + ] |
|
29 | + ]; |
|
30 | + $this->dbforge->add_field($fields); |
|
31 | + $this->dbforge->add_key(['name', 'group'], true); |
|
32 | + $this->dbforge->create_table('settings', true, config_item('migration_create_table_attr')); |
|
33 | + } |
|
34 | 34 | |
35 | - //-------------------------------------------------------------------- |
|
35 | + //-------------------------------------------------------------------- |
|
36 | 36 | |
37 | - public function down () |
|
38 | - { |
|
39 | - $this->dbforge->drop_table('settings'); |
|
40 | - } |
|
37 | + public function down () |
|
38 | + { |
|
39 | + $this->dbforge->drop_table('settings'); |
|
40 | + } |
|
41 | 41 | |
42 | - //-------------------------------------------------------------------- |
|
42 | + //-------------------------------------------------------------------- |
|
43 | 43 | |
44 | 44 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Migration_Createsessiontable extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
13 | + public function up() |
|
14 | 14 | { |
15 | 15 | $fields = array( |
16 | 16 | 'id' => array( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | //-------------------------------------------------------------------- |
49 | 49 | |
50 | - public function down () |
|
50 | + public function down() |
|
51 | 51 | { |
52 | 52 | $this->dbforge->drop_table('ci_sessions'); |
53 | 53 | } |
@@ -10,52 +10,52 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_mail_queue extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - $fields = [ |
|
16 | - 'id' => [ |
|
17 | - 'type' => 'int', |
|
18 | - 'constraint' => 11, |
|
19 | - 'unsigned' => true, |
|
20 | - 'auto_increment' => true |
|
21 | - ], |
|
22 | - 'mailer' => [ |
|
23 | - 'type' => 'varchar', |
|
24 | - 'constraint' => 255 |
|
25 | - ], |
|
26 | - 'params' => [ |
|
27 | - 'type' => 'text', |
|
28 | - 'null' => true |
|
29 | - ], |
|
30 | - 'options' => [ |
|
31 | - 'type' => 'text', |
|
32 | - 'null' => true |
|
33 | - ], |
|
34 | - 'sent' => [ |
|
35 | - 'type' => 'tinyint', |
|
36 | - 'constraint' => 1, |
|
37 | - 'default' => 0 |
|
38 | - ], |
|
39 | - 'sent_on' => [ |
|
40 | - 'type' => 'datetime', |
|
41 | - 'null' => true, |
|
42 | - 'default' => null |
|
43 | - ], |
|
44 | - ]; |
|
13 | + public function up () |
|
14 | + { |
|
15 | + $fields = [ |
|
16 | + 'id' => [ |
|
17 | + 'type' => 'int', |
|
18 | + 'constraint' => 11, |
|
19 | + 'unsigned' => true, |
|
20 | + 'auto_increment' => true |
|
21 | + ], |
|
22 | + 'mailer' => [ |
|
23 | + 'type' => 'varchar', |
|
24 | + 'constraint' => 255 |
|
25 | + ], |
|
26 | + 'params' => [ |
|
27 | + 'type' => 'text', |
|
28 | + 'null' => true |
|
29 | + ], |
|
30 | + 'options' => [ |
|
31 | + 'type' => 'text', |
|
32 | + 'null' => true |
|
33 | + ], |
|
34 | + 'sent' => [ |
|
35 | + 'type' => 'tinyint', |
|
36 | + 'constraint' => 1, |
|
37 | + 'default' => 0 |
|
38 | + ], |
|
39 | + 'sent_on' => [ |
|
40 | + 'type' => 'datetime', |
|
41 | + 'null' => true, |
|
42 | + 'default' => null |
|
43 | + ], |
|
44 | + ]; |
|
45 | 45 | |
46 | - $this->dbforge->add_field($fields); |
|
47 | - $this->dbforge->add_key('id', true); |
|
48 | - $this->dbforge->add_key('sent'); |
|
49 | - $this->dbforge->create_table('mail_queue', true, config_item('migration_create_table_attr')); |
|
50 | - } |
|
46 | + $this->dbforge->add_field($fields); |
|
47 | + $this->dbforge->add_key('id', true); |
|
48 | + $this->dbforge->add_key('sent'); |
|
49 | + $this->dbforge->create_table('mail_queue', true, config_item('migration_create_table_attr')); |
|
50 | + } |
|
51 | 51 | |
52 | - //-------------------------------------------------------------------- |
|
52 | + //-------------------------------------------------------------------- |
|
53 | 53 | |
54 | - public function down () |
|
55 | - { |
|
56 | - $this->dbforge->drop_table('mail_queue'); |
|
57 | - } |
|
54 | + public function down () |
|
55 | + { |
|
56 | + $this->dbforge->drop_table('mail_queue'); |
|
57 | + } |
|
58 | 58 | |
59 | - //-------------------------------------------------------------------- |
|
59 | + //-------------------------------------------------------------------- |
|
60 | 60 | |
61 | 61 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Migration_Createsessiontable extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
13 | + public function up() |
|
14 | 14 | { |
15 | 15 | $fields = array( |
16 | 16 | 'id' => array( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | //-------------------------------------------------------------------- |
49 | 49 | |
50 | - public function down () |
|
50 | + public function down() |
|
51 | 51 | { |
52 | 52 | $this->dbforge->drop_table('ci_sessions'); |
53 | 53 | } |
@@ -10,110 +10,110 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_authorization_tables extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
13 | + public function up () |
|
14 | + { |
|
15 | 15 | /** |
16 | 16 | * Groups Table |
17 | 17 | */ |
18 | - $fields = [ |
|
19 | - 'id' => [ |
|
20 | - 'type' => 'int', |
|
21 | - 'constraint' => 11, |
|
22 | - 'unsigned' => true, |
|
23 | - 'auto_increment' => true |
|
24 | - ], |
|
25 | - 'name' => [ |
|
26 | - 'type' => 'varchar', |
|
27 | - 'constraint' => 255 |
|
28 | - ], |
|
29 | - 'description' => [ |
|
30 | - 'type' => 'varchar', |
|
31 | - 'constraint' => 255 |
|
32 | - ] |
|
33 | - ]; |
|
18 | + $fields = [ |
|
19 | + 'id' => [ |
|
20 | + 'type' => 'int', |
|
21 | + 'constraint' => 11, |
|
22 | + 'unsigned' => true, |
|
23 | + 'auto_increment' => true |
|
24 | + ], |
|
25 | + 'name' => [ |
|
26 | + 'type' => 'varchar', |
|
27 | + 'constraint' => 255 |
|
28 | + ], |
|
29 | + 'description' => [ |
|
30 | + 'type' => 'varchar', |
|
31 | + 'constraint' => 255 |
|
32 | + ] |
|
33 | + ]; |
|
34 | 34 | |
35 | - $this->dbforge->add_field($fields); |
|
36 | - $this->dbforge->add_key('id', true); |
|
37 | - $this->dbforge->create_table('auth_groups', true, config_item('migration_create_table_attr')); |
|
38 | - /** |
|
39 | - * Permissions Table |
|
40 | - */ |
|
41 | - $fields = [ |
|
42 | - 'id' => [ |
|
43 | - 'type' => 'int', |
|
44 | - 'constraint' => 11, |
|
45 | - 'unsigned' => true, |
|
46 | - 'auto_increment' => true |
|
47 | - ], |
|
48 | - 'name' => [ |
|
49 | - 'type' => 'varchar', |
|
50 | - 'constraint' => 255 |
|
51 | - ], |
|
52 | - 'description' => [ |
|
53 | - 'type' => 'varchar', |
|
54 | - 'constraint' => 255 |
|
55 | - ] |
|
56 | - ]; |
|
35 | + $this->dbforge->add_field($fields); |
|
36 | + $this->dbforge->add_key('id', true); |
|
37 | + $this->dbforge->create_table('auth_groups', true, config_item('migration_create_table_attr')); |
|
38 | + /** |
|
39 | + * Permissions Table |
|
40 | + */ |
|
41 | + $fields = [ |
|
42 | + 'id' => [ |
|
43 | + 'type' => 'int', |
|
44 | + 'constraint' => 11, |
|
45 | + 'unsigned' => true, |
|
46 | + 'auto_increment' => true |
|
47 | + ], |
|
48 | + 'name' => [ |
|
49 | + 'type' => 'varchar', |
|
50 | + 'constraint' => 255 |
|
51 | + ], |
|
52 | + 'description' => [ |
|
53 | + 'type' => 'varchar', |
|
54 | + 'constraint' => 255 |
|
55 | + ] |
|
56 | + ]; |
|
57 | 57 | |
58 | - $this->dbforge->add_field($fields); |
|
59 | - $this->dbforge->add_key('id', true); |
|
60 | - $this->dbforge->create_table('auth_permissions', true, config_item('migration_create_table_attr')); |
|
58 | + $this->dbforge->add_field($fields); |
|
59 | + $this->dbforge->add_key('id', true); |
|
60 | + $this->dbforge->create_table('auth_permissions', true, config_item('migration_create_table_attr')); |
|
61 | 61 | |
62 | - /** |
|
63 | - * Groups/Permissions Table |
|
64 | - */ |
|
65 | - $fields = [ |
|
66 | - 'group_id' => [ |
|
67 | - 'type' => 'int', |
|
68 | - 'constraint' => 11, |
|
69 | - 'unsigned' => true, |
|
70 | - 'default' => 0 |
|
71 | - ], |
|
72 | - 'permission_id' => [ |
|
73 | - 'type' => 'int', |
|
74 | - 'constraint' => 11, |
|
75 | - 'unsigned' => true, |
|
76 | - 'default' => 0 |
|
77 | - ], |
|
78 | - ]; |
|
62 | + /** |
|
63 | + * Groups/Permissions Table |
|
64 | + */ |
|
65 | + $fields = [ |
|
66 | + 'group_id' => [ |
|
67 | + 'type' => 'int', |
|
68 | + 'constraint' => 11, |
|
69 | + 'unsigned' => true, |
|
70 | + 'default' => 0 |
|
71 | + ], |
|
72 | + 'permission_id' => [ |
|
73 | + 'type' => 'int', |
|
74 | + 'constraint' => 11, |
|
75 | + 'unsigned' => true, |
|
76 | + 'default' => 0 |
|
77 | + ], |
|
78 | + ]; |
|
79 | 79 | |
80 | - $this->dbforge->add_field($fields); |
|
81 | - $this->dbforge->add_key(['group_id', 'permission_id']); |
|
82 | - $this->dbforge->create_table('auth_groups_permissions', true, config_item('migration_create_table_attr')); |
|
80 | + $this->dbforge->add_field($fields); |
|
81 | + $this->dbforge->add_key(['group_id', 'permission_id']); |
|
82 | + $this->dbforge->create_table('auth_groups_permissions', true, config_item('migration_create_table_attr')); |
|
83 | 83 | |
84 | - /** |
|
85 | - * Users/Groups Table |
|
86 | - */ |
|
87 | - $fields = [ |
|
88 | - 'group_id' => [ |
|
89 | - 'type' => 'int', |
|
90 | - 'constraint' => 11, |
|
91 | - 'unsigned' => true, |
|
92 | - 'default' => 0 |
|
93 | - ], |
|
94 | - 'user_id' => [ |
|
95 | - 'type' => 'int', |
|
96 | - 'constraint' => 11, |
|
97 | - 'unsigned' => true, |
|
98 | - 'default' => 0 |
|
99 | - ], |
|
100 | - ]; |
|
84 | + /** |
|
85 | + * Users/Groups Table |
|
86 | + */ |
|
87 | + $fields = [ |
|
88 | + 'group_id' => [ |
|
89 | + 'type' => 'int', |
|
90 | + 'constraint' => 11, |
|
91 | + 'unsigned' => true, |
|
92 | + 'default' => 0 |
|
93 | + ], |
|
94 | + 'user_id' => [ |
|
95 | + 'type' => 'int', |
|
96 | + 'constraint' => 11, |
|
97 | + 'unsigned' => true, |
|
98 | + 'default' => 0 |
|
99 | + ], |
|
100 | + ]; |
|
101 | 101 | |
102 | - $this->dbforge->add_field($fields); |
|
103 | - $this->dbforge->add_key(['group_id', 'user_id']); |
|
104 | - $this->dbforge->create_table('auth_groups_users', true, config_item('migration_create_table_attr')); |
|
105 | - } |
|
102 | + $this->dbforge->add_field($fields); |
|
103 | + $this->dbforge->add_key(['group_id', 'user_id']); |
|
104 | + $this->dbforge->create_table('auth_groups_users', true, config_item('migration_create_table_attr')); |
|
105 | + } |
|
106 | 106 | |
107 | - //-------------------------------------------------------------------- |
|
107 | + //-------------------------------------------------------------------- |
|
108 | 108 | |
109 | - public function down () |
|
110 | - { |
|
109 | + public function down () |
|
110 | + { |
|
111 | 111 | $this->dbforge->drop_table('auth_groups'); |
112 | 112 | $this->dbforge->drop_table('auth_permissions'); |
113 | 113 | $this->dbforge->drop_table('auth_groups_permissions'); |
114 | 114 | $this->dbforge->drop_table('auth_groups_users'); |
115 | - } |
|
115 | + } |
|
116 | 116 | |
117 | - //-------------------------------------------------------------------- |
|
117 | + //-------------------------------------------------------------------- |
|
118 | 118 | |
119 | 119 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Migration_Createsessiontable extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
13 | + public function up() |
|
14 | 14 | { |
15 | 15 | $fields = array( |
16 | 16 | 'id' => array( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | //-------------------------------------------------------------------- |
49 | 49 | |
50 | - public function down () |
|
50 | + public function down() |
|
51 | 51 | { |
52 | 52 | $this->dbforge->drop_table('ci_sessions'); |
53 | 53 | } |
@@ -10,48 +10,48 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_Createsessiontable extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - $fields = array( |
|
16 | - 'id' => array( |
|
17 | - 'type' => 'varchar', |
|
18 | - 'constraint' => 40, |
|
19 | - 'null' => false |
|
20 | - ), |
|
21 | - 'ip_address' => array( |
|
22 | - 'type' => 'varchar', |
|
23 | - 'constraint' => 45, |
|
24 | - 'null' => false |
|
25 | - ), |
|
26 | - 'timestamp' => array( |
|
27 | - 'type' => 'int', |
|
28 | - 'constraint' => 10, |
|
29 | - 'unsigned' => true, |
|
30 | - 'default' => '0', |
|
31 | - 'null' => false, |
|
32 | - ), |
|
33 | - 'data' => array( |
|
34 | - 'type' => 'blob', |
|
35 | - 'null' => false |
|
36 | - ) |
|
37 | - ); |
|
38 | - |
|
39 | - $this->dbforge->add_field($fields); |
|
40 | - |
|
41 | - $this->dbforge->add_key('id', TRUE); |
|
42 | - $this->dbforge->add_key('ip_address', TRUE); |
|
43 | - $this->dbforge->add_key('ci_sessions_timestamp'); |
|
44 | - |
|
45 | - $this->dbforge->create_table('ci_sessions', true, config_item('migration_create_table_attr')); |
|
46 | - } |
|
47 | - |
|
48 | - //-------------------------------------------------------------------- |
|
49 | - |
|
50 | - public function down () |
|
51 | - { |
|
52 | - $this->dbforge->drop_table('ci_sessions'); |
|
53 | - } |
|
54 | - |
|
55 | - //-------------------------------------------------------------------- |
|
13 | + public function up () |
|
14 | + { |
|
15 | + $fields = array( |
|
16 | + 'id' => array( |
|
17 | + 'type' => 'varchar', |
|
18 | + 'constraint' => 40, |
|
19 | + 'null' => false |
|
20 | + ), |
|
21 | + 'ip_address' => array( |
|
22 | + 'type' => 'varchar', |
|
23 | + 'constraint' => 45, |
|
24 | + 'null' => false |
|
25 | + ), |
|
26 | + 'timestamp' => array( |
|
27 | + 'type' => 'int', |
|
28 | + 'constraint' => 10, |
|
29 | + 'unsigned' => true, |
|
30 | + 'default' => '0', |
|
31 | + 'null' => false, |
|
32 | + ), |
|
33 | + 'data' => array( |
|
34 | + 'type' => 'blob', |
|
35 | + 'null' => false |
|
36 | + ) |
|
37 | + ); |
|
38 | + |
|
39 | + $this->dbforge->add_field($fields); |
|
40 | + |
|
41 | + $this->dbforge->add_key('id', TRUE); |
|
42 | + $this->dbforge->add_key('ip_address', TRUE); |
|
43 | + $this->dbforge->add_key('ci_sessions_timestamp'); |
|
44 | + |
|
45 | + $this->dbforge->create_table('ci_sessions', true, config_item('migration_create_table_attr')); |
|
46 | + } |
|
47 | + |
|
48 | + //-------------------------------------------------------------------- |
|
49 | + |
|
50 | + public function down () |
|
51 | + { |
|
52 | + $this->dbforge->drop_table('ci_sessions'); |
|
53 | + } |
|
54 | + |
|
55 | + //-------------------------------------------------------------------- |
|
56 | 56 | |
57 | 57 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Migration_Createsessiontable extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
13 | + public function up() |
|
14 | 14 | { |
15 | 15 | $fields = array( |
16 | 16 | 'id' => array( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | //-------------------------------------------------------------------- |
49 | 49 | |
50 | - public function down () |
|
50 | + public function down() |
|
51 | 51 | { |
52 | 52 | $this->dbforge->drop_table('ci_sessions'); |
53 | 53 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | public function run() |
12 | 12 | { |
13 | - $flat = new \Myth\Auth\FlatAuthorization(); |
|
13 | + $flat = new \Myth\Auth\FlatAuthorization(); |
|
14 | 14 | |
15 | 15 | $flat->createPermission('viewPosts', 'View the blog posts.'); |
16 | 16 | $flat->createPermission('managePosts', 'Manage the blog posts.'); |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | */ |
9 | 9 | class TestSeeder extends Seeder { |
10 | 10 | |
11 | - public function run() |
|
12 | - { |
|
13 | - /* |
|
11 | + public function run() |
|
12 | + { |
|
13 | + /* |
|
14 | 14 | Here, you can do anything you need to do to get your |
15 | 15 | database in the desired state. The following tools are ready for you: |
16 | 16 | |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | |
24 | 24 | $this->call('UserSeeder'); |
25 | 25 | */ |
26 | - } |
|
26 | + } |
|
27 | 27 | |
28 | - //-------------------------------------------------------------------- |
|
28 | + //-------------------------------------------------------------------- |
|
29 | 29 | |
30 | 30 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('Markdown')) { |
|
3 | +if ( ! function_exists('Markdown')) { |
|
4 | 4 | require_once('markdown_helper.php'); |
5 | 5 | } |
6 | 6 | define('MARKDOWNEXTRAEXTENDED_VERSION', "0.3"); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | function _doBlockQuotes_callback($matches) |
68 | 68 | { |
69 | 69 | $cite = $matches[1]; |
70 | - $bq = '> ' . $matches[2]; |
|
70 | + $bq = '> '.$matches[2]; |
|
71 | 71 | # trim one level of quoting - trim whitespace-only lines |
72 | 72 | $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); |
73 | 73 | $bq = $this->runBlockGamut($bq); # recurse |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $res = "<blockquote"; |
85 | 85 | $res .= empty($cite) ? ">" : " cite=\"$cite\">"; |
86 | 86 | $res .= "\n$bq\n</blockquote>"; |
87 | - return "\n" . $this->hashBlock($res) . "\n\n"; |
|
87 | + return "\n".$this->hashBlock($res)."\n\n"; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | function doFencedCodeBlocks($text) |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $cb = empty($matches[3]) ? "<pre><code" : "<pre class=\"linenums:$matches[3]\"><code"; |
134 | 134 | $cb .= empty($matches[2]) ? ">" : " class=\"language-$matches[2]\">"; |
135 | 135 | $cb .= "$codeblock</code></pre>"; |
136 | - return "\n\n" . $this->hashBlock($cb) . "\n\n"; |
|
136 | + return "\n\n".$this->hashBlock($cb)."\n\n"; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | function doFencedFigures($text) |
@@ -184,15 +184,15 @@ discard block |
||
184 | 184 | ); |
185 | 185 | |
186 | 186 | $res = "<figure>"; |
187 | - if (!empty($topcaption)) { |
|
187 | + if ( ! empty($topcaption)) { |
|
188 | 188 | $res .= "\n<figcaption>$topcaption</figcaption>"; |
189 | 189 | } |
190 | 190 | $res .= "\n$figure\n"; |
191 | - if (!empty($bottomcaption) && empty($topcaption)) { |
|
191 | + if ( ! empty($bottomcaption) && empty($topcaption)) { |
|
192 | 192 | $res .= "<figcaption>$bottomcaption</figcaption>"; |
193 | 193 | } |
194 | 194 | $res .= "</figure>"; |
195 | - return "\n" . $this->hashBlock($res) . "\n\n"; |
|
195 | + return "\n".$this->hashBlock($res)."\n\n"; |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 |
@@ -1,98 +1,98 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if (! function_exists('Markdown')) { |
4 | - require_once('markdown_helper.php'); |
|
4 | + require_once('markdown_helper.php'); |
|
5 | 5 | } |
6 | 6 | define('MARKDOWNEXTRAEXTENDED_VERSION', "0.3"); |
7 | 7 | |
8 | 8 | function MarkdownExtended($text, $default_classes = array()) |
9 | 9 | { |
10 | - $parser = new MarkdownExtraExtended_Parser($default_classes); |
|
11 | - return $parser->transform($text); |
|
10 | + $parser = new MarkdownExtraExtended_Parser($default_classes); |
|
11 | + return $parser->transform($text); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | class MarkdownExtraExtended_Parser extends MarkdownExtra_Parser |
15 | 15 | { |
16 | 16 | |
17 | - # Tags that are always treated as block tags: |
|
18 | - var $block_tags_re = 'figure|figcaption|p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend'; |
|
19 | - |
|
20 | - var $default_classes; |
|
21 | - |
|
22 | - function __construct($default_classes = array()) |
|
23 | - { |
|
24 | - $default_classes = $default_classes; |
|
25 | - |
|
26 | - $this->block_gamut += array( |
|
27 | - "doFencedFigures" => 7, |
|
28 | - ); |
|
29 | - |
|
30 | - parent::__construct(); |
|
31 | - } |
|
32 | - |
|
33 | - function transform($text) |
|
34 | - { |
|
35 | - $text = parent::transform($text); |
|
36 | - return $text; |
|
37 | - } |
|
38 | - |
|
39 | - function doHardBreaks($text) |
|
40 | - { |
|
41 | - # Do hard breaks: |
|
42 | - # EXTENDED: changed to allow breaks without two spaces and just one new line |
|
43 | - # original code /* return preg_replace_callback('/ {2,}\n/', */ |
|
44 | - return preg_replace_callback( |
|
45 | - '/ *\n/', |
|
46 | - array(&$this, '_doHardBreaks_callback'), |
|
47 | - $text |
|
48 | - ); |
|
49 | - } |
|
50 | - |
|
51 | - function doBlockQuotes($text) |
|
52 | - { |
|
53 | - $text = preg_replace_callback( |
|
54 | - '/ |
|
17 | + # Tags that are always treated as block tags: |
|
18 | + var $block_tags_re = 'figure|figcaption|p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend'; |
|
19 | + |
|
20 | + var $default_classes; |
|
21 | + |
|
22 | + function __construct($default_classes = array()) |
|
23 | + { |
|
24 | + $default_classes = $default_classes; |
|
25 | + |
|
26 | + $this->block_gamut += array( |
|
27 | + "doFencedFigures" => 7, |
|
28 | + ); |
|
29 | + |
|
30 | + parent::__construct(); |
|
31 | + } |
|
32 | + |
|
33 | + function transform($text) |
|
34 | + { |
|
35 | + $text = parent::transform($text); |
|
36 | + return $text; |
|
37 | + } |
|
38 | + |
|
39 | + function doHardBreaks($text) |
|
40 | + { |
|
41 | + # Do hard breaks: |
|
42 | + # EXTENDED: changed to allow breaks without two spaces and just one new line |
|
43 | + # original code /* return preg_replace_callback('/ {2,}\n/', */ |
|
44 | + return preg_replace_callback( |
|
45 | + '/ *\n/', |
|
46 | + array(&$this, '_doHardBreaks_callback'), |
|
47 | + $text |
|
48 | + ); |
|
49 | + } |
|
50 | + |
|
51 | + function doBlockQuotes($text) |
|
52 | + { |
|
53 | + $text = preg_replace_callback( |
|
54 | + '/ |
|
55 | 55 | (?>^[ ]*>[ ]? |
56 | 56 | (?:\((.+?)\))? |
57 | 57 | [ ]*(.+\n(?:.+\n)*) |
58 | 58 | )+ |
59 | 59 | /xm', |
60 | - array(&$this, '_doBlockQuotes_callback'), |
|
61 | - $text |
|
62 | - ); |
|
63 | - |
|
64 | - return $text; |
|
65 | - } |
|
66 | - |
|
67 | - function _doBlockQuotes_callback($matches) |
|
68 | - { |
|
69 | - $cite = $matches[1]; |
|
70 | - $bq = '> ' . $matches[2]; |
|
71 | - # trim one level of quoting - trim whitespace-only lines |
|
72 | - $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); |
|
73 | - $bq = $this->runBlockGamut($bq); # recurse |
|
74 | - |
|
75 | - $bq = preg_replace('/^/m', " ", $bq); |
|
76 | - # These leading spaces cause problem with <pre> content, |
|
77 | - # so we need to fix that: |
|
78 | - $bq = preg_replace_callback( |
|
79 | - '{(\s*<pre>.+?</pre>)}sx', |
|
80 | - array(&$this, '_doBlockQuotes_callback2'), |
|
81 | - $bq |
|
82 | - ); |
|
83 | - |
|
84 | - $res = "<blockquote"; |
|
85 | - $res .= empty($cite) ? ">" : " cite=\"$cite\">"; |
|
86 | - $res .= "\n$bq\n</blockquote>"; |
|
87 | - return "\n" . $this->hashBlock($res) . "\n\n"; |
|
88 | - } |
|
89 | - |
|
90 | - function doFencedCodeBlocks($text) |
|
91 | - { |
|
92 | - $less_than_tab = $this->tab_width; |
|
93 | - |
|
94 | - $text = preg_replace_callback( |
|
95 | - '{ |
|
60 | + array(&$this, '_doBlockQuotes_callback'), |
|
61 | + $text |
|
62 | + ); |
|
63 | + |
|
64 | + return $text; |
|
65 | + } |
|
66 | + |
|
67 | + function _doBlockQuotes_callback($matches) |
|
68 | + { |
|
69 | + $cite = $matches[1]; |
|
70 | + $bq = '> ' . $matches[2]; |
|
71 | + # trim one level of quoting - trim whitespace-only lines |
|
72 | + $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); |
|
73 | + $bq = $this->runBlockGamut($bq); # recurse |
|
74 | + |
|
75 | + $bq = preg_replace('/^/m', " ", $bq); |
|
76 | + # These leading spaces cause problem with <pre> content, |
|
77 | + # so we need to fix that: |
|
78 | + $bq = preg_replace_callback( |
|
79 | + '{(\s*<pre>.+?</pre>)}sx', |
|
80 | + array(&$this, '_doBlockQuotes_callback2'), |
|
81 | + $bq |
|
82 | + ); |
|
83 | + |
|
84 | + $res = "<blockquote"; |
|
85 | + $res .= empty($cite) ? ">" : " cite=\"$cite\">"; |
|
86 | + $res .= "\n$bq\n</blockquote>"; |
|
87 | + return "\n" . $this->hashBlock($res) . "\n\n"; |
|
88 | + } |
|
89 | + |
|
90 | + function doFencedCodeBlocks($text) |
|
91 | + { |
|
92 | + $less_than_tab = $this->tab_width; |
|
93 | + |
|
94 | + $text = preg_replace_callback( |
|
95 | + '{ |
|
96 | 96 | (?:\n|\A) |
97 | 97 | # 1: Opening marker |
98 | 98 | ( |
@@ -112,34 +112,34 @@ discard block |
||
112 | 112 | # Closing marker. |
113 | 113 | \1 [ ]* \n |
114 | 114 | }xm', |
115 | - array(&$this, '_doFencedCodeBlocks_callback'), |
|
116 | - $text |
|
117 | - ); |
|
118 | - |
|
119 | - return $text; |
|
120 | - } |
|
121 | - |
|
122 | - function _doFencedCodeBlocks_callback($matches) |
|
123 | - { |
|
124 | - $codeblock = $matches[4]; |
|
125 | - $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); |
|
126 | - $codeblock = preg_replace_callback( |
|
127 | - '/^\n+/', |
|
128 | - array(&$this, '_doFencedCodeBlocks_newlines'), |
|
129 | - $codeblock |
|
130 | - ); |
|
131 | - //$codeblock = "<pre><code>$codeblock</code></pre>"; |
|
132 | - //$cb = "<pre><code"; |
|
133 | - $cb = empty($matches[3]) ? "<pre><code" : "<pre class=\"linenums:$matches[3]\"><code"; |
|
134 | - $cb .= empty($matches[2]) ? ">" : " class=\"language-$matches[2]\">"; |
|
135 | - $cb .= "$codeblock</code></pre>"; |
|
136 | - return "\n\n" . $this->hashBlock($cb) . "\n\n"; |
|
137 | - } |
|
138 | - |
|
139 | - function doFencedFigures($text) |
|
140 | - { |
|
141 | - $text = preg_replace_callback( |
|
142 | - '{ |
|
115 | + array(&$this, '_doFencedCodeBlocks_callback'), |
|
116 | + $text |
|
117 | + ); |
|
118 | + |
|
119 | + return $text; |
|
120 | + } |
|
121 | + |
|
122 | + function _doFencedCodeBlocks_callback($matches) |
|
123 | + { |
|
124 | + $codeblock = $matches[4]; |
|
125 | + $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); |
|
126 | + $codeblock = preg_replace_callback( |
|
127 | + '/^\n+/', |
|
128 | + array(&$this, '_doFencedCodeBlocks_newlines'), |
|
129 | + $codeblock |
|
130 | + ); |
|
131 | + //$codeblock = "<pre><code>$codeblock</code></pre>"; |
|
132 | + //$cb = "<pre><code"; |
|
133 | + $cb = empty($matches[3]) ? "<pre><code" : "<pre class=\"linenums:$matches[3]\"><code"; |
|
134 | + $cb .= empty($matches[2]) ? ">" : " class=\"language-$matches[2]\">"; |
|
135 | + $cb .= "$codeblock</code></pre>"; |
|
136 | + return "\n\n" . $this->hashBlock($cb) . "\n\n"; |
|
137 | + } |
|
138 | + |
|
139 | + function doFencedFigures($text) |
|
140 | + { |
|
141 | + $text = preg_replace_callback( |
|
142 | + '{ |
|
143 | 143 | (?:\n|\A) |
144 | 144 | # 1: Opening marker |
145 | 145 | ( |
@@ -159,41 +159,41 @@ discard block |
||
159 | 159 | # Closing marker. |
160 | 160 | \1 [ ]?(?:\[([^\]]+)\])?[ ]* \n |
161 | 161 | }xm', |
162 | - array(&$this, '_doFencedFigures_callback'), |
|
163 | - $text |
|
164 | - ); |
|
165 | - |
|
166 | - return $text; |
|
167 | - } |
|
168 | - |
|
169 | - function _doFencedFigures_callback($matches) |
|
170 | - { |
|
171 | - # get figcaption |
|
172 | - $topcaption = empty($matches[2]) ? null : $this->runBlockGamut($matches[2]); |
|
173 | - $bottomcaption = empty($matches[5]) ? null : $this->runBlockGamut($matches[5]); |
|
174 | - $figure = $matches[3]; |
|
175 | - $figure = $this->runBlockGamut($figure); # recurse |
|
176 | - |
|
177 | - $figure = preg_replace('/^/m', " ", $figure); |
|
178 | - # These leading spaces cause problem with <pre> content, |
|
179 | - # so we need to fix that - reuse blockqoute code to handle this: |
|
180 | - $figure = preg_replace_callback( |
|
181 | - '{(\s*<pre>.+?</pre>)}sx', |
|
182 | - array(&$this, '_doBlockQuotes_callback2'), |
|
183 | - $figure |
|
184 | - ); |
|
185 | - |
|
186 | - $res = "<figure>"; |
|
187 | - if (!empty($topcaption)) { |
|
188 | - $res .= "\n<figcaption>$topcaption</figcaption>"; |
|
189 | - } |
|
190 | - $res .= "\n$figure\n"; |
|
191 | - if (!empty($bottomcaption) && empty($topcaption)) { |
|
192 | - $res .= "<figcaption>$bottomcaption</figcaption>"; |
|
193 | - } |
|
194 | - $res .= "</figure>"; |
|
195 | - return "\n" . $this->hashBlock($res) . "\n\n"; |
|
196 | - } |
|
162 | + array(&$this, '_doFencedFigures_callback'), |
|
163 | + $text |
|
164 | + ); |
|
165 | + |
|
166 | + return $text; |
|
167 | + } |
|
168 | + |
|
169 | + function _doFencedFigures_callback($matches) |
|
170 | + { |
|
171 | + # get figcaption |
|
172 | + $topcaption = empty($matches[2]) ? null : $this->runBlockGamut($matches[2]); |
|
173 | + $bottomcaption = empty($matches[5]) ? null : $this->runBlockGamut($matches[5]); |
|
174 | + $figure = $matches[3]; |
|
175 | + $figure = $this->runBlockGamut($figure); # recurse |
|
176 | + |
|
177 | + $figure = preg_replace('/^/m', " ", $figure); |
|
178 | + # These leading spaces cause problem with <pre> content, |
|
179 | + # so we need to fix that - reuse blockqoute code to handle this: |
|
180 | + $figure = preg_replace_callback( |
|
181 | + '{(\s*<pre>.+?</pre>)}sx', |
|
182 | + array(&$this, '_doBlockQuotes_callback2'), |
|
183 | + $figure |
|
184 | + ); |
|
185 | + |
|
186 | + $res = "<figure>"; |
|
187 | + if (!empty($topcaption)) { |
|
188 | + $res .= "\n<figcaption>$topcaption</figcaption>"; |
|
189 | + } |
|
190 | + $res .= "\n$figure\n"; |
|
191 | + if (!empty($bottomcaption) && empty($topcaption)) { |
|
192 | + $res .= "<figcaption>$bottomcaption</figcaption>"; |
|
193 | + } |
|
194 | + $res .= "</figure>"; |
|
195 | + return "\n" . $this->hashBlock($res) . "\n\n"; |
|
196 | + } |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | ?> |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $lang['cron.invalid_task'] = 'Not a valid task.'; |
36 | 36 | $lang['cron.running_task'] = "Running task: %s..."; |
37 | 37 | $lang['cron.done_with_msg'] = "Done with message:\n%s\n"; |
38 | -$lang['cron.not_scheduled_until'] = "'%s' Not scheduled to run until %s."; |
|
38 | +$lang['cron.not_scheduled_until'] = "'%s' Not scheduled to run until %s."; |
|
39 | 39 | $lang['cron.nothing_scheduled'] = "No Tasks scheduled to run currently."; |
40 | 40 | |
41 | 41 | // Forge |