@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | -require_once (dirname(dirname(__FILE__)) . '/blendmigrations.class.php'); |
|
2 | +require_once (dirname(dirname(__FILE__)).'/blendmigrations.class.php'); |
|
3 | 3 | class BlendMigrations_mysql extends BlendMigrations {} |
4 | 4 | \ No newline at end of file |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $xpdo_meta_map['BlendMigrations']= array ( |
3 | - 'package' => 'blend', |
|
4 | - 'version' => '1.1', |
|
5 | - 'table' => 'blend_migrations', |
|
6 | - 'extends' => 'xPDOSimpleObject', |
|
7 | - 'fields' => |
|
8 | - array ( |
|
3 | + 'package' => 'blend', |
|
4 | + 'version' => '1.1', |
|
5 | + 'table' => 'blend_migrations', |
|
6 | + 'extends' => 'xPDOSimpleObject', |
|
7 | + 'fields' => |
|
8 | + array ( |
|
9 | 9 | 'name' => NULL, |
10 | 10 | 'version' => NULL, |
11 | 11 | 'type' => 'master', |
@@ -14,64 +14,64 @@ discard block |
||
14 | 14 | 'author' => NULL, |
15 | 15 | 'created_at' => 'CURRENT_TIMESTAMP', |
16 | 16 | 'processed_at' => NULL, |
17 | - ), |
|
18 | - 'fieldMeta' => |
|
19 | - array ( |
|
17 | + ), |
|
18 | + 'fieldMeta' => |
|
19 | + array ( |
|
20 | 20 | 'name' => |
21 | 21 | array ( |
22 | - 'dbtype' => 'varchar', |
|
23 | - 'precision' => '255', |
|
24 | - 'phptype' => 'string', |
|
25 | - 'null' => false, |
|
22 | + 'dbtype' => 'varchar', |
|
23 | + 'precision' => '255', |
|
24 | + 'phptype' => 'string', |
|
25 | + 'null' => false, |
|
26 | 26 | ), |
27 | 27 | 'version' => |
28 | 28 | array ( |
29 | - 'dbtype' => 'varchar', |
|
30 | - 'precision' => '32', |
|
31 | - 'phptype' => 'string', |
|
32 | - 'null' => true, |
|
29 | + 'dbtype' => 'varchar', |
|
30 | + 'precision' => '32', |
|
31 | + 'phptype' => 'string', |
|
32 | + 'null' => true, |
|
33 | 33 | ), |
34 | 34 | 'type' => |
35 | 35 | array ( |
36 | - 'dbtype' => 'set', |
|
37 | - 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
|
38 | - 'phptype' => 'string', |
|
39 | - 'null' => false, |
|
40 | - 'default' => 'master', |
|
36 | + 'dbtype' => 'set', |
|
37 | + 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
|
38 | + 'phptype' => 'string', |
|
39 | + 'null' => false, |
|
40 | + 'default' => 'master', |
|
41 | 41 | ), |
42 | 42 | 'description' => |
43 | 43 | array ( |
44 | - 'dbtype' => 'text', |
|
45 | - 'phptype' => 'string', |
|
46 | - 'null' => true, |
|
44 | + 'dbtype' => 'text', |
|
45 | + 'phptype' => 'string', |
|
46 | + 'null' => true, |
|
47 | 47 | ), |
48 | 48 | 'status' => |
49 | 49 | array ( |
50 | - 'dbtype' => 'varchar', |
|
51 | - 'precision' => '16', |
|
52 | - 'phptype' => 'string', |
|
53 | - 'null' => false, |
|
54 | - 'default' => 'ready', |
|
50 | + 'dbtype' => 'varchar', |
|
51 | + 'precision' => '16', |
|
52 | + 'phptype' => 'string', |
|
53 | + 'null' => false, |
|
54 | + 'default' => 'ready', |
|
55 | 55 | ), |
56 | 56 | 'author' => |
57 | 57 | array ( |
58 | - 'dbtype' => 'varchar', |
|
59 | - 'precision' => '255', |
|
60 | - 'phptype' => 'string', |
|
61 | - 'null' => true, |
|
58 | + 'dbtype' => 'varchar', |
|
59 | + 'precision' => '255', |
|
60 | + 'phptype' => 'string', |
|
61 | + 'null' => true, |
|
62 | 62 | ), |
63 | 63 | 'created_at' => |
64 | 64 | array ( |
65 | - 'dbtype' => 'timestamp', |
|
66 | - 'phptype' => 'timestamp', |
|
67 | - 'null' => false, |
|
68 | - 'default' => 'CURRENT_TIMESTAMP', |
|
65 | + 'dbtype' => 'timestamp', |
|
66 | + 'phptype' => 'timestamp', |
|
67 | + 'null' => false, |
|
68 | + 'default' => 'CURRENT_TIMESTAMP', |
|
69 | 69 | ), |
70 | 70 | 'processed_at' => |
71 | 71 | array ( |
72 | - 'dbtype' => 'timestamp', |
|
73 | - 'phptype' => 'timestamp', |
|
74 | - 'null' => true, |
|
72 | + 'dbtype' => 'timestamp', |
|
73 | + 'phptype' => 'timestamp', |
|
74 | + 'null' => true, |
|
75 | + ), |
|
75 | 76 | ), |
76 | - ), |
|
77 | 77 | ); |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -$xpdo_meta_map['BlendMigrations']= array ( |
|
2 | +$xpdo_meta_map['BlendMigrations'] = array( |
|
3 | 3 | 'package' => 'blend', |
4 | 4 | 'version' => '1.1', |
5 | 5 | 'table' => 'blend_migrations', |
6 | 6 | 'extends' => 'xPDOSimpleObject', |
7 | 7 | 'fields' => |
8 | - array ( |
|
8 | + array( |
|
9 | 9 | 'name' => NULL, |
10 | 10 | 'version' => NULL, |
11 | 11 | 'type' => 'master', |
@@ -16,23 +16,23 @@ discard block |
||
16 | 16 | 'processed_at' => NULL, |
17 | 17 | ), |
18 | 18 | 'fieldMeta' => |
19 | - array ( |
|
19 | + array( |
|
20 | 20 | 'name' => |
21 | - array ( |
|
21 | + array( |
|
22 | 22 | 'dbtype' => 'varchar', |
23 | 23 | 'precision' => '255', |
24 | 24 | 'phptype' => 'string', |
25 | 25 | 'null' => false, |
26 | 26 | ), |
27 | 27 | 'version' => |
28 | - array ( |
|
28 | + array( |
|
29 | 29 | 'dbtype' => 'varchar', |
30 | 30 | 'precision' => '32', |
31 | 31 | 'phptype' => 'string', |
32 | 32 | 'null' => true, |
33 | 33 | ), |
34 | 34 | 'type' => |
35 | - array ( |
|
35 | + array( |
|
36 | 36 | 'dbtype' => 'set', |
37 | 37 | 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
38 | 38 | 'phptype' => 'string', |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | 'default' => 'master', |
41 | 41 | ), |
42 | 42 | 'description' => |
43 | - array ( |
|
43 | + array( |
|
44 | 44 | 'dbtype' => 'text', |
45 | 45 | 'phptype' => 'string', |
46 | 46 | 'null' => true, |
47 | 47 | ), |
48 | 48 | 'status' => |
49 | - array ( |
|
49 | + array( |
|
50 | 50 | 'dbtype' => 'varchar', |
51 | 51 | 'precision' => '16', |
52 | 52 | 'phptype' => 'string', |
@@ -54,21 +54,21 @@ discard block |
||
54 | 54 | 'default' => 'ready', |
55 | 55 | ), |
56 | 56 | 'author' => |
57 | - array ( |
|
57 | + array( |
|
58 | 58 | 'dbtype' => 'varchar', |
59 | 59 | 'precision' => '255', |
60 | 60 | 'phptype' => 'string', |
61 | 61 | 'null' => true, |
62 | 62 | ), |
63 | 63 | 'created_at' => |
64 | - array ( |
|
64 | + array( |
|
65 | 65 | 'dbtype' => 'timestamp', |
66 | 66 | 'phptype' => 'timestamp', |
67 | 67 | 'null' => false, |
68 | 68 | 'default' => 'CURRENT_TIMESTAMP', |
69 | 69 | ), |
70 | 70 | 'processed_at' => |
71 | - array ( |
|
71 | + array( |
|
72 | 72 | 'dbtype' => 'timestamp', |
73 | 73 | 'phptype' => 'timestamp', |
74 | 74 | 'null' => true, |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $xpdo_meta_map = array ( |
4 | - 'xPDOSimpleObject' => |
|
5 | - array ( |
|
4 | + 'xPDOSimpleObject' => |
|
5 | + array ( |
|
6 | 6 | 0 => 'BlendMigrations', |
7 | - ), |
|
7 | + ), |
|
8 | 8 | ); |
9 | 9 | \ No newline at end of file |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$xpdo_meta_map = array ( |
|
3 | +$xpdo_meta_map = array( |
|
4 | 4 | 'xPDOSimpleObject' => |
5 | - array ( |
|
5 | + array( |
|
6 | 6 | 0 => 'BlendMigrations', |
7 | 7 | ), |
8 | 8 | ); |
9 | 9 | \ No newline at end of file |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | 'category' => '', |
29 | 29 | //'cache_type' => 0,//bool |
30 | 30 | //content: 'snippet', plugincode |
31 | - 'description' => '',// 191 |
|
31 | + 'description' => '', // 191 |
|
32 | 32 | 'editor_type' => 0, // int? |
33 | 33 | 'locked' => 0, // bool |
34 | 34 | 'name' => '', |
35 | - 'property_preprocess' => 0,// bool |
|
36 | - 'properties' => '',//?? |
|
35 | + 'property_preprocess' => 0, // bool |
|
36 | + 'properties' => '', //?? |
|
37 | 37 | 'source' => 1, |
38 | 38 | 'static' => 0, |
39 | 39 | 'static_file' => '' |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @param bool $overwrite_static ~ if the setAsStatic is ran, false will keep the static content code, true will overwrite the static file |
114 | 114 | * @return $this |
115 | 115 | */ |
116 | - public function setFieldCode($code, $overwrite_static=false) |
|
116 | + public function setFieldCode($code, $overwrite_static = false) |
|
117 | 117 | { |
118 | 118 | $this->blendable_xpdo_simple_object_data['content'] = $code; |
119 | 119 | $this->overwrite_static = $overwrite_static; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @param bool $overwrite_static ~ if the setAsStatic is ran, false will keep the static content code, true will overwrite the static file |
127 | 127 | * @return $this |
128 | 128 | */ |
129 | - public function setFieldContent($code, $overwrite_static=false) |
|
129 | + public function setFieldContent($code, $overwrite_static = false) |
|
130 | 130 | { |
131 | 131 | return $this->setFieldCode($code, $overwrite_static); |
132 | 132 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * |
177 | 177 | * @return $this |
178 | 178 | */ |
179 | - public function setAsStatic($file, $media_source='Filesystem') |
|
179 | + public function setAsStatic($file, $media_source = 'Filesystem') |
|
180 | 180 | { |
181 | 181 | $this->blendable_xpdo_simple_object_data['source'] = $media_source; |
182 | 182 | $this->blendable_xpdo_simple_object_data['static'] = true; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @return string |
256 | 256 | */ |
257 | - public function seedCategory($category_id=0) |
|
257 | + public function seedCategory($category_id = 0) |
|
258 | 258 | { |
259 | 259 | $categories = $this->blender->getCategoryMap(); |
260 | 260 | if (isset($categories['ids'][$category_id]) && isset($categories['ids'][$category_id]['lineage'])) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param Blender $blender |
41 | 41 | * @param string $key ~ the context key |
42 | 42 | */ |
43 | - public function __construct(\modx $modx, Blender $blender, $key='') |
|
43 | + public function __construct(\modx $modx, Blender $blender, $key = '') |
|
44 | 44 | { |
45 | 45 | $this->setFieldKey($key); |
46 | 46 | parent::__construct($modx, $blender, $key); |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | * @param string $type ~ seed or revert |
72 | 72 | * @return string |
73 | 73 | */ |
74 | - public function getSeedKey($type='seed') |
|
74 | + public function getSeedKey($type = 'seed') |
|
75 | 75 | { |
76 | 76 | $name = $this->getFieldKey(); |
77 | 77 | $key = $this->blender->getSeedKeyFromName($name); |
78 | 78 | |
79 | 79 | switch ($type) { |
80 | 80 | case 'revert': |
81 | - $seed_key = 'revert-' . $key; |
|
81 | + $seed_key = 'revert-'.$key; |
|
82 | 82 | break; |
83 | 83 | |
84 | 84 | case 'seed': |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @param string $namespace |
156 | 156 | * @return $this |
157 | 157 | */ |
158 | - public function addSetting($key, $value, $xtype='textfield', $area='', $namespace='core') |
|
158 | + public function addSetting($key, $value, $xtype = 'textfield', $area = '', $namespace = 'core') |
|
159 | 159 | { |
160 | 160 | // @TODO how to use the SystemSetting class to make blendable context settings and IDE helpers |
161 | 161 | $this->related_data['settings'][] = [ |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * |
38 | 38 | * @return $this |
39 | 39 | */ |
40 | - public function attachToTemplate($template_name, $rank=0) |
|
40 | + public function attachToTemplate($template_name, $rank = 0) |
|
41 | 41 | { |
42 | 42 | $this->template_names[] = [ |
43 | 43 | 'name' => $template_name, |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | */ |
812 | 812 | protected function assignResourceGroups() |
813 | 813 | { |
814 | - $new_groups = (isset($this->related_data['resource_groups']) ? $this->related_data['resource_groups'] : [] ); |
|
814 | + $new_groups = (isset($this->related_data['resource_groups']) ? $this->related_data['resource_groups'] : []); |
|
815 | 815 | |
816 | 816 | // resource groups |
817 | 817 | $current_groups = $this->xPDOSimpleObject->getResourceGroupNames(); |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | * |
845 | 845 | * @return bool|\modResource |
846 | 846 | */ |
847 | - public function getResourceFromSeedKey($seed_key, $context='web') |
|
847 | + public function getResourceFromSeedKey($seed_key, $context = 'web') |
|
848 | 848 | { |
849 | 849 | // get the alias: |
850 | 850 | $alias = $this->blender->getAliasFromSeedKey($seed_key); |
@@ -856,13 +856,13 @@ discard block |
||
856 | 856 | * @param string $type ~ seed or revert |
857 | 857 | * @return string |
858 | 858 | */ |
859 | - public function getSeedKey($type='seed') |
|
859 | + public function getSeedKey($type = 'seed') |
|
860 | 860 | { |
861 | 861 | $key = $this->blender->getSeedKeyFromAlias($this->blendable_xpdo_simple_object_data['alias']); |
862 | 862 | |
863 | 863 | switch ($type) { |
864 | 864 | case 'revert': |
865 | - $seed_key = 'revert-' . $key; |
|
865 | + $seed_key = 'revert-'.$key; |
|
866 | 866 | break; |
867 | 867 | |
868 | 868 | case 'seed': |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | /** @var \modResource $this->xPDOSimpleObject */ |
907 | 907 | $this->xPDOSimpleObject; |
908 | 908 | // no IDs only TV name |
909 | - $tvs = [];// TemplateVarResources modTemplateVarResource |
|
909 | + $tvs = []; // TemplateVarResources modTemplateVarResource |
|
910 | 910 | |
911 | 911 | $template = false; |
912 | 912 | $resource_groups = []; |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | $type = false; |
956 | 956 | |
957 | 957 | // These are set via system settings: |
958 | - if (isset($this->portable_template_variables[$tv_name]) ) { |
|
958 | + if (isset($this->portable_template_variables[$tv_name])) { |
|
959 | 959 | return $this->portable_template_variables[$tv_name]; |
960 | 960 | } |
961 | 961 | |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | // @TODO throw exception |
1031 | 1031 | return 0; |
1032 | 1032 | } |
1033 | - return (int) $this->blender->getResourceIDFromSeedKey( |
|
1033 | + return (int)$this->blender->getResourceIDFromSeedKey( |
|
1034 | 1034 | $parent['seed_key'], |
1035 | 1035 | $parent['context'] |
1036 | 1036 | ); |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | $tag_columns[$name] = $value; |
1192 | 1192 | } |
1193 | 1193 | } |
1194 | - if ( !isset($tags[$tag['group_name']])) { |
|
1194 | + if (!isset($tags[$tag['group_name']])) { |
|
1195 | 1195 | $tags[$tag['group_alias']] = [ |
1196 | 1196 | 'columns' => $group_columns, |
1197 | 1197 | 'tags' => [] |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | * @param \modResource $resource |
1209 | 1209 | * @param array $tags |
1210 | 1210 | */ |
1211 | - protected function setResourceTags(\modResource $resource, $tags=[]) |
|
1211 | + protected function setResourceTags(\modResource $resource, $tags = []) |
|
1212 | 1212 | { |
1213 | 1213 | $tagger_groups = []; |
1214 | 1214 |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @return $this |
127 | 127 | */ |
128 | - public function attachTemplateVariable($tv_name, $rank=0) |
|
128 | + public function attachTemplateVariable($tv_name, $rank = 0) |
|
129 | 129 | { |
130 | 130 | if (!isset($this->related_data['attach'])) { |
131 | 131 | $this->related_data['attach'] = []; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | /** |
225 | 225 | * @var string $type blend or revert |
226 | 226 | */ |
227 | - protected function seedRelated($type='blend') |
|
227 | + protected function seedRelated($type = 'blend') |
|
228 | 228 | { |
229 | 229 | // get all related TVs: |
230 | 230 | $tv_keys = []; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 'name' => $tv_name, |
245 | 245 | 'rank' => $tvTemplate->get('rank') |
246 | 246 | ]; |
247 | - $this->blender->out('TV ' . $tv_name . ' has been seeded: ' . $seed_key); |
|
247 | + $this->blender->out('TV '.$tv_name.' has been seeded: '.$seed_key); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | $this->related_data['seeds'] = $tv_keys; |
@@ -63,14 +63,14 @@ |
||
63 | 63 | * |
64 | 64 | * @return bool |
65 | 65 | */ |
66 | - public function blendFromSeed($seed_key, $overwrite=false); |
|
66 | + public function blendFromSeed($seed_key, $overwrite = false); |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @param bool $overwrite ~ overwrite existing data object |
70 | 70 | * |
71 | 71 | * @return bool |
72 | 72 | */ |
73 | - public function blend($overwrite=false); |
|
73 | + public function blend($overwrite = false); |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * @return bool |