oracle / oci-php-sdk

Other
10 stars 7 forks source link

Quick code review / suggestions #10

Closed hitrov closed 1 year ago

hitrov commented 1 year ago

hi, as a developer of a package that became quite popular recently with almost 200k downloads on Packagist: https://packagist.org/packages/hitrov/oci-api-php-request-sign

used mostly in this repository, which has 400+ stars: https://github.com/hitrov/oci-arm-host-capacity

hope I can get your attention to some parts :)

Additionally, it is unclear to me what it is intended to do beyond file uploads (examples are missing). For example, using my package I can create/list instances, browse namespaces etc. If I were a PHP developer with a need to use OCI Object Storage for business purposes, I would prefer to use the AWS PHP package with S3 compatible API.

Thanks for your attention!

KartikShrikantHegde commented 1 year ago

Hi @hitrov , Thanks for raising an issue. Please see my answers below:

Those classes/interfaces are designed to support future auth types. Those auth types are not currently in PHP SDK. Right now, the auth we’re currently supporting is Instance Principal and we will add more in the future.

These classes are auto-generated and not meant to be edited/reviewed manually. They contain all the APIs Object Storage service supports. It will likely grow in the future as we start supporting them and other services.

Sure, We will consider removing those to make the code look tidy.

The region is hard-coded in the PHP SDK. We’ll add the feature to read the region information from a JSON file – this feature exists in other OCI SDKs today.

We will look into this, right now we are not sure what is causing the issue, we’ve attached a version tag (0.1.0) and should be able to retrieve the correct tag through composer.

We have test coverage internally and will continue adding more to cover the code. We’ll publish those test files here in the near future.

We will be fixing this link pretty soon.

Thanks for the inputs, we’ll try fixing those and use a more standard way.

Yes, agree, and we’ll make improvements to our error handling.

Overall, thanks for looking into our new release and providing valuable feedback. We had customers request native support for Object Storage service in PHP SDK vs AWS S3 compatible API. Thus, we’re currently only supporting the object storage service and will likely be adding more OCI services as and when there is a need and our roadmap evolves. This is still an early stage oci-php-sdk and feedback is highly valued, and we’ll keep making improvements on this project.

hitrov commented 1 year ago

Hello @KartikShrikantHegde ,

Thank you for providing your responses!

To clarify my previous question, I was referring to the practice of having a single class or interface declaration in a file, which is a commonly accepted approach.