Comments (1)
Hi @tloader11,
I've discussed this issue with our team, but we won't be adding such functionality to the package. There are probably more cases where the buildUrl
method doesn't suffice and adding exceptions isn't maintainable.
With that being said, it is possible to create your own connector class with the URL structure you'd like. Just pass it as argument to the Powerdns client constructor to use your own connector class instead of the provided one. The only requirement is that it implements the ConnectorInterface
.
To prevent writing all the logic in your own class, I've changed the private methods in the Connector class in the upcoming release to be protected. This way, your own Connector class can be pretty simple by only overwriting the buildUrl
method:
class CustomConnector extends Connector
{
protected function buildUrl(string $path): string
{
// Your own logic.
}
}
And use it like this:
$powerdns = new Powerdns();
$connector = new CustomConnector($powerdns);
// Because the connector needs the Powerdns client instance (because its based on the original connector), the new 'setConnector' method must be used:
$powerdns->setConnector($connector);
// If you don't extend the existing connector, you can pass your own implementation when constructing the client:
$powerdns = new Powerdns(null, null, null, null, new CustomConnector());
Of course, if you're using dependency injection you can use that to load the correct instance of the ConnectorInterface.
from powerdns-php.
Related Issues (20)
- Problem adding TXT record. HOT 2
- Can't add two Records with same name
- Compatibility with psr/log 3.0 HOT 2
- How to create additional records for the same subdomain
- How to delete one specific record
- cannot delete an MX record
- No SOA found for domain
- Accept zone name in `find`
- Delete metadata SOA-EDIT HOT 1
- listZones() parameter $omitDnssecAndEditedSerialFields is inverted
- Support all "Unknown" DNS Resource Record (RR) Types HOT 1
- Second (optional) argument of an Exception is its code, not debug variables HOT 1
- On another note: I don't think it's very friendly to have the syntax for the `Zone->create` method in mind (with the comments double array and stuff. If it's ok I would like to introduce the alternative of passing in the Objects (e.g. a ResourceRecord-Instance and an array of Comment-Instances). Let me know if that's something that would be approved
- SearchResult fails on zone and comment results HOT 1
- Bulk zone create HOT 1
- Question: `put` a full array of rrset changes to zone HOT 3
- Hardcoded PDNS port HOT 2
- More human readable output HOT 5
- cURL error 28: Failed to connect to xxx.xxxxx.xxx port 8081: Connection timed out HOT 1
- Manipulation of records for the zone HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerdns-php.