Read optimization for ConfigFile class when only single item needed

Version 1.48.1

Feature
Finished

The readFile function in the ConfigFile class now has an extra option where the request can specify the index/name it wants. If this index is set, during the read, only the matching index will be added to the array, saving a huge amount of memory and sorting. Main area this will speed things up would be for "does this value exist in the file", such as checks for existing email accounts. Previously, it would read the whole file, sort it, then do a binary search to find the index, to determine if it exists. This will now return an array with 1 value, making the sorting and binary search instant.

Try DirectAdmin with a 30-day money back guarantee!