{"id":15018596,"url":"https://github.com/siegel2k16/tnsparser","last_synced_at":"2025-07-01T13:32:33.996Z","repository":{"id":57056668,"uuid":"135885558","full_name":"SieGeL2k16/TNSParser","owner":"SieGeL2k16","description":"Class parses tnsnames.ora file from Oracle databases","archived":false,"fork":false,"pushed_at":"2018-06-17T10:51:22.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T15:17:32.933Z","etag":null,"topics":["oracle-database","php-library","tns-parser","tnsnames"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SieGeL2k16.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-03T08:09:37.000Z","updated_at":"2022-11-15T07:00:09.000Z","dependencies_parsed_at":"2022-08-24T14:00:36.195Z","dependency_job_id":null,"html_url":"https://github.com/SieGeL2k16/TNSParser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SieGeL2k16%2FTNSParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SieGeL2k16%2FTNSParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SieGeL2k16%2FTNSParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SieGeL2k16%2FTNSParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SieGeL2k16","download_url":"https://codeload.github.com/SieGeL2k16/TNSParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500464,"owners_count":20948881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oracle-database","php-library","tns-parser","tnsnames"],"created_at":"2024-09-24T19:52:09.879Z","updated_at":"2025-04-06T15:17:37.179Z","avatar_url":"https://github.com/SieGeL2k16.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README for tnsparser.class\n\n##### Last updated on 02-Jun-2016\n\n## Introduction\n\nThis class was build to easily parse the Oracle TNS files, mainly for my\nOIS2 application to have some kind of automatic detection of TNS names in\nplace. It is licensed under the BSD, so do what you want with it, but please\nkeep the copyright notice intact, thank you!\n\nThe class takes an tnsnames.ora file, parses it down to all components and\nreturns an associative array with all parsed data, indexed by the TNS name.\n\nAs many components inside a TNS name could be specified multiple times,\nthe returned array values are in fact arrays, too. Here's an example how\nan resulting array may look like:\n\n    Array\n    (\n        [ORADEV] =\u003e Array\n            (\n                [PROTOCOL] =\u003e Array\n                    (\n                        [0] =\u003e TCP\n                    )\n    \n                [HOST] =\u003e Array\n                    (\n                        [0] =\u003e 192.168.255.2\n                    )\n    \n                [PORT] =\u003e Array\n                    (\n                        [0] =\u003e 1521\n                    )\n    \n                [SERVER] =\u003e Array\n                    (\n                        [0] =\u003e DEDICATED\n                    )\n    \n                [SERVICE_NAME] =\u003e Array\n                    (\n                        [0] =\u003e ORADEV.LOCAL\n                    )\n            )\n    )\n\nThis is the parsing result of the following original TNS entry:\n\n    ORADEV =\n      (DESCRIPTION =\n        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.255.2)(PORT = 1521))\n        (CONNECT_DATA =\n          (SERVER = DEDICATED)\n          (SERVICE_NAME = ORADEV.LOCAL)\n        )\n      )\n\nThe distribution provides an example taken from Oracle docs with multiple\nhost specifications, so you can see exactly how this all works.\n\n## Usage\n\nUsage is rather simple, create a new instance from the class and call\nthe public method \"ParseTNS()\" with the path to your oracle tnsnames.ora\nfile, i.e.:\n\n    $TNS = new TNSParser;\n    $rc = $TNS-\u003eParseTNS('/opt/oracle/product/11.2/network/admin/tnsnames.ora');\n    print_r($rc);\n\nIn case of an error the method throws an exception, so you should use a\ntry/catch block to react on errors.\n\n\n## Final words\n\nI've successfully tested this class with a number of different and rather\ncomplex TNSnames files, however no software is really bugfree, so if you\nfind a bug or have an idea how to improve this class, either do it on your\nown or feel free to contact me on my homepage, which could be found under\nthe following URL:\n\nhttp://www.saschapfalz.de\n\nNothing more to say, I doubt that anyone really reads this file until\nthe end, so keep up coding :D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiegel2k16%2Ftnsparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiegel2k16%2Ftnsparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiegel2k16%2Ftnsparser/lists"}