diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 5326091..e5177bd 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -1,28 +1,103 @@ import { defineConfig } from 'vitepress' +import enGetNavs from "./src/en/nav"; +import zhGetNavs from "./src/zh/nav"; +import enGetConfig from "./src/en/config"; +import zhGetConfig from "./src/zh/config"; +import zhGetSidebar from "./src/zh/sidebars"; +import enGetSidebar from "./src/en/sidebars"; // https://vitepress.dev/reference/site-config export default defineConfig({ title: "FriendsOfHyperf", description: "A Hyperf component", + ignoreDeadLinks: true, + locales:{ + root:{ + label:"中文", + lang:"zh", + ...zhGetConfig, + }, + en:{ + label:"English", + lang:"en", + link:"/en/index", + ...enGetConfig, + themeConfig:{ + logo: '/logo.svg', + nav: enGetNavs, + sidebar:enGetSidebar, + outline:{ + level:[2 ,4], + }, + } + } + }, themeConfig: { + outline:{ + label: '页面导航', + level: [2, 4], + }, + editLink: { + pattern: 'https://github.com/friendsofhyperf/components/edit/main/docs/:path', + text: '在Github上编辑此页面', + }, + lastUpdated: { + text: '最后更新于', + }, + docFooter: { + next: '下一页', + prev: '上一页', + }, + sidebarMenuLabel: '菜单', + returnToTopLabel: '回到顶部', + search:{ + provider:"local", + options:{ + locales: { + zh: { + translations: { + button: { + buttonText: '搜索文档', + buttonAriaLabel: '搜索文档' + }, + modal: { + noResultsText: '无法找到相关结果', + resetButtonTitle: '清除查询条件', + footer: { + selectText: '选择', + navigateText: '切换' + } + } + } + }, + en: { + translations: { + button: { + buttonText: 'Search documents', + buttonAriaLabel: 'Search documents' + }, + modal: { + noResultsText: 'No relevant results found', + resetButtonTitle: 'Clear query conditions', + footer: { + selectText: 'Select', + navigateText: 'Switch' + } + } + } + } + } + } + }, + i18nRouting:false, // https://vitepress.dev/reference/default-theme-config - nav: [ - { text: 'Home', link: '/' }, - { text: 'Examples', link: '/markdown-examples' } - ], - sidebar: [ - { - text: 'Examples', - items: [ - { text: 'Markdown Examples', link: '/markdown-examples' }, - { text: 'Runtime API Examples', link: '/api-examples' } - ] - } - ], + nav: zhGetNavs, + + sidebar: zhGetSidebar, socialLinks: [ - { icon: 'github', link: 'https://github.com/friendsofhyperf/components' } + { icon: 'github', link: 'https://github.com/friendsofhyperf/components' }, ] } }) diff --git a/.vitepress/src/en/config.ts b/.vitepress/src/en/config.ts new file mode 100644 index 0000000..7dab1bc --- /dev/null +++ b/.vitepress/src/en/config.ts @@ -0,0 +1,5 @@ +export default { + title: "FriendsOfHyperf", + description: "A Hyperf component", + tagline: "Hyperf component", +} \ No newline at end of file diff --git a/.vitepress/src/en/nav.ts b/.vitepress/src/en/nav.ts new file mode 100644 index 0000000..cd83e61 --- /dev/null +++ b/.vitepress/src/en/nav.ts @@ -0,0 +1,9 @@ +import {DefaultTheme} from "vitepress"; + +const nav:DefaultTheme.NavItem[] = [ + { text: '指南', link: '/zh/guide/' }, + { text: '参考', link: '/zh/reference/' }, + { text: '常见问题', link: '/zh/faq/index' } +] + +export default nav \ No newline at end of file diff --git a/.vitepress/src/en/sidebars.ts b/.vitepress/src/en/sidebars.ts new file mode 100644 index 0000000..167c9db --- /dev/null +++ b/.vitepress/src/en/sidebars.ts @@ -0,0 +1,26 @@ +import {DefaultTheme} from "vitepress"; + +const sidebar:DefaultTheme.Sidebar = { + '/zh/guide/': [ + { + text: '介绍', + items: [ + { + text: '关于 FriendsOfHyperf', + link: '/zh_CN/guide/introduce/about', + }, + ] + }, + { + text: '开始', + items: [ + { + text: "组件列表", + link: "/zh_CN/guide/start/components" + } + ] + } + ] +} + +export default sidebar \ No newline at end of file diff --git a/.vitepress/src/zh/config.ts b/.vitepress/src/zh/config.ts new file mode 100644 index 0000000..7dab1bc --- /dev/null +++ b/.vitepress/src/zh/config.ts @@ -0,0 +1,5 @@ +export default { + title: "FriendsOfHyperf", + description: "A Hyperf component", + tagline: "Hyperf component", +} \ No newline at end of file diff --git a/.vitepress/src/zh/nav.ts b/.vitepress/src/zh/nav.ts new file mode 100644 index 0000000..13bf77c --- /dev/null +++ b/.vitepress/src/zh/nav.ts @@ -0,0 +1,9 @@ +import {DefaultTheme} from "vitepress"; + +const nav:DefaultTheme.NavItem[] = [ + { text: '指南', link: '/zh_CN/guide/' }, + { text: '参考', link: '/zh_CN/reference/' }, + { text: '常见问题', link: '/zh_CN/faq/index' } +] + +export default nav \ No newline at end of file diff --git a/.vitepress/src/zh/sidebars.ts b/.vitepress/src/zh/sidebars.ts new file mode 100644 index 0000000..abb3821 --- /dev/null +++ b/.vitepress/src/zh/sidebars.ts @@ -0,0 +1,36 @@ +import {DefaultTheme} from "vitepress"; + +const sidebar:DefaultTheme.Sidebar = { + '/zh_CN/guide/': [ + { + text: '介绍', + items: [ + { + text: '关于 FriendsOfHyperf', + link: '/zh_CN/guide/introduce/about', + }, + ] + }, + { + text: '开始', + items: [ + { + text: "支持的组件列表", + link: "/zh_CN/guide/start/components" + } + ] + } + ], + '/zh_CN/reference/':[ + { + text: 'Amqp Job', + link: '/zh_CN/reference/amqp-job' + }, + { + text: 'Cache', + link: '/zh_CN/reference/cache' + } + ] +} + +export default sidebar \ No newline at end of file diff --git a/zh_CN/faq/index.md b/zh_CN/faq/index.md new file mode 100644 index 0000000..307d253 --- /dev/null +++ b/zh_CN/faq/index.md @@ -0,0 +1 @@ +# 常见问题 \ No newline at end of file diff --git a/zh_CN/guide/index.md b/zh_CN/guide/index.md new file mode 100644 index 0000000..60387b6 --- /dev/null +++ b/zh_CN/guide/index.md @@ -0,0 +1 @@ +# 指南 \ No newline at end of file diff --git a/zh_CN/guide/introduce/about.md b/zh_CN/guide/introduce/about.md new file mode 100644 index 0000000..8fc6942 --- /dev/null +++ b/zh_CN/guide/introduce/about.md @@ -0,0 +1 @@ +# 关于 FriendsOfHyperf \ No newline at end of file diff --git a/zh_CN/guide/start/components.md b/zh_CN/guide/start/components.md new file mode 100644 index 0000000..e9ef38b --- /dev/null +++ b/zh_CN/guide/start/components.md @@ -0,0 +1,52 @@ +# 目前可用的组件列表 + +## Repositories + +|Repository|Stable Version|Total Downloads|Monthly Downloads| +|--|--|--|--| +|[amqp-job](https://github.com/friendsofhyperf/amqp-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/amqp-job/v)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/downloads)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/amqp-job)| +|[cache](https://github.com/friendsofhyperf/cache)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/cache/v)](https://packagist.org/packages/friendsofhyperf/cache)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/cache/downloads)](https://packagist.org/packages/friendsofhyperf/cache)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/cache/d/monthly)](https://packagist.org/packages/friendsofhyperf/cache)| +|[command-signals](https://github.com/friendsofhyperf/command-signals)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-signals/v)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/downloads)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-signals)| +|[command-validation](https://github.com/friendsofhyperf/command-validation)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-validation/v)](https://packagist.org/packages/friendsofhyperf/command-validation)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-validation/downloads)](https://packagist.org/packages/friendsofhyperf/command-validation)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-validation/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-validation)| +|[compoships](https://github.com/friendsofhyperf/compoships)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/compoships/v)](https://packagist.org/packages/friendsofhyperf/compoships)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/compoships/downloads)](https://packagist.org/packages/friendsofhyperf/compoships)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/compoships/d/monthly)](https://packagist.org/packages/friendsofhyperf/compoships)| +|[confd](https://github.com/friendsofhyperf/confd)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/confd/v)](https://packagist.org/packages/friendsofhyperf/confd)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/confd/downloads)](https://packagist.org/packages/friendsofhyperf/confd)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/confd/d/monthly)](https://packagist.org/packages/friendsofhyperf/confd)| +|[config-consul](https://github.com/friendsofhyperf/config-consul)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/config-consul/v)](https://packagist.org/packages/friendsofhyperf/config-consul)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/config-consul/downloads)](https://packagist.org/packages/friendsofhyperf/config-consul)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/config-consul/d/monthly)](https://packagist.org/packages/friendsofhyperf/config-consul)| +|[console-spinner](https://github.com/friendsofhyperf/console-spinner)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/console-spinner/v)](https://packagist.org/packages/friendsofhyperf/console-spinner)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/console-spinner/downloads)](https://packagist.org/packages/friendsofhyperf/console-spinner)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/console-spinner/d/monthly)](https://packagist.org/packages/friendsofhyperf/console-spinner)| +|[di-plus](https://github.com/friendsofhyperf/di-plus)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/di-plus/v)](https://packagist.org/packages/friendsofhyperf/di-plus)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/di-plus/downloads)](https://packagist.org/packages/friendsofhyperf/di-plus)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/di-plus/d/monthly)](https://packagist.org/packages/friendsofhyperf/di-plus)| +|[elasticsearch](https://github.com/friendsofhyperf/elasticsearch)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/elasticsearch/v)](https://packagist.org/packages/friendsofhyperf/elasticsearch)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/elasticsearch/downloads)](https://packagist.org/packages/friendsofhyperf/elasticsearch)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/elasticsearch/d/monthly)](https://packagist.org/packages/friendsofhyperf/elasticsearch)| +|[encryption](https://github.com/friendsofhyperf/encryption)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/encryption/v)](https://packagist.org/packages/friendsofhyperf/encryption)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/encryption/downloads)](https://packagist.org/packages/friendsofhyperf/encryption)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/encryption/d/monthly)](https://packagist.org/packages/friendsofhyperf/encryption)| +|[exception-event](https://github.com/friendsofhyperf/exception-event)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/exception-event/v)](https://packagist.org/packages/friendsofhyperf/exception-event)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/exception-event/downloads)](https://packagist.org/packages/friendsofhyperf/exception-event)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/exception-event/d/monthly)](https://packagist.org/packages/friendsofhyperf/exception-event)| +|[facade](https://github.com/friendsofhyperf/facade)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/facade/v)](https://packagist.org/packages/friendsofhyperf/facade)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/facade/downloads)](https://packagist.org/packages/friendsofhyperf/facade)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/facade/d/monthly)](https://packagist.org/packages/friendsofhyperf/facade)| +|[fast-paginate](https://github.com/friendsofhyperf/fast-paginate)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/fast-paginate/v)](https://packagist.org/packages/friendsofhyperf/fast-paginate)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/fast-paginate/downloads)](https://packagist.org/packages/friendsofhyperf/fast-paginate)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/fast-paginate/d/monthly)](https://packagist.org/packages/friendsofhyperf/fast-paginate)| +|[grpc-validation](https://github.com/friendsofhyperf/grpc-validation)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/grpc-validation/v)](https://packagist.org/packages/friendsofhyperf/grpc-validation)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/grpc-validation/downloads)](https://packagist.org/packages/friendsofhyperf/grpc-validation)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/grpc-validation/d/monthly)](https://packagist.org/packages/friendsofhyperf/grpc-validation)| +|[helpers](https://github.com/friendsofhyperf/helpers)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/helpers/v)](https://packagist.org/packages/friendsofhyperf/helpers)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/helpers/downloads)](https://packagist.org/packages/friendsofhyperf/helpers)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/helpers/d/monthly)](https://packagist.org/packages/friendsofhyperf/helpers)| +|[http-client](https://github.com/friendsofhyperf/http-client)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/http-client/v)](https://packagist.org/packages/friendsofhyperf/http-client)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/http-client/downloads)](https://packagist.org/packages/friendsofhyperf/http-client)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/http-client/d/monthly)](https://packagist.org/packages/friendsofhyperf/http-client)| +|[http-logger](https://github.com/friendsofhyperf/http-logger)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/http-logger/v)](https://packagist.org/packages/friendsofhyperf/http-logger)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/http-logger/downloads)](https://packagist.org/packages/friendsofhyperf/http-logger)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/http-logger/d/monthly)](https://packagist.org/packages/friendsofhyperf/http-logger)| +|[ide-helper](https://github.com/friendsofhyperf/ide-helper)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/ide-helper/v)](https://packagist.org/packages/friendsofhyperf/ide-helper)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/ide-helper/downloads)](https://packagist.org/packages/friendsofhyperf/ide-helper)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/ide-helper/d/monthly)](https://packagist.org/packages/friendsofhyperf/ide-helper)| +|[ipc-broadcaster](https://github.com/friendsofhyperf/ipc-broadcaster)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/ipc-broadcaster/v)](https://packagist.org/packages/friendsofhyperf/ipc-broadcaster)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/ipc-broadcaster/downloads)](https://packagist.org/packages/friendsofhyperf/ipc-broadcaster)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/ipc-broadcaster/d/monthly)](https://packagist.org/packages/friendsofhyperf/ipc-broadcaster)| +|[lock](https://github.com/friendsofhyperf/lock)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/lock/v)](https://packagist.org/packages/friendsofhyperf/lock)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/lock/downloads)](https://packagist.org/packages/friendsofhyperf/lock)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/lock/d/monthly)](https://packagist.org/packages/friendsofhyperf/lock)| +|[macros](https://github.com/friendsofhyperf/macros)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/macros/v)](https://packagist.org/packages/friendsofhyperf/macros)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/macros/downloads)](https://packagist.org/packages/friendsofhyperf/macros)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/macros/d/monthly)](https://packagist.org/packages/friendsofhyperf/macros)| +|[mail](https://github.com/friendsofhyperf/mail)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/mail/v)](https://packagist.org/packages/friendsofhyperf/mail)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/mail/downloads)](https://packagist.org/packages/friendsofhyperf/mail)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/mail/d/monthly)](https://packagist.org/packages/friendsofhyperf/mail)| +|[middleware-plus](https://github.com/friendsofhyperf/middleware-plus)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/middleware-plus/v)](https://packagist.org/packages/friendsofhyperf/middleware-plus)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/middleware-plus/downloads)](https://packagist.org/packages/friendsofhyperf/middleware-plus)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/middleware-plus/d/monthly)](https://packagist.org/packages/friendsofhyperf/middleware-plus)| +|[model-factory](https://github.com/friendsofhyperf/model-factory)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/model-factory/v)](https://packagist.org/packages/friendsofhyperf/model-factory)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/model-factory/downloads)](https://packagist.org/packages/friendsofhyperf/model-factory)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/model-factory/d/monthly)](https://packagist.org/packages/friendsofhyperf/model-factory)| +|[model-hashids](https://github.com/friendsofhyperf/model-hashids)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/model-hashids/v)](https://packagist.org/packages/friendsofhyperf/model-hashids)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/model-hashids/downloads)](https://packagist.org/packages/friendsofhyperf/model-hashids)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/model-hashids/d/monthly)](https://packagist.org/packages/friendsofhyperf/model-hashids)| +|[model-morph-addon](https://github.com/friendsofhyperf/model-morph-addon)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/model-morph-addon/v)](https://packagist.org/packages/friendsofhyperf/model-morph-addon)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/model-morph-addon/downloads)](https://packagist.org/packages/friendsofhyperf/model-morph-addon)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/model-morph-addon/d/monthly)](https://packagist.org/packages/friendsofhyperf/model-morph-addon)| +|[model-observer](https://github.com/friendsofhyperf/model-observer)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/model-observer/v)](https://packagist.org/packages/friendsofhyperf/model-observer)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/model-observer/downloads)](https://packagist.org/packages/friendsofhyperf/model-observer)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/model-observer/d/monthly)](https://packagist.org/packages/friendsofhyperf/model-observer)| +|[model-scope](https://github.com/friendsofhyperf/model-scope)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/model-scope/v)](https://packagist.org/packages/friendsofhyperf/model-scope)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/model-scope/downloads)](https://packagist.org/packages/friendsofhyperf/model-scope)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/model-scope/d/monthly)](https://packagist.org/packages/friendsofhyperf/model-scope)| +|[monolog-hook](https://github.com/friendsofhyperf/monolog-hook)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/monolog-hook/v)](https://packagist.org/packages/friendsofhyperf/monolog-hook)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/monolog-hook/downloads)](https://packagist.org/packages/friendsofhyperf/monolog-hook)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/monolog-hook/d/monthly)](https://packagist.org/packages/friendsofhyperf/monolog-hook)| +|[mysql-grammar-addon](https://github.com/friendsofhyperf/mysql-grammar-addon)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/mysql-grammar-addon/v)](https://packagist.org/packages/friendsofhyperf/mysql-grammar-addon)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/mysql-grammar-addon/downloads)](https://packagist.org/packages/friendsofhyperf/mysql-grammar-addon)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/mysql-grammar-addon/d/monthly)](https://packagist.org/packages/friendsofhyperf/mysql-grammar-addon)| +|[notification](https://github.com/friendsofhyperf/notification)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/notification/v)](https://packagist.org/packages/friendsofhyperf/notification)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/notification/downloads)](https://packagist.org/packages/friendsofhyperf/notification)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/notification/d/monthly)](https://packagist.org/packages/friendsofhyperf/notification)| +|[notification-easysms](https://github.com/friendsofhyperf/notification-easysms)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/notification-easysms/v)](https://packagist.org/packages/friendsofhyperf/notification-easysms)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/notification-easysms/downloads)](https://packagist.org/packages/friendsofhyperf/notification-easysms)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/notification-easysms/d/monthly)](https://packagist.org/packages/friendsofhyperf/notification-easysms)| +|[notification-mail](https://github.com/friendsofhyperf/notification-mail)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/notification-mail/v)](https://packagist.org/packages/friendsofhyperf/notification-mail)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/notification-mail/downloads)](https://packagist.org/packages/friendsofhyperf/notification-mail)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/notification-mail/d/monthly)](https://packagist.org/packages/friendsofhyperf/notification-mail)| +|[openai-client](https://github.com/friendsofhyperf/openai-client)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/openai-client/v)](https://packagist.org/packages/friendsofhyperf/openai-client)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/openai-client/downloads)](https://packagist.org/packages/friendsofhyperf/openai-client)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/openai-client/d/monthly)](https://packagist.org/packages/friendsofhyperf/openai-client)| +|[pest-plugin-hyperf](https://github.com/friendsofhyperf/pest-plugin-hyperf)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/pest-plugin-hyperf/v)](https://packagist.org/packages/friendsofhyperf/pest-plugin-hyperf)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/pest-plugin-hyperf/downloads)](https://packagist.org/packages/friendsofhyperf/pest-plugin-hyperf)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/pest-plugin-hyperf/d/monthly)](https://packagist.org/packages/friendsofhyperf/pest-plugin-hyperf)| +|[pretty-console](https://github.com/friendsofhyperf/pretty-console)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/pretty-console/v)](https://packagist.org/packages/friendsofhyperf/pretty-console)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/pretty-console/downloads)](https://packagist.org/packages/friendsofhyperf/pretty-console)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/pretty-console/d/monthly)](https://packagist.org/packages/friendsofhyperf/pretty-console)| +|[recaptcha](https://github.com/friendsofhyperf/recaptcha)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/recaptcha/v)](https://packagist.org/packages/friendsofhyperf/recaptcha)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/recaptcha/downloads)](https://packagist.org/packages/friendsofhyperf/recaptcha)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/recaptcha/d/monthly)](https://packagist.org/packages/friendsofhyperf/recaptcha)| +|[redis-subscriber](https://github.com/friendsofhyperf/redis-subscriber)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/redis-subscriber/v)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/redis-subscriber/downloads)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/redis-subscriber/d/monthly)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)| +|[sentry](https://github.com/friendsofhyperf/sentry)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/sentry/v)](https://packagist.org/packages/friendsofhyperf/sentry)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/sentry/downloads)](https://packagist.org/packages/friendsofhyperf/sentry)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/sentry/d/monthly)](https://packagist.org/packages/friendsofhyperf/sentry)| +|[support](https://github.com/friendsofhyperf/support)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/support/v)](https://packagist.org/packages/friendsofhyperf/support)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/support/downloads)](https://packagist.org/packages/friendsofhyperf/support)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/support/d/monthly)](https://packagist.org/packages/friendsofhyperf/support)| +|[tcp-sender](https://github.com/friendsofhyperf/tcp-sender)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/tcp-sender/v)](https://packagist.org/packages/friendsofhyperf/tcp-sender)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/tcp-sender/downloads)](https://packagist.org/packages/friendsofhyperf/tcp-sender)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/tcp-sender/d/monthly)](https://packagist.org/packages/friendsofhyperf/tcp-sender)| +|[telescope](https://github.com/friendsofhyperf/telescope)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/telescope/v)](https://packagist.org/packages/friendsofhyperf/telescope)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/telescope/downloads)](https://packagist.org/packages/friendsofhyperf/telescope)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/telescope/d/monthly)](https://packagist.org/packages/friendsofhyperf/telescope)| +|[tinker](https://github.com/friendsofhyperf/tinker)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/tinker/v)](https://packagist.org/packages/friendsofhyperf/tinker)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/tinker/downloads)](https://packagist.org/packages/friendsofhyperf/tinker)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/tinker/d/monthly)](https://packagist.org/packages/friendsofhyperf/tinker)| +|[trigger](https://github.com/friendsofhyperf/trigger)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/trigger/v)](https://packagist.org/packages/friendsofhyperf/trigger)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/trigger/downloads)](https://packagist.org/packages/friendsofhyperf/trigger)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/trigger/d/monthly)](https://packagist.org/packages/friendsofhyperf/trigger)| +|[validated-dto](https://github.com/friendsofhyperf/validated-dto)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/validated-dto/v)](https://packagist.org/packages/friendsofhyperf/validated-dto)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/validated-dto/downloads)](https://packagist.org/packages/friendsofhyperf/validated-dto)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/validated-dto/d/monthly)](https://packagist.org/packages/friendsofhyperf/validated-dto)| \ No newline at end of file diff --git a/zh_CN/reference/amqp-job/index.md b/zh_CN/reference/amqp-job/index.md new file mode 100644 index 0000000..7a5a095 --- /dev/null +++ b/zh_CN/reference/amqp-job/index.md @@ -0,0 +1,60 @@ +# Amqp Job + + +## Installation + +```shell +composer require friendsofhyperf/amqp-job +``` + +## Usage + +### Dispatch + +```php +use FriendsOfHyperf\AmqpJob\Job; +use FriendsOfHyperf\AmqpJob\Annotations\AmqpJob; + +use function FriendsOfHyperf\AmqpJob\dispatch; + +#[AmqpJob( + exchange: 'hyperf.exchange', + routingKey: 'hyperf.routing.key', + pool: 'default', + queue: 'hyperf.queue', +)] +class FooJob extends Job +{ + public function handle() + { + var_dump('foo'); + } +} + +dispatch(new FooJob()); + +``` + +### Register Consumer[Optional] + +```php + +namespace App\Amqp\Consumer; + +use FriendsOfHyperf\AmqpJob\JobConsumer; +use Hyperf\Amqp\Annotation\Consumer; + +#[Consumer( + exchange: 'hyperf.exchange', + routingKey: 'hyperf.routing.key', + queue: 'hyperf.queue', + name: 'MyConsumer', + nums: 4 + +)] +class MyConsumer extends \FriendsOfHyperf\AmqpJob\JobConsumer +{ + // +} + +``` \ No newline at end of file diff --git a/zh_CN/reference/cache/index.md b/zh_CN/reference/cache/index.md new file mode 100644 index 0000000..af4d770 --- /dev/null +++ b/zh_CN/reference/cache/index.md @@ -0,0 +1,62 @@ + +## Installation + +- Installation + +```shell +composer require friendsofhyperf/cache +``` + +## Usage + +- Inject + +```php +namespace App\Controller; + +use FriendsOfHyperf\Cache\CacheInterface; +use Hyperf\Di\Annotation\Inject; + +class IndexController +{ + + #[Inject] + private CacheInterface $cache; + + public function index() + { + return $this->cache->remember($key, $ttl=60, function() { + // return sth + }); + } +} +``` + +- Facade + +```php +use FriendsOfHyperf\Cache\Facade\Cache; + +Cache::remember($key, $ttl=60, function() { + // return sth +}); +``` + +- Switch driver + +```php +use FriendsOfHyperf\Cache\Facade\Cache; +use FriendsOfHyperf\Cache\CacheManager; + +Cache::driver('co')->remember($key, $ttl=60, function() { + // return sth +}); + +CacheManager::get('co')->remember($key, $ttl=60, function() { + // return sth +}); +``` + +## Methods + +Likes [Laravel-Cache](https://laravel.com/docs/8.x/cache) \ No newline at end of file diff --git a/zh_CN/reference/index.md b/zh_CN/reference/index.md new file mode 100644 index 0000000..3b0670d --- /dev/null +++ b/zh_CN/reference/index.md @@ -0,0 +1 @@ +# 参考 \ No newline at end of file