fucodo/registry

There is no license information available for the latest version (0.1.0) of this package.

Installs: 43

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:neos-package

0.1.0 2023-12-01 17:16 UTC

This package is auto-updated.

Last update: 2024-04-17 06:17:28 UTC


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)