ReverseDomainHierarchySorting
class ReverseDomainHierarchySorting (View source)
Class ReverseDomainHierarchySorting
Provides hierarchical sorting for reverse DNS zones based on network structure. This class creates a sorting order that organizes reverse zones by their network hierarchy, grouping all zones related to the same network together and sorting them logically.
Methods
Get hierarchy-based sort order SQL clause for reverse DNS zones.
PHP-based hierarchical sorting for reverse DNS zones.
Details
string
getHierarchicalSortOrder(string $field, string $dbType, string $direction = 'ASC')
Get hierarchy-based sort order SQL clause for reverse DNS zones.
Sorts domains by extracting and comparing their components in hierarchical order, grouping zones by primary networks (e.g., 10.in-addr.arpa, 172.in-addr.arpa, 192.168.in-addr.arpa) and then sorting by subnet specificity within each network.
array
sortDomainsHierarchically(array $domains)
PHP-based hierarchical sorting for reverse DNS zones.
Use this method when database sorting is not available.