Skip to content

Commit

Permalink
feat:v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vartruexuan committed Jul 12, 2024
0 parents commit 08e2b88
Show file tree
Hide file tree
Showing 35 changed files with 2,847 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* 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
.php-cs-fixer.cache
.phpunit.result.cache
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.idea
*.DS_Store
/vendor
/coverage
/hooks
sftp-config.json
composer.lock
.subsplit
.php_cs.cache
cghooks.lock

49 changes: 49 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'binary_operator_spaces' => true,
'blank_line_after_opening_tag' => true,
'compact_nullable_typehint' => true,
'declare_equal_normalize' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
'no_unused_imports' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
],
],
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'none',
],
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'single_trait_insert_per_statement' => true,
'ternary_operator_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->in([__DIR__.'/src/', __DIR__.'/tests/'])
)
;
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 vartruexuan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# yii-excel

[![php](https://img.shields.io/badge/php-%3E=8.2-brightgreen.svg?maxAge=2592000)](https://github.com/php/php-src)
[![Latest Stable Version](https://img.shields.io/packagist/v/vartruexuan/yii-excel)](https://packagist.org/packages/vartruexuan/yii-excel)
[![Total Downloads](https://img.shields.io/packagist/dt/vartruexuan/yii-excel)](https://packagist.org/packages/vartruexuan/yii-excel)
[![License](https://img.shields.io/packagist/l/vartruexuan/yii-excel)](https://github.com/vartruexuan/yii-excel)

# 概述
excel 导入导出,相关文档处理组件

## 组件能力

- [x] 导入、导出excel
- [x] 支持异步操作,进度构建,信息构建
- [x] 支持 `xlswriter`
- [ ] 支持 `csv`
- [ ] ...
# 安装
```shell
composer require vartruexuan/yii-excel
```
## 配置

## 使用
### 配置
- 配置组件 `components`
```php
[
'components' => [
// excel组件
'excel' => [
'class' => \vartruexuan\excel\drivers\xlswriter\Excel::class,
'fileSystem' => 'filesystem', // 文件管理组件
'redis' => 'redis', // redis
'queue' => 'queue', // 队列组件
// 日志行为类
'as log' => \vartruexuan\excel\behaviors\ExcelLogBehavior::class
]
]
]
```
### 导出
```php

```
### 导入

```php

```
## License

MIT
67 changes: 67 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "vartruexuan/yii-excel",
"description": "excel导入导出组件",
"homepage": "https://github.com/vartruexuan/yii-excel",
"license": "MIT",
"authors": [
{
"name": "guozhaoxuan",
"email": "[email protected]"
}
],
"require": {
"php": ">=8.2",
"overtrue/http": "^1.2",
"creocoder/yii2-flysystem": "^1.1",
"ramsey/uuid": "*"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.8",
"friendsofphp/php-cs-fixer": "^3.0",
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^9.0",
"vimeo/psalm": "^4.10",
"jetbrains/phpstorm-attributes": "^1.0"
},
"autoload": {
"files": [
],
"psr-4": {
"vartruexuan\\excel\\": "src"
}
},
"extra": {
"hooks": {
"pre-commit": [
"composer check-style",
"composer test"
],
"pre-push": [
"composer test",
"composer check-style"
]
},
"vartruexuan": {
"config": "vartruexuan\\excel\\ConfigProvider"
}
},
"scripts": {
"post-update-cmd": [
],
"post-merge": "",
"post-install-cmd": [
],
"cghooks": "vendor/bin/cghooks",
"check-style": "php-cs-fixer fix --using-cache=no --diff --dry-run --ansi",
"fix-style": "php-cs-fixer fix --using-cache=no --ansi",
"test": "phpunit --colors",
"psalm": "psalm --show-info=true --no-cache",
"psalm-fix": "psalm --no-cache --alter --issues=MissingReturnType,MissingParamType"
},
"scripts-descriptions": {
"test": "Run all tests.",
"check-style": "Run style checks (only dry run - no fixing!).",
"fix-style": "Run style checks and fix violations."
}

}
21 changes: 21 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
Loading

0 comments on commit 08e2b88

Please sign in to comment.