orionis 0.633.0__py3-none-any.whl → 0.635.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import copy
2
3
  import time
3
4
  from pathlib import Path
4
5
  from typing import Any, List, Type, Dict
@@ -131,15 +132,14 @@ class Application(Container, IApplication):
131
132
  # Propierty to store service providers.
132
133
  self.__providers: List[IServiceProvider, Any] = []
133
134
 
134
- # Property to store configurators and paths
135
- self.__configurators : dict = {}
136
-
137
135
  # Property to indicate if the application has been booted
138
136
  self.__booted: bool = False
137
+ self.__configured: bool = False
139
138
 
140
- # Property to store application configuration
141
- # This will be initialized with default values or from configurators
139
+ # Properties to store configuration and runtime configuration
142
140
  self.__config: dict = {}
141
+ self.__runtime_config: dict = {}
142
+ self.__runtime_path_config: dict = {}
143
143
 
144
144
  # Property to store the scheduler instance
145
145
  self.__scheduler: BaseScheduler = None
@@ -205,6 +205,7 @@ class Application(Container, IApplication):
205
205
  ensure core framework services are available before any user-defined
206
206
  providers are registered.
207
207
  """
208
+
208
209
  # Import core framework providers
209
210
  from orionis.foundation.providers.catch_provider import CathcProvider
210
211
  from orionis.foundation.providers.cli_request_provider import CLRequestProvider
@@ -278,6 +279,10 @@ class Application(Container, IApplication):
278
279
  registration.
279
280
  """
280
281
 
282
+ # Validate providers parameter
283
+ if not isinstance(providers, list):
284
+ raise OrionisTypeError(f"Expected list of IServiceProvider classes, got {type(providers).__name__}")
285
+
281
286
  # Add each provider class
282
287
  for provider_cls in providers:
283
288
 
@@ -413,7 +418,7 @@ class Application(Container, IApplication):
413
418
  - This method is called automatically during application bootstrapping, after all providers
414
419
  have been registered.
415
420
  - Supports both synchronous and asynchronous `boot()` methods on providers.
416
- - The providers list is cleared after booting to prevent memory leaks.
421
+ - The providers list is deleted after booting to optimize memory usage.
417
422
 
418
423
  Returns
419
424
  -------
@@ -437,8 +442,8 @@ class Application(Container, IApplication):
437
442
  else:
438
443
  boot_method()
439
444
 
440
- # Clear the providers list to free memory after booting is complete
441
- self.__providers.clear()
445
+ # Delete the providers list property to free memory after booting is complete
446
+ del self.__providers
442
447
 
443
448
  # === Application Skeleton Configuration Methods ===
444
449
  # The Orionis framework provides methods to configure each component of the application,
@@ -786,7 +791,7 @@ class Application(Container, IApplication):
786
791
  raise OrionisTypeError(f"Expected App instance or dict, got {type(app).__name__}")
787
792
 
788
793
  # Store the configuration dictionary in internal configurators
789
- self.__configurators['app'] = _app
794
+ self.__config['app'] = _app
790
795
 
791
796
  # Return self for method chaining
792
797
  return self
@@ -882,7 +887,7 @@ class Application(Container, IApplication):
882
887
  raise OrionisTypeError(f"Expected Auth instance or dict, got {type(auth).__name__}")
883
888
 
884
889
  # Store the configuration dictionary in internal configurators
885
- self.__configurators['auth'] = _auth
890
+ self.__config['auth'] = _auth
886
891
 
887
892
  # Return self for method chaining
888
893
  return self
@@ -978,7 +983,7 @@ class Application(Container, IApplication):
978
983
  raise OrionisTypeError(f"Expected Cache instance or dict, got {type(cache).__name__}")
979
984
 
980
985
  # Store the configuration dictionary in internal configurators
981
- self.__configurators['cache'] = _cache
986
+ self.__config['cache'] = _cache
982
987
 
983
988
  # Return self for method chaining
984
989
  return self
@@ -1074,7 +1079,7 @@ class Application(Container, IApplication):
1074
1079
  raise OrionisTypeError(f"Expected Cors instance or dict, got {type(cors).__name__}")
1075
1080
 
1076
1081
  # Store the configuration dictionary in internal configurators
1077
- self.__configurators['cors'] = _cors
1082
+ self.__config['cors'] = _cors
1078
1083
 
1079
1084
  # Return self for method chaining
1080
1085
  return self
@@ -1170,7 +1175,7 @@ class Application(Container, IApplication):
1170
1175
  raise OrionisTypeError(f"Expected Database instance or dict, got {type(database).__name__}")
1171
1176
 
1172
1177
  # Store the configuration dictionary in internal configurators
1173
- self.__configurators['database'] = _database
1178
+ self.__config['database'] = _database
1174
1179
 
1175
1180
  # Return self for method chaining
1176
1181
  return self
@@ -1266,7 +1271,7 @@ class Application(Container, IApplication):
1266
1271
  raise OrionisTypeError(f"Expected Filesystems instance or dict, got {type(filesystems).__name__}")
1267
1272
 
1268
1273
  # Store the configuration dictionary in internal configurators
1269
- self.__configurators['filesystems'] = _filesystems
1274
+ self.__config['filesystems'] = _filesystems
1270
1275
 
1271
1276
  # Return self for method chaining
1272
1277
  return self
@@ -1362,7 +1367,7 @@ class Application(Container, IApplication):
1362
1367
  raise OrionisTypeError(f"Expected Logging instance or dict, got {type(logging).__name__}")
1363
1368
 
1364
1369
  # Store the configuration dictionary in internal configurators
1365
- self.__configurators['logging'] = _logging
1370
+ self.__config['logging'] = _logging
1366
1371
 
1367
1372
  # Return self for method chaining
1368
1373
  return self
@@ -1458,7 +1463,7 @@ class Application(Container, IApplication):
1458
1463
  raise OrionisTypeError(f"Expected Mail instance or dict, got {type(mail).__name__}")
1459
1464
 
1460
1465
  # Store the configuration dictionary in internal configurators
1461
- self.__configurators['mail'] = _mail
1466
+ self.__config['mail'] = _mail
1462
1467
 
1463
1468
  # Return self for method chaining
1464
1469
  return self
@@ -1554,7 +1559,7 @@ class Application(Container, IApplication):
1554
1559
  raise OrionisTypeError(f"Expected Queue instance or dict, got {type(queue).__name__}")
1555
1560
 
1556
1561
  # Store the configuration dictionary in internal configurators
1557
- self.__configurators['queue'] = _queue
1562
+ self.__config['queue'] = _queue
1558
1563
 
1559
1564
  # Return self for method chaining
1560
1565
  return self
@@ -1650,7 +1655,7 @@ class Application(Container, IApplication):
1650
1655
  raise OrionisTypeError(f"Expected Session instance or dict, got {type(session).__name__}")
1651
1656
 
1652
1657
  # Store the configuration dictionary in internal configurators
1653
- self.__configurators['session'] = _session
1658
+ self.__config['session'] = _session
1654
1659
 
1655
1660
  # Return self for method chaining
1656
1661
  return self
@@ -1746,7 +1751,7 @@ class Application(Container, IApplication):
1746
1751
  raise OrionisTypeError(f"Expected Testing instance or dict, got {type(testing).__name__}")
1747
1752
 
1748
1753
  # Store the configuration dictionary in internal configurators
1749
- self.__configurators['testing'] = _testing
1754
+ self.__config['testing'] = _testing
1750
1755
 
1751
1756
  # Return self for method chaining
1752
1757
  return self
@@ -1802,25 +1807,25 @@ class Application(Container, IApplication):
1802
1807
  Returns the current Application instance to enable method chaining.
1803
1808
  """
1804
1809
 
1805
- self.__configurators['path'] = {
1806
- 'root': str(root),
1807
- 'app': str(app),
1808
- 'console': str(console),
1809
- 'exceptions': str(exceptions),
1810
- 'http': str(http),
1811
- 'models': str(models),
1812
- 'providers': str(providers),
1813
- 'notifications': str(notifications),
1814
- 'services': str(services),
1815
- 'jobs': str(jobs),
1816
- 'bootstrap': str(bootstrap),
1817
- 'config': str(config),
1818
- 'database': str(database),
1819
- 'resources': str(resources),
1820
- 'routes': str(routes),
1821
- 'storage': str(storage),
1822
- 'tests': str(tests)
1823
- }
1810
+ self.loadConfigPaths({
1811
+ 'root': root,
1812
+ 'app': app,
1813
+ 'console': console,
1814
+ 'exceptions': exceptions,
1815
+ 'http': http,
1816
+ 'models': models,
1817
+ 'providers': providers,
1818
+ 'notifications': notifications,
1819
+ 'services': services,
1820
+ 'jobs': jobs,
1821
+ 'bootstrap': bootstrap,
1822
+ 'config': config,
1823
+ 'database': database,
1824
+ 'resources': resources,
1825
+ 'routes': routes,
1826
+ 'storage': storage,
1827
+ 'tests': tests
1828
+ })
1824
1829
 
1825
1830
  return self
1826
1831
 
@@ -1878,7 +1883,7 @@ class Application(Container, IApplication):
1878
1883
  raise OrionisTypeError(f"Expected Paths instance or dict, got {type(paths).__name__}")
1879
1884
 
1880
1885
  # Store the configuration dictionary in internal configurators
1881
- self.__configurators['path'] = _paths
1886
+ self.__config['path'] = _paths
1882
1887
 
1883
1888
  # Return self for method chaining
1884
1889
  return self
@@ -1911,17 +1916,18 @@ class Application(Container, IApplication):
1911
1916
  # Try to load the configuration
1912
1917
  try:
1913
1918
 
1914
- # Check if configuration is a dictionary
1919
+ # Check if there are any configurators set
1915
1920
  if not self.__config:
1921
+ self.__config = Configuration().toDict()
1916
1922
 
1917
- # Initialize with default configuration
1918
- if not self.__configurators:
1919
- self.__config = Configuration().toDict()
1923
+ # Create a deep copy of the current configuration
1924
+ local_config_copy = copy.deepcopy(self.__config)
1920
1925
 
1921
- # Assign the configurators to config and clean up
1922
- else:
1923
- self.__config = self.__configurators
1924
- del self.__configurators
1926
+ # Copy all config except the 'path' key
1927
+ self.__runtime_config = {k: v for k, v in local_config_copy.items() if k != 'path'}
1928
+
1929
+ # Copy contains only the 'path' key
1930
+ self.__runtime_path_config = local_config_copy.get('path', {})
1925
1931
 
1926
1932
  except Exception as e:
1927
1933
 
@@ -1936,87 +1942,104 @@ class Application(Container, IApplication):
1936
1942
 
1937
1943
  def config(
1938
1944
  self,
1939
- key: str = None
1945
+ key: str = None,
1946
+ value: Any = None
1940
1947
  ) -> Any:
1941
1948
  """
1942
- Retrieve application configuration values using dot notation.
1949
+ Retrieve or set application configuration values using dot notation.
1943
1950
 
1944
- This method provides access to the application's configuration settings,
1945
- supporting retrieval of nested values using dot notation (e.g., "database.default").
1946
- If a key is provided, the method returns the corresponding configuration value.
1947
- If no key is provided, it returns the entire configuration dictionary, excluding
1948
- path-related configuration (which should be accessed via the `path()` method).
1951
+ If only `key` is provided, returns the configuration value for that key.
1952
+ If both `key` and `value` are provided, sets the configuration value.
1953
+ If neither is provided, returns the entire configuration dictionary (excluding 'path').
1949
1954
 
1950
1955
  Parameters
1951
1956
  ----------
1952
1957
  key : str, optional
1953
- The configuration key to retrieve, supporting dot notation for nested
1954
- values (e.g., "database.default", "app.name"). If None, the method returns
1955
- the entire configuration dictionary except for the 'path' configuration.
1956
- Default is None.
1958
+ Dot-notated configuration key (e.g., "database.default"). If None, returns all config.
1959
+ value : Any, optional
1960
+ Value to set for the given key. If None, performs a get operation.
1957
1961
 
1958
1962
  Returns
1959
1963
  -------
1960
1964
  Any
1961
- If `key` is provided and found, returns the corresponding configuration value.
1962
- If `key` is None, returns the entire configuration dictionary (excluding 'path').
1963
- If the key is not found, returns None.
1965
+ The configuration value, or None if not found.
1964
1966
 
1965
1967
  Raises
1966
1968
  ------
1967
1969
  OrionisRuntimeError
1968
- If the application configuration has not been initialized (i.e., if `create()`
1969
- has not been called before accessing configuration).
1970
+ If configuration is not initialized.
1970
1971
  OrionisValueError
1971
- If the provided `key` parameter is not a string type.
1972
-
1973
- Notes
1974
- -----
1975
- The method traverses nested configuration structures by splitting the key
1976
- on dots and navigating through dictionary levels. Path configurations are
1977
- excluded from full configuration returns and should be accessed via the
1978
- `path()` method instead.
1972
+ If key is not a string.
1979
1973
  """
1980
1974
 
1981
- # Create a local copy of the configuration to avoid mutating the original
1982
- if not hasattr(self, '_Application__runtime_config') or self.__runtime_config is None:
1983
- self.__runtime_config = self.__config.copy()
1984
-
1985
- # Remove 'path' from the local copy to ensure path config is not returned here
1986
- if 'path' in self.__runtime_config:
1987
- del self.__runtime_config['path']
1988
-
1989
- # Ensure the application is booted before accessing configuration
1990
- if not self.__runtime_config:
1975
+ if not self.__configured:
1991
1976
  raise OrionisRuntimeError(
1992
1977
  "Application configuration is not initialized. Please call create() before accessing configuration."
1993
1978
  )
1994
1979
 
1995
- # If no key is provided, return the entire configuration (excluding 'path')
1996
- if key is None:
1980
+ # Return all config if no key is provided
1981
+ if key is None and value is None:
1997
1982
  return self.__runtime_config
1998
1983
 
1999
- # Ensure the key is a string
2000
1984
  if not isinstance(key, str):
2001
1985
  raise OrionisValueError(
2002
- "Key must be a string. Use config() without arguments to retrieve the entire configuration."
1986
+ "The configuration key must be a string. To retrieve the entire configuration, call config() without any arguments."
2003
1987
  )
2004
1988
 
2005
- # Split the key by dot notation to support nested access
2006
- parts = key.split('.')
2007
-
2008
- # Start with the full config and traverse according to the key parts
2009
- config_value = self.__runtime_config
2010
- for part in parts:
2011
- # If the part exists in the current config_value, go deeper
2012
- if isinstance(config_value, dict) and part in config_value:
2013
- config_value = config_value[part]
1989
+ key_parts = key.split('.')
1990
+ config_dict = self.__runtime_config
1991
+
1992
+ # If setting a value
1993
+ if value is not None:
1994
+ current_dict = config_dict
1995
+ for part in key_parts[:-1]:
1996
+ if part not in current_dict or not isinstance(current_dict[part], dict):
1997
+ current_dict[part] = {}
1998
+ current_dict = current_dict[part]
1999
+ current_dict[key_parts[-1]] = value
2000
+ return value
2001
+
2002
+ # Getting a value
2003
+ current_dict = config_dict
2004
+ for part in key_parts:
2005
+ if isinstance(current_dict, dict) and part in current_dict:
2006
+ current_dict = current_dict[part]
2014
2007
  else:
2015
- # If any part is missing, return None
2016
2008
  return None
2009
+ return current_dict
2017
2010
 
2018
- # Return the final configuration value found
2019
- return config_value
2011
+ def resetConfig(
2012
+ self
2013
+ ) -> 'Application':
2014
+ """
2015
+ Reset the application configuration to an uninitialized state.
2016
+
2017
+ This method clears the current runtime configuration and marks the application
2018
+ as unconfigured, allowing for re-initialization of the configuration by calling
2019
+ `create()` again. This is useful in scenarios such as testing or when dynamic
2020
+ reloading of configuration is required.
2021
+
2022
+ Notes
2023
+ -----
2024
+ - After calling this method, you must call `create()` to reinitialize
2025
+ the configuration before accessing it again.
2026
+ - This method does not affect other aspects of the application state,
2027
+ such as registered providers or boot status.
2028
+
2029
+ Returns
2030
+ -------
2031
+ Application
2032
+ Returns the current `Application` instance to enable method chaining.
2033
+ """
2034
+
2035
+ # Create a deep copy of the current configuration
2036
+ local_config_copy = copy.deepcopy(self.__config)
2037
+
2038
+ # Reset the runtime configuration to match the current config (excluding 'path')
2039
+ self.__runtime_config = {k: v for k, v in local_config_copy.items() if k != 'path'}
2040
+
2041
+ # Return the application instance for method chaining
2042
+ return self
2020
2043
 
2021
2044
  # === Path Configuration Access Method ===
2022
2045
  # The path() method provides access to application path configurations.
@@ -2030,7 +2053,7 @@ class Application(Container, IApplication):
2030
2053
  """
2031
2054
  Retrieve application path configuration values using dot notation.
2032
2055
 
2033
- Provides access to the application's path configuration, allowing retrieval of either a specific path value or the entire paths configuration dictionary. If a key is provided, the corresponding path is returned as a `Path` object. If no key is provided, a dictionary mapping all path configuration keys to their resolved `Path` objects is returned.
2056
+ This method provides access to the application's path configuration, allowing retrieval of either a specific path value or the entire paths configuration dictionary. If a key is provided, the corresponding path is returned as a `Path` object. If no key is provided, a dictionary mapping all path configuration keys to their resolved `Path` objects is returned.
2034
2057
 
2035
2058
  Parameters
2036
2059
  ----------
@@ -2042,7 +2065,7 @@ class Application(Container, IApplication):
2042
2065
  -------
2043
2066
  Path or dict
2044
2067
  If `key` is provided and found, returns the resolved `Path` object for that key.
2045
- If `key` is None, returns a dictionary mapping all path keys to their `Path` objects.
2068
+ If `key` is None, returns a dictionary mapping all path keys to their resolved `Path` objects.
2046
2069
  If `key` is not found, returns None.
2047
2070
 
2048
2071
  Raises
@@ -2058,23 +2081,21 @@ class Application(Container, IApplication):
2058
2081
  - This method is specifically designed for path-related configuration access, separate from general application configuration.
2059
2082
  - All returned paths are resolved as `Path` objects for consistency and ease of use.
2060
2083
  """
2061
-
2062
- # Create a local copy of the path configuration to avoid mutation
2063
- if not hasattr(self, '_Application__runtime_path_config') or self.__runtime_path_config is None:
2064
- self.__runtime_path_config = self.__config.get('path', {}).copy() if self.__config else {}
2065
-
2066
- # Ensure the application is booted before accessing configuration
2067
- if not self.__runtime_path_config:
2084
+ # Ensure the application configuration has been initialized
2085
+ if not self.__configured:
2068
2086
  raise OrionisRuntimeError(
2069
- "Application configuration is not initialized. Please call create() before accessing path configuration."
2087
+ "Application configuration is not initialized. Please call create() before accessing configuration."
2070
2088
  )
2071
2089
 
2072
2090
  # If no key is provided, return all paths as a dictionary of Path objects
2073
2091
  if key is None:
2074
2092
  path_resolved: Dict[str, Path] = {}
2093
+ # Convert all path values to Path objects
2075
2094
  for k, v in self.__runtime_path_config.items():
2076
- # Convert each path string to a Path object
2077
- path_resolved[k] = Path(v)
2095
+ if not isinstance(v, Path):
2096
+ path_resolved[k] = Path(v)
2097
+ else:
2098
+ path_resolved[k] = v
2078
2099
  return path_resolved
2079
2100
 
2080
2101
  # Ensure the key is a string
@@ -2117,9 +2138,8 @@ class Application(Container, IApplication):
2117
2138
  1. Load and process all configuration from configurators
2118
2139
  2. Register core framework service providers
2119
2140
  3. Register and boot all service providers
2120
- 4. Initialize framework kernels (Testing, CLI)
2121
- 5. Log successful startup with timing information
2122
- 6. Mark application as booted to prevent re-initialization
2141
+ 4. Initialize framework kernels
2142
+ 5. Mark application as booted to prevent re-initialization
2123
2143
 
2124
2144
  This method is idempotent - calling it multiple times will not cause
2125
2145
  duplicate initialization. The startup time is calculated and logged
@@ -2139,6 +2159,7 @@ class Application(Container, IApplication):
2139
2159
 
2140
2160
  # Load configuration if not already set
2141
2161
  self.__loadConfig()
2162
+ self.__configured = True
2142
2163
 
2143
2164
  # Load framework providers and register them
2144
2165
  self.__loadFrameworkProviders()
@@ -2151,15 +2172,6 @@ class Application(Container, IApplication):
2151
2172
  # Load core framework kernels with app booted
2152
2173
  self.__loadFrameworksKernel()
2153
2174
 
2154
- # Retrieve logger and console instances from the container
2155
- logger: ILogger = self.make(ILogger)
2156
-
2157
- # Calculate elapsed time in milliseconds since application start
2158
- elapsed_ms = (time.time_ns() - self.startAt) // 1_000_000
2159
-
2160
- # Log message to the logger
2161
- logger.info(f"Orionis Framework has been successfully booted. Startup time: {elapsed_ms} ms. Started at: {self.startAt} ns")
2162
-
2163
2175
  # Return the application instance for method chaining
2164
2176
  return self
2165
2177
 
@@ -2198,4 +2210,41 @@ class Application(Container, IApplication):
2198
2210
  )
2199
2211
 
2200
2212
  # Return True if the environment is 'production', otherwise False
2201
- return str(app_env).lower() == 'production'
2213
+ return str(app_env).lower() == 'production'
2214
+
2215
+ def isDebug(
2216
+ self
2217
+ ) -> bool:
2218
+ """
2219
+ Check if the application is running in debug mode.
2220
+
2221
+ This method determines whether the current application is set to run in debug mode.
2222
+ It checks the 'app.debug' configuration value to make this determination.
2223
+
2224
+ Returns
2225
+ -------
2226
+ bool
2227
+ True if the application is in debug mode, False otherwise.
2228
+
2229
+ Raises
2230
+ ------
2231
+ OrionisRuntimeError
2232
+ If the application configuration has not been initialized (i.e., if `create()` has not been called).
2233
+
2234
+ Notes
2235
+ -----
2236
+ The debug mode is typically defined in the application configuration and can be enabled or disabled based on the environment or specific settings.
2237
+ This method is useful for conditionally executing code based on whether debugging features should be active, such as detailed error reporting or verbose logging.
2238
+ """
2239
+
2240
+ # Retrieve the current debug setting from configuration
2241
+ app_debug = self.config('app.debug')
2242
+
2243
+ # Ensure the application is booted before accessing configuration
2244
+ if app_debug is None:
2245
+ raise OrionisRuntimeError(
2246
+ "Application configuration is not initialized. Please call create() before checking the debug mode."
2247
+ )
2248
+
2249
+ # Return True if the debug mode is enabled, otherwise False
2250
+ return bool(app_debug)
@@ -1133,46 +1133,60 @@ class IApplication(IContainer):
1133
1133
  @abstractmethod
1134
1134
  def config(
1135
1135
  self,
1136
- key: str = None
1136
+ key: str = None,
1137
+ value: Any = None
1137
1138
  ) -> Any:
1138
1139
  """
1139
- Retrieve application configuration values using dot notation.
1140
+ Retrieve or set application configuration values using dot notation.
1140
1141
 
1141
- This method provides access to the application's configuration settings,
1142
- supporting retrieval of nested values using dot notation (e.g., "database.default").
1143
- If a key is provided, the method returns the corresponding configuration value.
1144
- If no key is provided, it returns the entire configuration dictionary, excluding
1145
- path-related configuration (which should be accessed via the `path()` method).
1142
+ If only `key` is provided, returns the configuration value for that key.
1143
+ If both `key` and `value` are provided, sets the configuration value.
1144
+ If neither is provided, returns the entire configuration dictionary (excluding 'path').
1146
1145
 
1147
1146
  Parameters
1148
1147
  ----------
1149
1148
  key : str, optional
1150
- The configuration key to retrieve, supporting dot notation for nested
1151
- values (e.g., "database.default", "app.name"). If None, the method returns
1152
- the entire configuration dictionary except for the 'path' configuration.
1153
- Default is None.
1149
+ Dot-notated configuration key (e.g., "database.default"). If None, returns all config.
1150
+ value : Any, optional
1151
+ Value to set for the given key. If None, performs a get operation.
1154
1152
 
1155
1153
  Returns
1156
1154
  -------
1157
1155
  Any
1158
- If `key` is provided and found, returns the corresponding configuration value.
1159
- If `key` is None, returns the entire configuration dictionary (excluding 'path').
1160
- If the key is not found, returns None.
1156
+ The configuration value, or None if not found.
1161
1157
 
1162
1158
  Raises
1163
1159
  ------
1164
1160
  OrionisRuntimeError
1165
- If the application configuration has not been initialized (i.e., if `create()`
1166
- has not been called before accessing configuration).
1161
+ If configuration is not initialized.
1167
1162
  OrionisValueError
1168
- If the provided `key` parameter is not a string type.
1163
+ If key is not a string.
1164
+ """
1165
+ pass
1166
+
1167
+ @abstractmethod
1168
+ def resetConfig(
1169
+ self
1170
+ ) -> 'IApplication':
1171
+ """
1172
+ Reset the application configuration to an uninitialized state.
1173
+
1174
+ This method clears the current runtime configuration and marks the application
1175
+ as unconfigured, allowing for re-initialization of the configuration by calling
1176
+ `create()` again. This is useful in scenarios such as testing or when dynamic
1177
+ reloading of configuration is required.
1169
1178
 
1170
1179
  Notes
1171
1180
  -----
1172
- The method traverses nested configuration structures by splitting the key
1173
- on dots and navigating through dictionary levels. Path configurations are
1174
- excluded from full configuration returns and should be accessed via the
1175
- `path()` method instead.
1181
+ - After calling this method, you must call `create()` to reinitialize
1182
+ the configuration before accessing it again.
1183
+ - This method does not affect other aspects of the application state,
1184
+ such as registered providers or boot status.
1185
+
1186
+ Returns
1187
+ -------
1188
+ Application
1189
+ Returns the current `Application` instance to enable method chaining.
1176
1190
  """
1177
1191
  pass
1178
1192
 
@@ -1184,7 +1198,7 @@ class IApplication(IContainer):
1184
1198
  """
1185
1199
  Retrieve application path configuration values using dot notation.
1186
1200
 
1187
- Provides access to the application's path configuration, allowing retrieval of either a specific path value or the entire paths configuration dictionary. If a key is provided, the corresponding path is returned as a `Path` object. If no key is provided, a dictionary mapping all path configuration keys to their resolved `Path` objects is returned.
1201
+ This method provides access to the application's path configuration, allowing retrieval of either a specific path value or the entire paths configuration dictionary. If a key is provided, the corresponding path is returned as a `Path` object. If no key is provided, a dictionary mapping all path configuration keys to their resolved `Path` objects is returned.
1188
1202
 
1189
1203
  Parameters
1190
1204
  ----------
@@ -1196,7 +1210,7 @@ class IApplication(IContainer):
1196
1210
  -------
1197
1211
  Path or dict
1198
1212
  If `key` is provided and found, returns the resolved `Path` object for that key.
1199
- If `key` is None, returns a dictionary mapping all path keys to their `Path` objects.
1213
+ If `key` is None, returns a dictionary mapping all path keys to their resolved `Path` objects.
1200
1214
  If `key` is not found, returns None.
1201
1215
 
1202
1216
  Raises
@@ -1237,9 +1251,8 @@ class IApplication(IContainer):
1237
1251
  1. Load and process all configuration from configurators
1238
1252
  2. Register core framework service providers
1239
1253
  3. Register and boot all service providers
1240
- 4. Initialize framework kernels (Testing, CLI)
1241
- 5. Log successful startup with timing information
1242
- 6. Mark application as booted to prevent re-initialization
1254
+ 4. Initialize framework kernels
1255
+ 5. Mark application as booted to prevent re-initialization
1243
1256
 
1244
1257
  This method is idempotent - calling it multiple times will not cause
1245
1258
  duplicate initialization. The startup time is calculated and logged
@@ -1272,4 +1285,31 @@ class IApplication(IContainer):
1272
1285
  The environment is typically defined in the application configuration and can be set to values such as 'development', 'testing', or 'production'.
1273
1286
  This method is useful for conditionally executing code based on the environment, such as enabling/disabling debug features or logging verbosity.
1274
1287
  """
1288
+ pass
1289
+
1290
+ @abstractmethod
1291
+ def isDebug(
1292
+ self
1293
+ ) -> bool:
1294
+ """
1295
+ Check if the application is running in debug mode.
1296
+
1297
+ This method determines whether the current application is set to run in debug mode.
1298
+ It checks the 'app.debug' configuration value to make this determination.
1299
+
1300
+ Returns
1301
+ -------
1302
+ bool
1303
+ True if the application is in debug mode, False otherwise.
1304
+
1305
+ Raises
1306
+ ------
1307
+ OrionisRuntimeError
1308
+ If the application configuration has not been initialized (i.e., if `create()` has not been called).
1309
+
1310
+ Notes
1311
+ -----
1312
+ The debug mode is typically defined in the application configuration and can be enabled or disabled based on the environment or specific settings.
1313
+ This method is useful for conditionally executing code based on whether debugging features should be active, such as detailed error reporting or verbose logging.
1314
+ """
1275
1315
  pass
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.633.0"
8
+ VERSION = "0.635.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.633.0
3
+ Version: 0.635.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -103,7 +103,7 @@ orionis/failure/contracts/handler.py,sha256=AeJfkJfD3hTkOIYAtADq6GnQfq-qWgDfUc7b
103
103
  orionis/failure/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
104
  orionis/failure/entities/throwable.py,sha256=1zD-awcuAyEtlR-L7V7ZIfPSF4GpXkf-neL5sXul7dc,1240
105
105
  orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
- orionis/foundation/application.py,sha256=oKhREI_LCOMBLdcPpfyBoAmYUolgO3aTVJ7umZ8xH4g,90693
106
+ orionis/foundation/application.py,sha256=3wmAQDbgG80zetsPZEnjKUKC9526X_zAyza-3ztHpJ8,91678
107
107
  orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  orionis/foundation/config/startup.py,sha256=btqvryeIf9lLNQ9fBff7bJMrfraEY8qrWi4y_5YAR0Q,9681
109
109
  orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -197,7 +197,7 @@ orionis/foundation/config/testing/enums/drivers.py,sha256=mwv47FcKDXEOxydQXAGtkd
197
197
  orionis/foundation/config/testing/enums/mode.py,sha256=IbFpauu7J-iSAfmC8jDbmTEYl8eZr-AexL-lyOh8_74,337
198
198
  orionis/foundation/config/testing/enums/verbosity.py,sha256=Z-FQ6C3rxbRwP8HoVibbgRMGcsen2SwTuEy3wnjdIhc,486
199
199
  orionis/foundation/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
200
- orionis/foundation/contracts/application.py,sha256=rtvnjAHbPh3fBb7seZWiAc9zF2pxg3w36Q33_keAOcg,46832
200
+ orionis/foundation/contracts/application.py,sha256=CalEKcEKDWB6zawr0XQrNVL7ap768IpfdhE7CVY3Kjg,47884
201
201
  orionis/foundation/exceptions/__init__.py,sha256=ufomZK6am2-QAaj9peXW549xy_qflcbwj0ECuZz-1Kc,263
202
202
  orionis/foundation/exceptions/application.py,sha256=jeNToFG7msej2Ow6A7Zqj7cNLoI4NVpN2b5fdbhOiCI,1638
203
203
  orionis/foundation/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -216,7 +216,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
216
216
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
217
217
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
218
218
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
- orionis/metadata/framework.py,sha256=VxFpHj_VSSMXTFRCA4lpQyLruUXSmYA8AP6dflE5Ad8,4089
219
+ orionis/metadata/framework.py,sha256=KOtw1BH_m9cgO6c7vrxSR24_M0pZ3LlS0LAgOhpSVIY,4089
220
220
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
221
221
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
222
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -403,8 +403,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
403
403
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
404
404
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
405
405
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
406
- orionis-0.633.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
- orionis-0.633.0.dist-info/METADATA,sha256=rhPCFP5JWSyLZfrwv-PpSAvYg-H16Sn6h6ifnMLq_i4,4772
408
- orionis-0.633.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
- orionis-0.633.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
- orionis-0.633.0.dist-info/RECORD,,
406
+ orionis-0.635.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
+ orionis-0.635.0.dist-info/METADATA,sha256=K3DnJRtRPUGs6E5EUQIcwcfxO8lNx8y5J78fjm_I9BE,4772
408
+ orionis-0.635.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
+ orionis-0.635.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
+ orionis-0.635.0.dist-info/RECORD,,