Releases: graze/telnet-client
Max bytes read
Optionally configure a maximum number of bytes to read after which an exception is thrown. This is to prevent an infinite loop if the prompt is never matched.
Read timeout
Add socket read timeout
PHP 7.3 and 7.4 support
Adds support for PHP 7.3 and 7.4.
Technically, no code changes. This is just the first version that is formally being tested under these versions of PHP.
Other minor changes:
- Non-functional cleanup of code and README.
- Use official
composer
docker image rather thangraze/composer
. - Updated dependencies in lock file.
Add support for null line endings
Some telnet implementations do not end sends with a consistent line ending. Add support for those implementations by removing the line ending check when line ending is null.
Prompt matching will be more expensive in these instances as each character received will be checked against the prompt regex.
This adds support for implementations such as #15.
Add timeout to socket
Add the ability to set a timeout when connecting.
Fix TelnetClientInterface::execute definition
Update TelnetClientInterface::execute()
interface to match the concrete class.
Add PromptMatcher interface
Add PromptMatcherInterface to allow the implementation of custom prompt matcher, this allows for more complicated matchers rather than a simple string match.
Don't connect on __construct
Don't connect on __construct
but provide a connect
method. This allows the client to be injected as a dependency without requiring the dsn to be known ahead of time.
As arguments are now split between the __construct
and connect
methods, we no longer require a separate builder
, which has been replaced with the more simple factory
method on the client.
// previous usage
class MyClass
{
public function __construct(TelnetClient $client)
{
...
}
public function doSomething()
{
// do something with client that is already connected to $dsn ($dsn required ahead of time of use)
...
}
}
// new usage
class MyClass
{
public function __construct(TelnetClient $client)
{
...
}
public function doSomething($dsn)
{
// connect to dsn of choice
$this->client->connect($dsn);
// do something with client
...
}
}
Initial release
Merge pull request #1 from graze/initialCommit Initial commit for review before tagging for release