Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgober committed Dec 5, 2024
1 parent f0e993d commit 82b358b
Show file tree
Hide file tree
Showing 40 changed files with 1,156 additions and 469 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,40 @@ This file tracks all notable changes made to the project, including new features
-->


 

<!--
#
----------------------------- -->
## [1.0.0-RC.5] - 2024-12-05

### Added
- **Custom Parser Support**: Introduced the ability to dynamically register and utilize custom parsers, enhancing extensibility.
- **Non-UTF-8 Handling**: Added improved handling for files with non-UTF-8 encodings, ensuring compatibility across varied environments.
- **Performance Tests**: Included benchmarks and stress tests to validate library performance under high-load scenarios.
- **Extended Cache Operations**: Enhanced cache handling with robust invalidation and expiration logic.
- **Enhanced Flattening Control**: Improved options for enabling/disabling key flattening, offering better flexibility for hierarchical configurations.

### Changed
- **Default Flattening Behavior**: Updated the `Config` constructor to accept an explicit flag for flattening, providing better control and eliminating unexpected defaults.
- **Parsing Enhancements**:
- Optimized performance for **CONF parsing** by leveraging `file()` for efficient line-by-line processing while preserving spacing and comments.
- Improved regex-based parsing to handle edge cases with clean and flexible key-value extraction.
- Enhanced exception messages to offer more descriptive debugging feedback.
- **Error Handling**: Unified error handling across parsers to provide more informative and actionable exceptions.
- **Streamlining Tests**:
- Refactored `ConfigTest` for clarity, expanded coverage, and consistent structure.
- Reworked performance test cases to accurately benchmark operations under diverse conditions.

### Fixed
- **Custom Parser Registration**: Resolved issues where dynamically registered custom parsers were not recognized during runtime.
- **UTF-8 Validation**: Addressed conflicts where systems forced UTF-8 encoding, bypassing intended checks for invalid encoding.
- **Max Depth Exceeded**: Fixed edge cases in nested configurations exceeding max depth, ensuring the error is thrown correctly.
- **Cache Structure Validation**: Resolved potential inconsistencies in cache format validation and loading.

### Removed
- **Test Parsers from Production**: Completely removed test parsers from production code to maintain separation of concerns and a cleaner production environment.


&nbsp;

Expand Down Expand Up @@ -130,6 +164,8 @@ This file tracks all notable changes made to the project, including new features
<!--
# PRE-RELEASE
----------------------------- -->

[1.0.0-RC.5]: https://github.com/jamesgober/Config/compare/v1.0.0-RC.4...v1.0.0-RC.5
[1.0.0-RC.4]: https://github.com/jamesgober/Config/compare/v1.0.0-RC3...v1.0.0-RC.4
[1.0.0-RC.3]: https://github.com/jamesgober/Config/compare/v1.0.0-RC.2...v1.0.0-RC3
[1.0.0-RC.2]: https://github.com/jamesgober/Config/compare/v1.0.0-Rc.1...v1.0.0-RC.2
Expand Down
716 changes: 567 additions & 149 deletions docs/php/classes/JG-Config-Config.html

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions docs/php/classes/JG-Config-ConfigParserFactory.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,18 @@ <h2 class="phpdocumentor-content__title">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/ConfigParserFactory.php"><a href="files/src-configparserfactory.html"><abbr title="src/ConfigParserFactory.php">ConfigParserFactory.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">37</span>
<span class="phpdocumentor-element-found-in__line">41</span>

<a href="classes/JG-Config-ConfigParserFactory.html#source-view.37" class="phpdocumentor-element-found-in__source" data-line="37" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
<a href="classes/JG-Config-ConfigParserFactory.html#source-view.41" class="phpdocumentor-element-found-in__source" data-line="41" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">ConfigParserFactory</p>


<section class="phpdocumentor-description"><p>Factory class for creating and managing configuration parsers. Supports default parsers
for common file formats such as JSON, PHP, and XML, and allows custom parsers to be registered.</p>
<section class="phpdocumentor-description"><p>Factory class for creating and managing configuration parsers.
Supports default parsers for common file formats such as conf,
ini, json, PHP, xml, yaml/yml, and allows custom parsers to be
registered.</p>
</section>


Expand Down Expand Up @@ -243,9 +245,9 @@ <h4 class="phpdocumentor-element__name" id="property_configParsers">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/ConfigParserFactory.php"><a href="files/src-configparserfactory.html"><abbr title="src/ConfigParserFactory.php">ConfigParserFactory.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">44</span>
<span class="phpdocumentor-element-found-in__line">48</span>

<a href="classes/JG-Config-ConfigParserFactory.html#source-view.44" class="phpdocumentor-element-found-in__source" data-line="44" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
<a href="classes/JG-Config-ConfigParserFactory.html#source-view.48" class="phpdocumentor-element-found-in__source" data-line="48" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Default mapping of file extensions to parser class names.</p>
Expand Down Expand Up @@ -286,9 +288,9 @@ <h4 class="phpdocumentor-element__name" id="method_createParser">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/ConfigParserFactory.php"><a href="files/src-configparserfactory.html"><abbr title="src/ConfigParserFactory.php">ConfigParserFactory.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">61</span>
<span class="phpdocumentor-element-found-in__line">65</span>

<a href="classes/JG-Config-ConfigParserFactory.html#source-view.61" class="phpdocumentor-element-found-in__source" data-line="61" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
<a href="classes/JG-Config-ConfigParserFactory.html#source-view.65" class="phpdocumentor-element-found-in__source" data-line="65" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Creates a parser instance based on the file&#039;s extension.</p>
Expand Down Expand Up @@ -359,9 +361,9 @@ <h4 class="phpdocumentor-element__name" id="method_getParsers">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/ConfigParserFactory.php"><a href="files/src-configparserfactory.html"><abbr title="src/ConfigParserFactory.php">ConfigParserFactory.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">122</span>
<span class="phpdocumentor-element-found-in__line">139</span>

<a href="classes/JG-Config-ConfigParserFactory.html#source-view.122" class="phpdocumentor-element-found-in__source" data-line="122" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
<a href="classes/JG-Config-ConfigParserFactory.html#source-view.139" class="phpdocumentor-element-found-in__source" data-line="139" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Retrieves the list of all registered parsers.</p>
Expand Down Expand Up @@ -403,9 +405,9 @@ <h4 class="phpdocumentor-element__name" id="method_loadParsers">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/ConfigParserFactory.php"><a href="files/src-configparserfactory.html"><abbr title="src/ConfigParserFactory.php">ConfigParserFactory.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">110</span>
<span class="phpdocumentor-element-found-in__line">127</span>

<a href="classes/JG-Config-ConfigParserFactory.html#source-view.110" class="phpdocumentor-element-found-in__source" data-line="110" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
<a href="classes/JG-Config-ConfigParserFactory.html#source-view.127" class="phpdocumentor-element-found-in__source" data-line="127" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Bulk registers parsers from an associative array.</p>
Expand Down Expand Up @@ -468,9 +470,9 @@ <h4 class="phpdocumentor-element__name" id="method_registerParser">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/ConfigParserFactory.php"><a href="files/src-configparserfactory.html"><abbr title="src/ConfigParserFactory.php">ConfigParserFactory.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">88</span>
<span class="phpdocumentor-element-found-in__line">92</span>

<a href="classes/JG-Config-ConfigParserFactory.html#source-view.88" class="phpdocumentor-element-found-in__source" data-line="88" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
<a href="classes/JG-Config-ConfigParserFactory.html#source-view.92" class="phpdocumentor-element-found-in__source" data-line="92" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Registers a custom parser, allowing users to extend or override default parsers.</p>
Expand Down Expand Up @@ -543,9 +545,9 @@ <h4 class="phpdocumentor-element__name" id="method_unregisterParser">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/ConfigParserFactory.php"><a href="files/src-configparserfactory.html"><abbr title="src/ConfigParserFactory.php">ConfigParserFactory.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">133</span>
<span class="phpdocumentor-element-found-in__line">150</span>

<a href="classes/JG-Config-ConfigParserFactory.html#source-view.133" class="phpdocumentor-element-found-in__source" data-line="133" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
<a href="classes/JG-Config-ConfigParserFactory.html#source-view.150" class="phpdocumentor-element-found-in__source" data-line="150" data-modal="source-view" data-src="files/src/ConfigParserFactory.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Unregisters a parser for a specific file extension.</p>
Expand Down
12 changes: 6 additions & 6 deletions docs/php/classes/JG-Config-Exceptions-ConfigException.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ <h2 class="phpdocumentor-content__title">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Exceptions/ConfigException.php"><a href="files/src-exceptions-configexception.html"><abbr title="src/Exceptions/ConfigException.php">ConfigException.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">33</span>
<span class="phpdocumentor-element-found-in__line">34</span>

<a href="classes/JG-Config-Exceptions-ConfigException.html#source-view.33" class="phpdocumentor-element-found-in__source" data-line="33" data-modal="source-view" data-src="files/src/Exceptions/ConfigException.php.txt"></a>
<a href="classes/JG-Config-Exceptions-ConfigException.html#source-view.34" class="phpdocumentor-element-found-in__source" data-line="34" data-modal="source-view" data-src="files/src/Exceptions/ConfigException.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">ConfigException</p>
Expand Down Expand Up @@ -213,9 +213,9 @@ <h4 class="phpdocumentor-element__name" id="method___construct">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Exceptions/ConfigException.php"><a href="files/src-exceptions-configexception.html"><abbr title="src/Exceptions/ConfigException.php">ConfigException.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">42</span>
<span class="phpdocumentor-element-found-in__line">43</span>

<a href="classes/JG-Config-Exceptions-ConfigException.html#source-view.42" class="phpdocumentor-element-found-in__source" data-line="42" data-modal="source-view" data-src="files/src/Exceptions/ConfigException.php.txt"></a>
<a href="classes/JG-Config-Exceptions-ConfigException.html#source-view.43" class="phpdocumentor-element-found-in__source" data-line="43" data-modal="source-view" data-src="files/src/Exceptions/ConfigException.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Constructs a new ConfigException instance.</p>
Expand Down Expand Up @@ -279,9 +279,9 @@ <h4 class="phpdocumentor-element__name" id="method___toString">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Exceptions/ConfigException.php"><a href="files/src-exceptions-configexception.html"><abbr title="src/Exceptions/ConfigException.php">ConfigException.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">52</span>
<span class="phpdocumentor-element-found-in__line">53</span>

<a href="classes/JG-Config-Exceptions-ConfigException.html#source-view.52" class="phpdocumentor-element-found-in__source" data-line="52" data-modal="source-view" data-src="files/src/Exceptions/ConfigException.php.txt"></a>
<a href="classes/JG-Config-Exceptions-ConfigException.html#source-view.53" class="phpdocumentor-element-found-in__source" data-line="53" data-modal="source-view" data-src="files/src/Exceptions/ConfigException.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Returns a string representation of the exception.</p>
Expand Down
12 changes: 6 additions & 6 deletions docs/php/classes/JG-Config-Exceptions-ConfigParseException.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ <h2 class="phpdocumentor-content__title">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Exceptions/ConfigParseException.php"><a href="files/src-exceptions-configparseexception.html"><abbr title="src/Exceptions/ConfigParseException.php">ConfigParseException.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">29</span>
<span class="phpdocumentor-element-found-in__line">30</span>

<a href="classes/JG-Config-Exceptions-ConfigParseException.html#source-view.29" class="phpdocumentor-element-found-in__source" data-line="29" data-modal="source-view" data-src="files/src/Exceptions/ConfigParseException.php.txt"></a>
<a href="classes/JG-Config-Exceptions-ConfigParseException.html#source-view.30" class="phpdocumentor-element-found-in__source" data-line="30" data-modal="source-view" data-src="files/src/Exceptions/ConfigParseException.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">ConfigParseException</p>
Expand Down Expand Up @@ -210,9 +210,9 @@ <h4 class="phpdocumentor-element__name" id="method___construct">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Exceptions/ConfigParseException.php"><a href="files/src-exceptions-configparseexception.html"><abbr title="src/Exceptions/ConfigParseException.php">ConfigParseException.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">38</span>
<span class="phpdocumentor-element-found-in__line">39</span>

<a href="classes/JG-Config-Exceptions-ConfigParseException.html#source-view.38" class="phpdocumentor-element-found-in__source" data-line="38" data-modal="source-view" data-src="files/src/Exceptions/ConfigParseException.php.txt"></a>
<a href="classes/JG-Config-Exceptions-ConfigParseException.html#source-view.39" class="phpdocumentor-element-found-in__source" data-line="39" data-modal="source-view" data-src="files/src/Exceptions/ConfigParseException.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Constructs a new ConfigParseException instance.</p>
Expand Down Expand Up @@ -276,9 +276,9 @@ <h4 class="phpdocumentor-element__name" id="method___toString">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Exceptions/ConfigParseException.php"><a href="files/src-exceptions-configparseexception.html"><abbr title="src/Exceptions/ConfigParseException.php">ConfigParseException.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">48</span>
<span class="phpdocumentor-element-found-in__line">49</span>

<a href="classes/JG-Config-Exceptions-ConfigParseException.html#source-view.48" class="phpdocumentor-element-found-in__source" data-line="48" data-modal="source-view" data-src="files/src/Exceptions/ConfigParseException.php.txt"></a>
<a href="classes/JG-Config-Exceptions-ConfigParseException.html#source-view.49" class="phpdocumentor-element-found-in__source" data-line="49" data-modal="source-view" data-src="files/src/Exceptions/ConfigParseException.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Provides a string representation of the exception.</p>
Expand Down
Loading

0 comments on commit 82b358b

Please sign in to comment.