Skip to content

Commit ad1acaf

Browse files
committed
Merge branch 'release/0.9.47'
2 parents a7c71b4 + e249a78 commit ad1acaf

3 files changed

Lines changed: 51 additions & 14 deletions

File tree

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 9,
5-
"patch": 46,
5+
"patch": 47,
66
"build": 0
77
}

src/Mvc/Cli/Commands/Routes/ListCommand.php

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,33 +96,67 @@ private function loadRoutes( string $configPath ): array
9696
{
9797
$routes = [];
9898

99-
// Load neuron.yaml configuration
100-
$configFile = $configPath . '/neuron.yaml';
99+
// Try routing.yaml first (new location), fall back to neuron.yaml (legacy)
100+
$routingFile = $configPath . '/routing.yaml';
101+
$neuronFile = $configPath . '/neuron.yaml';
101102

102-
if( !file_exists( $configFile ) )
103+
$configFile = null;
104+
$configKey = null;
105+
106+
if( file_exists( $routingFile ) )
107+
{
108+
$configFile = $routingFile;
109+
$configKey = 'controller_paths';
110+
}
111+
elseif( file_exists( $neuronFile ) )
103112
{
104-
$this->output->error( 'Configuration file not found: ' . $configFile );
113+
$configFile = $neuronFile;
114+
$configKey = 'controllers.paths';
115+
}
116+
else
117+
{
118+
$this->output->error( 'Configuration file not found' );
119+
$this->output->info( 'Expected: ' . $routingFile . ' or ' . $neuronFile );
105120
return [];
106121
}
107122

108123
try
109124
{
110125
$settings = new Yaml( $configFile );
111126

112-
// Get base path
113-
$basePath = $settings->get( 'system', 'base_path' ) ?? dirname( $configPath );
127+
// Get base path from neuron.yaml
128+
$neuronSettings = file_exists( $neuronFile ) ? new Yaml( $neuronFile ) : null;
129+
$basePath = $neuronSettings?->get( 'system', 'base_path' ) ?? dirname( $configPath );
114130

115131
// Get controller paths from configuration
116-
$controllerPathsConfig = $settings->get( 'controllers', 'paths' );
132+
if( $configKey === 'controller_paths' )
133+
{
134+
// New format in routing.yaml
135+
$controllerPathsConfig = $settings->getSection( 'controller_paths' );
136+
}
137+
else
138+
{
139+
// Legacy format in neuron.yaml
140+
$controllerPathsConfig = $settings->get( 'controllers', 'paths' );
141+
}
117142

118143
if( empty( $controllerPathsConfig ) )
119144
{
120-
$this->output->warning( 'No controller paths configured in neuron.yaml' );
121-
$this->output->info( 'Add controller paths to neuron.yaml under controllers.paths:' );
122-
$this->output->info( ' controllers:' );
123-
$this->output->info( ' paths:' );
124-
$this->output->info( ' - path: app/Controllers' );
125-
$this->output->info( ' namespace: App\\Controllers' );
145+
$this->output->warning( 'No controller paths configured' );
146+
$this->output->info( 'Add controller paths to ' . basename( $configFile ) . ':' );
147+
if( $configKey === 'controller_paths' )
148+
{
149+
$this->output->info( ' controller_paths:' );
150+
$this->output->info( ' - path: app/Controllers' );
151+
$this->output->info( ' namespace: App\\Controllers' );
152+
}
153+
else
154+
{
155+
$this->output->info( ' controllers:' );
156+
$this->output->info( ' paths:' );
157+
$this->output->info( ' - path: app/Controllers' );
158+
$this->output->info( ' namespace: App\\Controllers' );
159+
}
126160
return [];
127161
}
128162

versionlog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.9.47 2026-01-14
2+
* Fixed routes:list cli command
3+
14
## 0.9.46 2026-01-13
25

36
## 0.9.45 2026-01-12

0 commit comments

Comments
 (0)