Skip to content

Commit

Permalink
Docs folder standardization and other fixes (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizcmarin authored Apr 22, 2024
1 parent 12aa7a3 commit 03b01e8
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 32 deletions.
8 changes: 4 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Copyright © 2008 by Yii Software (https://www.yiiframework.com/)
Copyright © 2008 by Yii Software (<https://www.yiiframework.com/>)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Yii Software nor the names of its
* Neither the name of Yii Software nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

Expand Down
38 changes: 26 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ This package provides the Database target for the [yiisoft/log](https://github.c
| [[db-pgsql]](https://github.com/yiisoft/db-pgsql) | **8.0 - 8.2** | **9.0 - 15.0** | [![pgsql](https://github.com/yiisoft/log-target-db/actions/workflows/pgsql.yml/badge.svg)](https://github.com/yiisoft/log-target-db/actions/workflows/pgsql.yml) |
| [[db-sqlite]](https://github.com/yiisoft/db-sqlite) | **8.0 - 8.2** | **3:latest** | [![sqlite](https://github.com/yiisoft/log-target-db/actions/workflows/sqlite.yml/badge.svg)](https://github.com/yiisoft/log-target-db/actions/workflows/sqlite.yml) |


## Requirements

- PHP 8.0 or higher.
Expand All @@ -35,7 +34,7 @@ This package provides the Database target for the [yiisoft/log](https://github.c

The package could be installed with composer:

```
```shell
composer require yiisoft/log-target-db --prefer-dist
```

Expand All @@ -55,7 +54,7 @@ Package provides two way for preparing database:
- [Oracle](/sql/oci-up.sql),
- [PostgreSQL](/sql/pgsql-up.sql)
- [SQLite](/sql/sqlite-up.sql)

- Ensure no tables:
- [MSSQL](/sql/sqlsrv-down.sql),
- [MySQL / MariaDB](/sql/mysql-down.sql),
Expand Down Expand Up @@ -115,25 +114,40 @@ $logger = new \Yiisoft\Log\Logger([
]);
```

For a description of using the logger, see the [yiisoft/log](https://github.com/yiisoft/log) package.
## Documentation

See [Yii guide to logging](https://github.com/yiisoft/docs/blob/master/guide/en/runtime/logging.md) for more info.
- [English](#english)
- [Português - Brasil](#português---brasil)
- [Internals](docs/internals.md)

## English

## Support
- For use in the [Yii framework](https://www.yiiframework.com/), see the configuration files:
- [`config/common.php`](https://github.com/yiisoft/log-target-db/blob/master/config/common.php)
- [`config/params.php`](https://github.com/yiisoft/log-target-db/blob/master/config/params.php)

If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/db/68) is a good place for that.
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).
- For a description of using the logger, see the [yiisoft/log](https://github.com/yiisoft/log) package.
- See [Yii guide to logging](https://github.com/yiisoft/docs/blob/master/guide/en/runtime/logging.md) for more info.

## Testing
## Português - Brasil

[Check the testing instructions](/docs/en/testing.md) to learn about testing.
- Para usar com o [Yii framework](https://www.yiiframework.com/), veja os arquivos de configuração:
- [`config/common.php`](https://github.com/yiisoft/log-target-db/blob/master/config/common.php)
- [`config/params.php`](https://github.com/yiisoft/log-target-db/blob/master/config/params.php)

- Para uma descrição de como usar o logger, veja [yiisoft/log](https://github.com/yiisoft/log).
- Leia [Yii guide to logging](https://github.com/yiisoft/docs/blob/master/guide/pt-BR/runtime/logging.md) para mais informações.

## Support

If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).

### Support the project
## Support the project

[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)

### Follow updates
## Follow updates

[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"issues": "https://github.com/yiisoft/log-target-db/issues",
"forum": "https://www.yiiframework.com/forum/",
"wiki": "https://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"irc": "ircs://irc.libera.chat:6697/yii",
"chat": "https://t.me/yii3en"
},
"require": {
Expand Down
35 changes: 21 additions & 14 deletions docs/en/testing.md → docs/internals.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Testing
# Internals

This package can be tested globally or individually for each DBMS.

Expand Down Expand Up @@ -32,7 +32,11 @@ docker compose up -d

## Unit testing

The package is tested with [PHPUnit](https://phpunit.de/).
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```shell
./vendor/bin/phpunit
```

### Global testing

Expand All @@ -59,22 +63,13 @@ vendor/bin/phpunit --testsuite=Pgsql
```

Suites available:

- Mssql
- Mysql
- Oracle
- Pgsql
- Sqlite

## Composer require checker

This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`.

To run the checker, execute the following command:

```shell
./vendor/bin/composer-require-checker
```

## Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
Expand All @@ -92,10 +87,22 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static
./vendor/bin/psalm
```

## Rector
## Code style

Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or use either newest or any specific version of PHP:
Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or
use either newest or any specific version of PHP:

```shell
./vendor/bin/rector
```

## Dependencies

Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive
[Composer](https://getcomposer.org/) dependencies.

To run the checker, execute the following command:

```shell
./vendor/bin/composer-require-checker
```
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" failOnRisky="true" failOnWarning="true" stopOnFailure="false" executionOrder="random" resolveDependencies="true" backupGlobals="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" failOnRisky="true" failOnWarning="true" stopOnFailure="false" executionOrder="random" resolveDependencies="true" backupGlobals="false" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/10.1/phpunit.xsd">
<php>
<ini name="error_reporting" value="-1"/>
</php>
Expand Down

0 comments on commit 03b01e8

Please sign in to comment.