Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: DSN support #28

Open
2 tasks done
yani opened this issue May 27, 2023 · 1 comment · May be fixed by #32
Open
2 tasks done

🚀 Feature: DSN support #28

yani opened this issue May 27, 2023 · 1 comment · May be fixed by #32
Assignees

Comments

@yani
Copy link

yani commented May 27, 2023

🔖 Feature description

Implement DSN connection strings.

Examples:

unix:///var/run/clamav/clamd.ctl
tcp://localhost:3310

And here's an example of how it could look.

$clam = new Connection('tcp://localhost:3310');  // returns -> new Network('localhost', 3310)
$version = $clam->version();

🎤 Pitch

I would like to use a single environment variable that would include the type of connection and the connection details. I'd like to give users or administrators the option to use the Network class or Pipe class with a single string.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@joeyouss
Copy link

Thanks for opening - keeping this open for now for gathering any feedback/comments from community

@joeyouss joeyouss self-assigned this May 31, 2023
SoftCreatR added a commit to SoftCreatR/php-clamav that referenced this issue Oct 10, 2023
This PR introduces support for DSN connection strings to simplify the configuration process. Users can now use a single string to determine the type of connection (`Network` or `Pipe`) and its details.

This PR resolves appwrite#28, closes appwrite#25, resolves appwrite#26, closes appwrite#27, closes appwrite#31

### Changes:

1. Added a static `createFromDSN` method to the `ClamAV` abstract class. This method parses the provided DSN string and returns an appropriate instance (`Network` or `Pipe`).
2. Updated the `ClamAVTest` unit test to cover the new DSN creation functionality.
3. Updated composer dependencies
4. Applied smaller code, and documentation optimizations
5. Updated README

### Usage:

Users can now initialize a connection using a DSN string:

```php
$clam = ClamAV::createFromDSN('tcp://localhost:3310');
$version = $clam->version();
```

This approach provides a more flexible and user-friendly way to set up a connection.

### Testing:

The existing unit tests have been updated accordingly.
@SoftCreatR SoftCreatR linked a pull request Oct 10, 2023 that will close this issue
SoftCreatR added a commit to SoftCreatR/php-clamav that referenced this issue Oct 10, 2023
This PR introduces support for DSN connection strings to simplify the configuration process. Users can now use a single string to determine the type of connection (`Network` or `Pipe`) and its details.

This PR resolves appwrite#28, closes appwrite#25, resolves appwrite#26, closes appwrite#27, closes appwrite#31

1. Added a static `createFromDSN` method to the `ClamAV` abstract class. This method parses the provided DSN string and returns an appropriate instance (`Network` or `Pipe`).
2. Updated the `ClamAVTest` unit test to cover the new DSN creation functionality.
3. Updated composer dependencies
4. Applied smaller code, and documentation optimizations
5. Improved code coverage
6. Updated README

Users can now initialize a connection using a DSN string:

```php
$clam = ClamAV::createFromDSN('tcp://localhost:3310');
$version = $clam->version();
```

This approach provides a more flexible and user-friendly way to set up a connection.

The existing unit tests have been updated accordingly.
SoftCreatR added a commit to SoftCreatR/php-clamav that referenced this issue Oct 10, 2023
This PR introduces support for DSN connection strings to simplify the configuration process. Users can now use a single string to determine the type of connection (`Network` or `Pipe`) and its details.

This PR resolves appwrite#28, closes appwrite#25, resolves appwrite#26, closes appwrite#27, closes appwrite#31

1. Added a static `createFromDSN` method to the `ClamAV` abstract class. This method parses the provided DSN string and returns an appropriate instance (`Network` or `Pipe`).
2. Updated the `ClamAVTest` unit test to cover the new DSN creation functionality.
3. Updated composer dependencies
4. Applied smaller code, and documentation optimizations
5. Improved code coverage
6. Updated README

Users can now initialize a connection using a DSN string:

```php
$clam = ClamAV::createFromDSN('tcp://localhost:3310');
$version = $clam->version();
```

This approach provides a more flexible and user-friendly way to set up a connection.

The existing unit tests have been updated accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants