diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..df55cd7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false + +[*.{vue,js,scss}] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9af3157 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +* text=auto + +/tests export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.scrutinizer.yml export-ignore +.travis.yml export-ignore +phpunit.php export-ignore +phpunit.xml.dist export-ignore +phpunit.xml export-ignore +.php_cs export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..497c4e2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.idea +*.DS_Store +/vendor +/coverage +sftp-config.json +composer.lock +.subsplit +.php_cs.cache diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..5627ca6 --- /dev/null +++ b/.php_cs @@ -0,0 +1,27 @@ + + +This source file is subject to the MIT license that is bundled. +EOF; + +return PhpCsFixer\Config::create() + ->setRiskyAllowed(true) + ->setRules(array( + '@Symfony' => true, + 'header_comment' => array('header' => $header), + 'array_syntax' => array('syntax' => 'short'), + 'ordered_imports' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'php_unit_construct' => true, + 'php_unit_strict' => true, + )) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('vendor') + ->in(__DIR__) + ) +; \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..75303d5 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +
A plug-in that generates a data dictionary.
+ + +## Installing + +```shell +$ composer require tim168/data-dict -vvv +``` + +## Usage + +TODO + +## Contributing + +You can contribute in one of three ways: + +1. File bug reports using the [issue tracker](https://github.com/tim168/data-dict/issues). +2. Answer questions or fix bugs on the [issue tracker](https://github.com/tim168/data-dict/issues). +3. Contribute new features or update the wiki. + +_The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable._ + +## License + +MIT \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..a39e44e --- /dev/null +++ b/composer.json @@ -0,0 +1,21 @@ +{ + "name": "tim168\/data-dict", + "description": "A plug-in that generates a data dictionary", + "license": "MIT", + "authors": [ + { + "name": "TIM168", + "email": "784699571@qq.com" + } + ], + "require": { + "ext-mysqli": "*", + "phpunit/phpunit": "^8.5", + "mockery/mockery": "^1.3" + }, + "autoload": { + "psr-4": { + "Tim168\\DataDict\\": "src" + } + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..e47284c --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,21 @@ + +字段名 | 数据类型 | 默认值 | +允许非空 | +自动递增 | 备注 |
---|---|---|---|---|---|
' . $f['COLUMN_NAME'] . ' | '; + $html .= '' . $f['COLUMN_TYPE'] . ' | '; + $html .= '' . $f['COLUMN_DEFAULT'] . ' | '; + $html .= '' . $f['IS_NULLABLE'] . ' | '; + $html .= '' . ($f['EXTRA'] == 'auto_increment' ? '是' : ' ') . ' | '; + $html .= '' . $f['COLUMN_COMMENT'] . ' | '; + $html .= '