File tree Expand file tree Collapse file tree 11 files changed +129
-16
lines changed Expand file tree Collapse file tree 11 files changed +129
-16
lines changed Original file line number Diff line number Diff line change
1
+ name : Build
2
+
3
+ on :
4
+ push :
5
+ branches : [ "3.X" ]
6
+ pull_request :
7
+ branches : [ "3.X" ]
8
+
9
+ permissions :
10
+ contents : read
11
+
12
+ jobs :
13
+ test :
14
+
15
+ runs-on : ubuntu-latest
16
+
17
+ strategy :
18
+ matrix :
19
+ php-version :
20
+ - " 7.2"
21
+ - " 7.3"
22
+ - " 7.4"
23
+ - " 8.0"
24
+ - " 8.1"
25
+
26
+ steps :
27
+ - uses : actions/checkout@v3
28
+
29
+ - name : Install PHP
30
+ uses : shivammathur/setup-php@v2
31
+ with :
32
+ php-version : ${{ matrix.php-version }}
33
+
34
+ - name : Validate composer.json and composer.lock
35
+ run : composer validate --strict
36
+
37
+ - name : Cache Composer packages
38
+ id : composer-cache
39
+ uses : actions/cache@v3
40
+ with :
41
+ path : vendor
42
+ key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
43
+ restore-keys : |
44
+ ${{ runner.os }}-php-
45
+
46
+ - name : Install dependencies
47
+ run : composer install --prefer-dist --no-progress
48
+
49
+ - name : Build model
50
+ run : |
51
+ vendor/bin/mysql-workbench-schema-export --config=export1.json vendor/mysql-workbench-schema-exporter/mysql-workbench-schema-exporter/example/data/sakila.mwb
52
+ vendor/bin/mysql-workbench-schema-export --config=export2.json vendor/mysql-workbench-schema-exporter/mysql-workbench-schema-exporter/example/data/sakila.mwb
Original file line number Diff line number Diff line change 1
1
# README
2
2
3
+ ![ Build Status] ( https://github.com/mysql-workbench-schema-exporter/zend1-exporter/actions/workflows/continuous-integration.yml/badge.svg )
4
+ [ ![ Latest Stable Version] ( https://poser.pugx.org/mysql-workbench-schema-exporter/zend1-exporter/v/stable.svg )] ( https://packagist.org/packages/mysql-workbench-schema-exporter/zend1-exporter )
5
+ [ ![ Total Downloads] ( https://poser.pugx.org/mysql-workbench-schema-exporter/zend1-exporter/downloads.svg )] ( https://packagist.org/packages/mysql-workbench-schema-exporter/zend1-exporter )
6
+ [ ![ License] ( https://poser.pugx.org/mysql-workbench-schema-exporter/zend1-exporter/license.svg )] ( https://packagist.org/packages/mysql-workbench-schema-exporter/zend1-exporter )
7
+
3
8
This is an exporter to convert [ MySQL Workbench] ( http://www.mysql.com/products/workbench/ ) Models (\* .mwb) to Zend Framework 1 DbTable and RestController Schema.
4
9
5
10
## Prerequisites
6
11
7
- * PHP 5.4 +
12
+ * PHP 7.2 +
8
13
* Composer to install the dependencies
9
14
10
15
## Installation
Original file line number Diff line number Diff line change 26
26
}
27
27
],
28
28
"require" : {
29
- "php" : " >=5.4.0 " ,
30
- "mysql-workbench-schema-exporter/mysql-workbench-schema-exporter" : " ^3.1 "
29
+ "php" : " >=7.2 " ,
30
+ "mysql-workbench-schema-exporter/mysql-workbench-schema-exporter" : " ^3.2 "
31
31
},
32
32
"autoload" : {
33
33
"psr-4" : {
Original file line number Diff line number Diff line change
1
+ {
2
+ "export" : " zend-dbtable" ,
3
+ "zip" : false ,
4
+ "dir" : " build" ,
5
+ "params" : {
6
+ "language" : " english" ,
7
+ "namingStrategy" : " as-is" ,
8
+ "logToConsole" : false ,
9
+ "logFile" : " " ,
10
+ "backupExistingFile" : true ,
11
+ "useTabs" : false ,
12
+ "indentation" : 4 ,
13
+ "eolDelimeter" : " win" ,
14
+ "addGeneratorInfoAsComment" : true ,
15
+ "filename" : " DbTable\/ %schema%\/ %entity%.%extension%" ,
16
+ "skipPluralNameChecking" : false ,
17
+ "useLoggedStorage" : false ,
18
+ "sortTablesAndViews" : true ,
19
+ "exportOnlyTableCategorized" : " " ,
20
+ "enhanceManyToManyDetection" : true ,
21
+ "skipManyToManyTables" : true ,
22
+ "stripMultipleUnderscores" : false ,
23
+ "asIsUserDatatypePrefix" : " " ,
24
+ "tablePrefix" : " Application_Model_DbTable_" ,
25
+ "parentTable" : " Zend_Db_Table_Abstract" ,
26
+ "generateDRI" : false ,
27
+ "generateGetterSetter" : false
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "export" : " zend-restcontroller" ,
3
+ "zip" : false ,
4
+ "dir" : " build" ,
5
+ "params" : {
6
+ "language" : " english" ,
7
+ "namingStrategy" : " as-is" ,
8
+ "logToConsole" : false ,
9
+ "logFile" : " " ,
10
+ "backupExistingFile" : true ,
11
+ "useTabs" : false ,
12
+ "indentation" : 4 ,
13
+ "eolDelimeter" : " win" ,
14
+ "addGeneratorInfoAsComment" : true ,
15
+ "filename" : " %entity%.%extension%" ,
16
+ "skipPluralNameChecking" : false ,
17
+ "useLoggedStorage" : false ,
18
+ "sortTablesAndViews" : true ,
19
+ "exportOnlyTableCategorized" : " " ,
20
+ "enhanceManyToManyDetection" : true ,
21
+ "skipManyToManyTables" : true ,
22
+ "stripMultipleUnderscores" : false ,
23
+ "asIsUserDatatypePrefix" : " " ,
24
+ "tablePrefix" : " " ,
25
+ "parentTable" : " Zend_Rest_Controller"
26
+ }
27
+ }
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class DatatypeConverter extends BaseDatatypeConverter
33
33
{
34
34
public function setup ()
35
35
{
36
- $ this ->register (array (
36
+ $ this ->register ([
37
37
static ::DATATYPE_TINYINT => 'tinyint ' ,
38
38
static ::DATATYPE_SMALLINT => 'smallint ' ,
39
39
static ::DATATYPE_MEDIUMINT => 'mediumint ' ,
@@ -93,6 +93,6 @@ public function setup()
93
93
static ::USERDATATYPE_NUMERIC => 'decimal ' ,
94
94
static ::USERDATATYPE_DEC => 'decimal ' ,
95
95
static ::USERDATATYPE_CHARACTER => 'char ' ,
96
- ) );
96
+ ] );
97
97
}
98
98
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class Formatter extends BaseFormatter
38
38
protected function init ()
39
39
{
40
40
parent ::init ();
41
- $ this ->addConfigurations (array (
41
+ $ this ->addConfigurations ([
42
42
static ::CFG_INDENTATION => 4 ,
43
43
static ::CFG_FILENAME => 'DbTable/%schema%/%entity%.%extension% ' ,
44
44
static ::CFG_TABLE_PREFIX => 'Application_Model_DbTable_ ' ,
@@ -50,7 +50,7 @@ protected function init()
50
50
// http://framework.zend.com/manual/en/zend.db.table.relationships.html#zend.db.table.relationships.cascading
51
51
static ::CFG_GENERATE_DRI => false ,
52
52
static ::CFG_GENERATE_GETTER_SETTER => false ,
53
- ) );
53
+ ] );
54
54
}
55
55
56
56
/**
Original file line number Diff line number Diff line change @@ -35,13 +35,13 @@ class ForeignKey extends BaseForeignKey
35
35
public function write (WriterInterface $ writer )
36
36
{
37
37
$ writer
38
- ->write ('\'' . $ this ->getReferencedTable ()->getRawTableName () .'\' => array( ' )
38
+ ->write ('\'' . $ this ->getReferencedTable ()->getRawTableName () .'\' => [ ' )
39
39
->indent ()
40
40
->write ('\'columns \' => \'' . $ this ->getLocal ()->getColumnName () .'\', ' )
41
41
->write ('\'refTableClass \' => \'' . $ this ->getReferencedTable ()->getRawTableName () .'\', ' )
42
42
->write ('\'refColumns \' => \'' . $ this ->getForeign ()->getColumnName () .'\', ' )
43
43
->outdent ()
44
- ->write (') , ' )
44
+ ->write ('] , ' )
45
45
;
46
46
47
47
return $ this ;
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ public function writeDependencies(WriterInterface $writer)
107
107
->write (' * ' )
108
108
->write (' * @var array ' )
109
109
->write (' */ ' )
110
- ->write ('protected $_dependentTables = array() ; ' )
110
+ ->write ('protected $_dependentTables = [] ; ' )
111
111
->write ('' )
112
112
;
113
113
@@ -122,15 +122,15 @@ public function writeReferences(WriterInterface $writer)
122
122
->write (' */ ' )
123
123
->writeCallback (function (WriterInterface $ writer , Table $ _this = null ) {
124
124
if (count ($ _this ->getForeignKeys ())) {
125
- $ writer ->write ('protected $_referenceMap = array( ' );
125
+ $ writer ->write ('protected $_referenceMap = [ ' );
126
126
$ writer ->indent ();
127
127
foreach ($ _this ->getForeignKeys () as $ foreignKey ) {
128
128
$ foreignKey ->write ($ writer );
129
129
}
130
130
$ writer ->outdent ();
131
- $ writer ->write (') ; ' );
131
+ $ writer ->write ('] ; ' );
132
132
} else {
133
- $ writer ->write ('protected $_referenceMap = array() ; ' );
133
+ $ writer ->write ('protected $_referenceMap = [] ; ' );
134
134
}
135
135
})
136
136
;
Original file line number Diff line number Diff line change @@ -36,6 +36,6 @@ abstract class Formatter extends BaseFormatter
36
36
37
37
public function getVersion ()
38
38
{
39
- return '3.1.1 ' ;
39
+ return '3.2.0 ' ;
40
40
}
41
41
}
Original file line number Diff line number Diff line change @@ -35,12 +35,12 @@ class Formatter extends BaseFormatter
35
35
protected function init ()
36
36
{
37
37
parent ::init ();
38
- $ this ->addConfigurations (array (
38
+ $ this ->addConfigurations ([
39
39
static ::CFG_INDENTATION => 4 ,
40
40
static ::CFG_FILENAME => '%entity%.%extension% ' ,
41
41
static ::CFG_TABLE_PREFIX => '' ,
42
42
static ::CFG_PARENT_TABLE => 'Zend_Rest_Controller ' ,
43
- ) );
43
+ ] );
44
44
}
45
45
46
46
/**
You can’t perform that action at this time.
0 commit comments