Skip to content

Commit

Permalink
Docs folder standardization and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luizcmarin committed Apr 15, 2024
1 parent 3202067 commit 9c1b718
Show file tree
Hide file tree
Showing 30 changed files with 85 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ the project's leadership.

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4.0, available at
[http://contributor-covenant.org/version/1/4/][version]
[https://contributor-covenant.org/version/1/4/][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
<p align="center">
<a href="http://redis.io/" target="_blank" rel="external">
<a href="https://redis.io/" target="_blank" rel="external">
<img src="https://download.redis.io/redis.png" height="100px">
</a>
<h1 align="center">Yii DBAL Redis connection</h1>
<br>
</p>

This extension provides the [redis](http://redis.io/) connection support for the [Yii framework](http://www.yiiframework.com).
This extension provides the [redis](https://redis.io/) connection support for the [Yii framework](https://www.yiiframework.com).

[![Latest Stable Version](https://poser.pugx.org/yiisoft/db-redis/v/stable.png)](https://packagist.org/packages/yiisoft/db-redis)
[![Total Downloads](https://poser.pugx.org/yiisoft/db-redis/downloads.png)](https://packagist.org/packages/yiisoft/db-redis)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiisoft/db-redis/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/db-redis/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/db-redis/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/db-redis/?branch=master)


## Support version

| PHP | Redis Version | CI-Actions
|:----:|:------------------------:|:---:|
|**7.4 - 8.0**| **4 - 6**|[![Build status](https://github.com/yiisoft/db-redis/workflows/build/badge.svg)](https://github.com/yiisoft/db-redis/actions?query=workflow%3Abuild) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fdb-redis%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-redis/master) [![static analysis](https://github.com/yiisoft/db-redis/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/db-redis/actions?query=workflow%3A%22static+analysis%22) [![type-coverage](https://shepherd.dev/github/yiisoft/db-redis/coverage.svg)](https://shepherd.dev/github/yiisoft/db-redis)


## Installation

The package could be installed via composer:

```php
```shell
composer require yiisoft/db-redis
```

Expand Down Expand Up @@ -64,6 +62,7 @@ return [
]
];
```

### Unit testing

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
Expand Down
18 changes: 13 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"name": "yiisoft/db-redis",
"description": "Yii Framework Redis Cache, Session and ActiveRecord extension",
"keywords": ["yii", "redis", "active-record", "cache", "session"],
"keywords": [
"yii",
"redis",
"active-record",
"cache",
"session"
],
"type": "library",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/db-redis/issues",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"forum": "https://www.yiiframework.com/forum/",
"wiki": "https://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/db-redis"
},
Expand All @@ -32,7 +38,9 @@
"yiisoft/di": "^1.0"
},
"autoload": {
"psr-4": { "Yiisoft\\Db\\Redis\\": "src" }
"psr-4": {
"Yiisoft\\Db\\Redis\\": "src"
}
},
"autoload-dev": {
"psr-4": {
Expand All @@ -49,4 +57,4 @@
"infection/extension-installer": true
}
}
}
}
5 changes: 2 additions & 3 deletions docs/guide/README.md → docs/guide/en/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Yii Framework Redis Cache, Session and ActiveRecord extension

This extension provides the [redis](http://redis.io/) key-value store support for the Yii2 framework.
This extension provides the [redis](https://redis.io/) key-value store support for the Yii2 framework.
It includes a `Cache` and `Session` storage handler and implements the `ActiveRecord` pattern that allows
you to store active records in redis.


Getting Started
---------------

* [Installation](installation.md)

Usage
-----
-----

* [Using the ActiveRecord](usage-ar.md)
* [Using commands directly](usage-commands.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/installation.md → docs/guide/en/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ At least redis version 2.6.12 is required for all components to work properly.

## Getting Composer package

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

```
```shell
composer require --prefer-dist yiisoft/db-redis
```

Expand All @@ -32,7 +32,7 @@ return [
```

This provides the basic access to redis storage via the `redis` application component:

```php
Yii::$app->redis->set('mykey', 'some value');
echo Yii::$app->redis->get('mykey');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ There are shortcuts available for each command supported so insted of the above
$result = $redis->hmset('test_collection', 'key1', 'val1', 'key2', 'val2');
```

For a list of available commands and their parameters see <http://redis.io/commands>.
For a list of available commands and their parameters see <https://redis.io/commands>.
3 changes: 1 addition & 2 deletions docs/guide-ja/README.md → docs/guide/ja/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
Yii 2 Redis キャッシュ、セッションおよびアクティブレコード
==========================================================

このエクステンションは Yii 2 フレームワークに [redis](http://redis.io/) の「キー・値」ストレージのサポートを提供します。
このエクステンションは Yii 2 フレームワークに [redis](https://redis.io/) の「キー・値」ストレージのサポートを提供します。
エクステンションは `Cache``Session` のストレージ・ハンドラを含み、アクティブレコードを redis に保存することを可能にする `ActiveRecord` パターンを実装しています。


始めよう
--------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Composer パッケージを取得する

このエクステンションをインストールするのに推奨される方法は [composer](http://getcomposer.org/download/) によるものです。
このエクステンションをインストールするのに推奨される方法は [composer](https://getcomposer.org/download/) によるものです。

下記のコマンドを実行してください。

Expand Down Expand Up @@ -42,7 +42,7 @@ return [
```

これで、`redis` アプリケーション・コンポーネントによって、redis ストレージに対する基本的なアクセスが提供されるようになります。

```php
Yii::$app->redis->set('mykey', 'some value');
echo Yii::$app->redis->get('mykey');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ $result = $redis->executeCommand('hmset', ['test_collection', 'key1', 'val1', 'k
$result = $redis->hmset('test_collection', 'key1', 'val1', 'key2', 'val2');
```

利用できるコマンドとそのパラメータについては、<http://redis.io/commands> のリストを参照してください。
利用できるコマンドとそのパラメータについては、<https://redis.io/commands> のリストを参照してください。
5 changes: 2 additions & 3 deletions docs/guide-ru/README.md → docs/guide/ru/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
Redis Cache, Session и ActiveRecord для Yii 2
===============================================

Это расширение обеспечивает поддержку хранилища ключ-значение [redis](http://redis.io/) для фреймворка Yii2.
Это расширение обеспечивает поддержку хранилища ключ-значение [redis](https://redis.io/) для фреймворка Yii2.
Оно включает в себя обработчики хранилища `Cache` и `Session` и реализует шаблон `ActiveRecord`, который позволяет сохранять активные записи в Redis.


Как начать
---------------

* [Установка](installation.md)

Использование
-----
-----

* [Использование ActiveRecord](usage-ar.md)
* [Использование команд напрямую](usage-commands.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Установка расширения

Предпочтительным способом установки этого расширения является [Composer](http://getcomposer.org/download/).
Предпочтительным способом установки этого расширения является [Composer](https://getcomposer.org/download/).

Для этого запустите команду

Expand Down Expand Up @@ -42,7 +42,7 @@ return [
```

Это обеспечивает базовый доступ к redis-хранилищу через компонент приложения `redis`:

```php
Yii::$app->redis->set('mykey', 'some value');
echo Yii::$app->redis->get('mykey');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ $result = $redis->executeCommand('hmset', ['test_collection', 'key1', 'val1', 'k
$result = $redis->hmset('test_collection', 'key1', 'val1', 'key2', 'val2');
```

Список доступных команд и их параметры можно найти в официальной документации <http://redis.io/commands>.
Список доступных команд и их параметры можно найти в официальной документации <https://redis.io/commands>.
7 changes: 3 additions & 4 deletions docs/guide-zh-CN/README.md → docs/guide/zh-CN/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
Yii 2 Redis 缓存,会话和活动记录
Yii 2 Redis 缓存,会话和活动记录
===============================================

此扩展为 Yii2 framework 提供了 [redis](http://redis.io/) 键-值存储的支持。
此扩展为 Yii2 framework 提供了 [redis](https://redis.io/) 键-值存储的支持。
包含了一个 `Cache``Session` 存储句柄并且实现了 `ActiveRecord` 模式,允许
你存储活动记录到 redis 中。


入门指南
---------------

* [安装](installation.md)

用法
-----
-----

* [活动记录的使用](usage-ar.md)
* [直接使用命令](usage-commands.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ redis 2.6.12 版本是所有部件正常工作所必需的。

## 获取 Composer 安装包

安装此扩展的首选方式是通过 [composer](http://getcomposer.org/download/)
安装此扩展的首选方式是通过 [composer](https://getcomposer.org/download/)

可以运行

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ $result = $redis->executeCommand('hmset', ['test_collection', 'key1', 'val1', 'k
$result = $redis->hmset(['test_collection', 'key1', 'val1', 'key2', 'val2']);
```

可用命令列表和他们的参数可参阅 [http://redis.io/commands](http://redis.io/commands)
可用命令列表和他们的参数可参阅 [https://redis.io/commands](https://redis.io/commands)
40 changes: 40 additions & 0 deletions docs/internals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Internals

## Unit testing

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

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

## Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:

```shell
./vendor/bin/roave-infection-static-analysis-plugin
```

## Static analysis

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:

```shell
./vendor/bin/psalm
```

## 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:

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

## Dependencies

Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive
[Composer](https://getcomposer.org/) dependencies.
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<psalm
errorLevel="7"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
Expand Down
8 changes: 4 additions & 4 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
use function version_compare;

/**
* The redis connection class is used to establish a connection to a [redis](http://redis.io/) server.
* The redis connection class is used to establish a connection to a [redis](https://redis.io/) server.
*
* By default it assumes there is a redis server running on localhost at port 6379 and uses the database number 0.
*
* It is possible to connect to a redis server using [[hostname]] and [[port]] or using a [[unixSocket]].
*
* It also supports [the AUTH command](http://redis.io/commands/auth) of redis.
* It also supports [the AUTH command](https://redis.io/commands/auth) of redis.
* When the server needs authentication, you can set the [[password]] property to
* authenticate with the server after connect.
*
* The execution of [redis commands](http://redis.io/commands) is possible with via [[executeCommand()]].
* The execution of [redis commands](https://redis.io/commands) is possible with via [[executeCommand()]].
*
* @method mixed append($key, $value) Append a value to a key. <https://redis.io/commands/append>
* @method mixed auth($password) Authenticate to the server. <https://redis.io/commands/auth>
Expand Down Expand Up @@ -566,7 +566,7 @@ public function open(): void
);

if ($socket) {
$this->pool[ $this->getConnectionString() ] = $socket;
$this->pool[$this->getConnectionString()] = $socket;

if ($this->dataTimeout !== null) {
stream_set_timeout(
Expand Down

0 comments on commit 9c1b718

Please sign in to comment.