Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jessebyarugaba/Unofficial-Uganda-Securities-Exhange-API/llms.txt
Use this file to discover all available pages before exploring further.
About this changelog
This page tracks notable changes, updates, and improvements to the Uganda Securities Exchange API library. The library utilizes Simple HTML DOM Parser for web scraping functionality.This project follows semantic versioning principles and is based on Keep a Changelog format.
Current version
The Uganda Securities Exchange API library is built on top of Simple HTML DOM Parser. For the complete changelog of the underlying parser library, see the sections below.Core functionality
The library provides four main methods:- getAllPortfolioCompanies() - Retrieves all companies listed on the USE
- getCompanyDetails($companyName) - Fetches detailed information for a specific company
- getPortfolioCompanyData($companyName) - Gets historical price data for plotting and analysis
- getExchangeRateDetails() - Retrieves current UGX to USD exchange rate
The library requires PHP >= 5.6 and the ext-iconv extension.
Simple HTML DOM Parser changelog
The underlying HTML parsing functionality is provided by Simple HTML DOM Parser. Below are the major versions and their changes.Unreleased
View unreleased changes
View unreleased changes
Changed:
- Comments that start with
>or->are now considered malformed in accordance with section 12.1.6 of the HTML specification - Comments may still contain the strings
<!--or--!>and may still end with<!-contrary to the specification
Version 2.0-RC2 (2019-11-09)
View 2.0-RC2 changes
View 2.0-RC2 changes
Added:
- README and composer file support
- Travis CI integration for automated unit tests
- Magic method
__debugInfoto reduce memory footprint and prevent recursion errors - Magic method
__callas wrapper for deprecated lowercase methods - New Debug class for deprecated functions and parsing issues
- Full support for script element parsing
- Multiple new unit tests for attributes, callbacks, debug info, doctypes, scripts, styles, and DOM manipulation
- Improved garbage collection with better destructor implementation
- Enhanced handling of literal elements (script, style, cdata, comment, code)
- Renamed unit test files to match new class names
HtmlDocument::clear()- Useunset()insteadHtmlDocument::load_file()- UseHtmlDocument::loadFile()insteadHtmlNode::children()- UseHtmlNode::childNodes()insteadHtmlNode::first_child()- UseHtmlNode::firstChild()insteadHtmlNode::has_child()- UseHtmlNode::hasChild()insteadHtmlNode::last_child()- UseHtmlNode::lastChild()insteadHtmlNode::next_sibling()- UseHtmlNode::nextSibling()insteadHtmlNode::prev_sibling()- UseHtmlNode::previousSibling()instead- Smarty script support
- Server-side script support
- Boolean attributes incorrectly represented with value “1” when saving DOM
- Infinite loop bug with comments and CDATA containing script/style/code tags
- Whitespace removal in comments and CDATA with
$stripRN = true - Attribute value encoding in
outertext(),innertext(), andsave() - Charset encoding issues #178
- DOM manipulation bugs with
createElement(),createTextNode(), andappendChild()
Version 2.0-RC1 (2019-10-20)
View 2.0-RC1 changes
View 2.0-RC1 changes
Added:
- Comprehensive unit test suite
- Optional
$trimargument to$node->text() - Attribute value normalization per W3C standards
- Automatic HTML entity decoding when loading documents
- Negation pseudo-class support (
:not()) simple_html_dom::expect()andsimple_html_dom_node::expect()methods- CDATA section parsing
- HtmlWeb class for direct webpage loading via cURL or fopen
- New classes in simplehtmldom namespace: HtmlDocument, HtmlNode, HtmlWeb
- New element type
HDOM_TYPE_CDATA
- Increased
MAX_FILE_SIZEfrom 0.6 MB to 2.5 MiB - Enhanced
text()method to support all block/inline elements - Improved handling of
 characters - Moved classes to proper namespace structure
- Constants moved to separate file
- Fatal error when removing nodes from DOM (#172)
- UTF-8 character handling in
text()method - File size validation in
file_get_html - UTF-8 to UTF-8 conversion bug
- Optional closing tag handling
- Text node support in
find()method (#175)
Version 1.9 (2019-05-30)
View 1.9 changes
View 1.9 changes
Added:
- Unit tests for bugs #153, #163, #166, #169
- Character set support for UTF-8, CP1251, CP1252 (#142)
- Meta charset detection
- CP1251 detection using iconv
- MIT LICENSE file
- New HtmlNode methods:
remove()- Recursively remove node from DOMremoveChild()- Remove child nodehasClass()- Check for class nameaddClass()- Add classesremoveClass()- Remove classessave()- Save node to disk
- Documentation migrated to MkDocs
- Warning when clearing DOM on null nodes (#153)
- Missing whitespace in plaintext (#163)
- Duplicate attribute detection (#166)
- CP1252 (ISO-8859-1) detection (#142)
- Next-sibling combinator error on last child
- Selector parsing for attributes ending with “s” or “i” (#169)
Version 1.8 (2019-01-13)
View 1.8 changes
View 1.8 changes
Added:
- CSS combinator support:
- Child combinator (
>) - Next sibling combinator (
+) - Subsequent sibling combinator (
~)
- Child combinator (
- Multiclass selectors (
.class.class.class) - Multi-attribute selectors (
[attr1][attr2]) - Attribute selector enhancements:
- Pipe selector (
|=) - Tilde selector (
~=) - Case sensitivity (
iands)
- Pipe selector (
- PHP_CodeSniffer coding standards
- PHP 5.6+ compatibility tests
- Comprehensive CSS selector unit tests
- Configurable constants support
- Removed automatic ‘tbody’ filtering (#79)
- Applied PHP_CodeSniffer standards
- CSS selector attributes with value “0” (#62)
- Forward slashes in CSS selectors (#144)
- Universal selectors
load_filefunctionality
Version 1.7 (2018-12-10)
View 1.7 changes
View 1.7 changes
Added:
- Comprehensive code documentation
- Extensive unit test coverage
- Bit flags for
load()method:HDOM_SMARTY_AS_TEXT- Filter Smarty scripts (#154)
- Support for attributes without whitespace separation
- Automated build script for releases
- Updated self-closing tags list (added area, col, meta, param, source, track, wbr)
- Updated optional closing tags list (improved td/th/optgroup/option/rp/rt handling)
- Script tag removal before newline processing
- Improved performance (10-25% faster)
- Default
$offsetchanged from -1 to 0 (#161) - Normalized line endings to LF
str_get_html()- Usenew simple_html_dom()instead
- PHP 7.3 compatibility
- Incorrectly escaped text handling (#160)
$maxLenfunctionality infile_get_html()- Cross-script error interference
Earlier versions
Versions 1.6 and earlier
Versions 1.6 and earlier
Version 1.6 (2014-05-28):
- Node insertion and creation
- Noise array search capability
- LOCK_EX flag for file operations
- Character set detection
- Memory leak fixes
- Firebug-generated XPath support
- New dump method and xmltext attribute
- Pre tag and various bug fixes
- Negative indexes in find method
- Automatic content loading
- Full wildcard support
- getAllAttributes method
- JavaScript string support in selectors
- Case-insensitive *= selector
Usage notes
Recommended practices
-
Always clean up DOM objects:
-
Use camelCase methods instead of deprecated snake_case:
-
Implement error handling:
-
Monitor memory usage for large documents:
Migration notes
If you’re updating from an older version of Simple HTML DOM Parser:Review the deprecated methods list and update your code to use the new camelCase naming convention.
- Method names changed from snake_case to camelCase
- Some methods have been deprecated or removed
- Improved memory management requires proper cleanup
- Enhanced CSS selector support
- Better UTF-8 and character encoding handling
Future development
Potential enhancements for future versions:- Caching layer to reduce server requests
- Rate limiting for responsible web scraping
- WebSocket support for real-time data
- REST API wrapper
- Database integration examples
- Docker containerization
- Comprehensive test suite specific to USE data
Contributions and suggestions for improvements are welcome! See the Contributing guide to get involved.