fucodo/registry

本包的最新版本(0.1.0)没有可用的许可证信息。

安装: 406

依赖: 0

建议者: 0

安全: 0

星星: 0

关注者: 1

分支: 0

开放问题: 0

类型:neos-package

0.1.0 2023-12-01 17:16 UTC

This package is auto-updated.

Last update: 2024-09-17 07:06:39 UTC


README

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

registry

此项目为流程项目添加了一个用于全局选项的小型可重复使用的注册表
查看文档

查看演示 · 报告错误 · 请求功能

目录
  1. 关于项目
  2. 入门
  3. 使用
  4. 路线图
  5. 贡献
  6. 许可证
  7. 联系
  8. 致谢

关于项目

Product Name Screen Shot

该项目以开发者为中心,您可以在任何流程项目中使用它。它创建了一个存储库和服务来访问注册表。

您可以从命令行检查注册表。

(回到顶部)

构建工具

  • 喜爱

(回到顶部)

入门

先决条件

这是一个如何列出您需要使用的软件以及如何安装它们的示例。

  • npm
    composer req fucodo/registry

(回到顶部)

使用

目前您可以直接使用存储库,我们将会添加一个服务。

<?php
namespace Vendor\Project\Controller;

/*
 * This file is part of the SBS.LaPo.Helparea package.
 */

use fucodo\registry\Domain\Repository\RegistryEntryRepository;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\Controller\ActionController;
use Vendor\Project\Domain\Model\HelpMessage;

class EditorController extends ActionController
{
    /**
     * @Flow\Inject
     * @var RegistryEntryRepository
     */
    protected $registry;

    /**
     * @return void
     */
    public function indexAction()
    {
        $this->view->assign('helpMessage', $this->registry->getValue('Vendor.Project', 'HelpMessage', new HelpMessage()));
    }
}

以下示例使用 Neos.Flow 依赖注入来包含注册表存储库。

然后使用命名空间 Vendor.Project 和名称 Helpmessage 调用 getValue 方法。由于注册表也可以存储对象,我们在 doctrine 内部使用序列化。

要设置值,您可以使用 setValue 方法。

$this->registry->set('Vendor.Project', 'HelpMessage', $helpMessage);

在此示例中,对象 \Vendor\Project\Domain\Model\HelpMessage 仅是一个数据传输对象,用于将多个属性组合在一个对象中。

内部注册表还提供了有关注册表条目的其他信息。

createdAt - a DateTimeImmutable representing the creation date of the entry
updatedAt - a DateTimeImmutable representing the last update date of the entry
type      - a string representing the datatype in the database

该包还提供了一些 CLI 命令

  ./flow registry:list                            
  ./flow registry:set

请使用 ./flow help 命令获取命令的详细描述。

(回到顶部)

路线图

  • 存储库和数据库访问
  • CLI 检查器
  • 抽象服务

查看 开放问题 以获取完整的功能建议(和已知问题)列表。

(回到顶部)

贡献

贡献使开源社区成为一个如此神奇的地方,可以学习、灵感和创造。您所做出的任何贡献都将受到高度重视。

如果您有任何改进建议,请复制存储库并创建一个拉取请求。您也可以简单地创建一个带有“增强”标签的问题。别忘了为项目加星!再次感谢!

  1. 复制项目
  2. 创建您的功能分支(git checkout -b feature/AmazingFeature
  3. 提交您的更改(git commit -m 'Add some AmazingFeature'
  4. 推送到分支(git push origin feature/AmazingFeature
  5. 打开拉取请求

(回到顶部)

许可证

在 MIT 许可证下分发。有关更多信息,请参阅 LICENSE.txt

(回到顶部)

联系

您的名字 - @twitter_handle - hello@fucodo.de

项目链接: https://github.com/fucodo/registry

(回到顶部)

致谢

待定。

(回到顶部)