fucodo/registry 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fucodo/registry

最新稳定版本:0.3.1

Composer 安装命令:

composer require fucodo/registry

包简介

README 文档

README

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

registry

This project adds a small reuseable registry for global options to a flow project
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

The project is developer centered, you can use it in any flow project. It created a repository and a service to access the registry.

You may inspect the registry from the commandline.

(back to top)

Built With

  • Love

(back to top)

Getting Started

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    composer req fucodo/registry

(back to top)

Usage

Currently you may directly use the repository, we will add a service.

<?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()));
    }
}

The given example uses Neos.Flow Dependency Injection to include the registry repository.

Then the getValue method is called with the namespace Vendor.Project and the name Helpmessage. As the registry can also store objects, we use serialize internally in doctrine.

To set the value you can use the setValue method.

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

The object \Vendor\Project\Domain\Model\HelpMessage is just a Data Transfer Object in this example, to combine several properties in a single object.

Internally the registry also provides additional information regarding the registry entry.

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

The package also provides some cli commands:

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

Please use the ./flow help command to get the detailed description of the commands.

(back to top)

Roadmap

  • Repo and Database access
  • CLI inspector
  • Abstracted Service

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Your Name - @twitter_handle - hello@fucodo.de

Project Link: https://github.com/fucodo/registry

(back to top)

Acknowledgments

TBD.

(back to top)

统计信息

  • 总下载量: 2.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-12-01