Skip to content

Conversation

@xepozz
Copy link
Member

@xepozz xepozz commented Mar 27, 2023

image

image

image

In development I just run the worker in console php watcher.php and it rebuild the attributes map as fast as possible:
image

Related: yiisoft/router#194

@what-the-diff
Copy link

what-the-diff bot commented Mar 27, 2023

PR Summary

  • 🔧 Code Formatting Improvement
    Adjusted formatting in the application.php file
  • 📚 Documentation Update
    Added @OA\Schema reference for better API documentation
  • 🏗️ New Watcher Build Scripts
    Implemented watcher-build.php and watcher.php
  • 🛣️ Route Configuration Enhancement
    Changed route creation in config/common/routes/routes.php to use attributes
  • 🏷️ Attribute Annotations Added
    Included attribute annotations for SiteController, ApiUserController, and Actions\ApiInfo classes

@samdark
Copy link
Member

samdark commented Mar 28, 2023

Nice. That should at least go into cookbook.

->onAnyChange(function (string $type, string $path) {
echo sprintf('File changed: "%s".', $path) . PHP_EOL;
echo 'Run watcher-build...' . PHP_EOL;
`php watcher-build.php`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it disabled by default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabled what?

use Yiisoft\Yii\RateLimiter\Storage\StorageInterface;

$routes = [];
foreach (Attributes::findTargetMethods(Route::class) as $method) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about classes and groups?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just an example. If we want to merge it I'll migrate all routes and add groups and classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants