sdk-for-php | Official Appwrite PHP SDK 🐘 | Backend As A Service library

Β by Β  appwrite PHP Version: 7.2.0 License: BSD-3-Clause

kandi X-RAY | sdk-for-php Summary

kandi X-RAY | sdk-for-php Summary

sdk-for-php is a PHP library typically used in Serverless, Backend As A Service applications. sdk-for-php has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              sdk-for-php has a low active ecosystem.
              It has 113 star(s) with 19 fork(s). There are 19 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 4 have been closed. On average issues are closed in 50 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of sdk-for-php is 7.2.0

            kandi-Quality Quality

              sdk-for-php has 0 bugs and 0 code smells.

            kandi-Security Security

              sdk-for-php has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              sdk-for-php code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sdk-for-php is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              sdk-for-php releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              sdk-for-php saves you 313 person hours of effort in developing the same functionality from scratch.
              It has 2555 lines of code, 146 functions and 13 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed sdk-for-php and discovered the below as its top functions. This is intended to give you an instant insight into sdk-for-php implemented functionality, and help decide if they suit your requirements.
            • Make a call to the API
            • Get file preview .
            • Create a new workflow
            • Update the recovery .
            • Create a membership .
            • List documents .
            • Get a Qr Avatar .
            • Update user status
            • List all queue certificates .
            • Get countries .
            Get all kandi verified functions for this library.

            sdk-for-php Key Features

            No Key Features are available at this moment for sdk-for-php.

            sdk-for-php Examples and Code Snippets

            No Code Snippets are available at this moment for sdk-for-php.

            Community Discussions

            QUESTION

            How to subscribe multiple phone numbers to a topic under Amazon SNS?
            Asked 2022-Mar-20 at 00:49

            Amazon provides the php example code below to subscribe a number to a topic. However, that only adds one number at a time.

            How can I add multiple numbers ($endpoint) to the same topic? What would the code need to be at the end?

            PHP Example Code:

            ...

            ANSWER

            Answered 2022-Mar-20 at 00:49

            The solution was actually pretty simple. I just needed to add a list of numbers (through an array) and create a foreach loop:

            Source https://stackoverflow.com/questions/71520031

            QUESTION

            How to Mock Aws\S3\S3Client for phpunit // how to mock magic methods
            Asked 2022-Mar-17 at 17:53

            I need to mock the S3Client in my symfony5 project to be able to provoke exceptions and test the reaction of my code to those exceptions. We use aws/aws-sdk-php version 3.*

            7 Years ago someone had the same problem and I tried to follow this solution [ PHPUnit - Mock S3Client not working well ] but I get errors.

            What I do at the moment:

            in my service:

            ...

            ANSWER

            Answered 2022-Mar-17 at 17:52

            As often it is easier to find a solution, when you know the name of your problem. I adapted the question title accordingly.

            Methods defined in the header of a class, which don't really exist are called "magic methods" and with that knowledge I found a solution to my problem:

            A comment under this link set me on the right track: https://carstenwindler.de/php/mocking-magic-methods-with-phpunit/

            In the current version of phpunit, which is 9.5, you can use addMethods and this syntax to mock magic methods:

            Source https://stackoverflow.com/questions/71497106

            QUESTION

            AWS EC2 Apache User Cannot run php exec
            Asked 2022-Jan-25 at 05:24

            I am using the following PHP script to send an email from my server. I need to send an email to the admin when a new record is created in the DB. So within the same php script that updates the DB, I want to trigger the other script that sends the email.

            Problem is no matter what I do, apache will not execute the email script when requested from the web/api.

            However, when I run php sendemail.php from the command line it works. Also when I run php updatedb.php which includes the exec('php sendemail.php') also works from the command line (these are all executed with root "ec2-user").

            Things I tried:

            1. I checked the disabled functions in php.ini and it is empty, nothing is disabled.
            2. I tried changing file permissions to include 'x' for the apache group still no go.
            3. I tried replacing exec with shell_exec, and include, no luck.

            Here is 'sendemail.php':

            ...

            ANSWER

            Answered 2022-Jan-25 at 05:24

            Thank you so much @Riz your tip about sudo -u apache php sendemail.php saved my day! I was able to debug on the command line and it turns out that my mistake was with the line require 'vendor/autoload.php'; in my original sendemail.php script I was requiring the file from a directory that did not belong to the apache group. So, once I moved the vendor folder to the same folder as the sendemail.php script file everything worked great!

            Lesson learned: Make sure all required/included files belong to the apache group. There was no need to grant apache any execution permissions on any file.

            Source https://stackoverflow.com/questions/70832893

            QUESTION

            Tracking AWS SES Event Metrics
            Asked 2021-Nov-15 at 21:57

            I'm trying to understand the best way to track SES event metrics for emails we're sending through SES. Currently, we're sending email campaigns using the API with SentTemplatedEmail(). The configuration set is currently not set up with any event publishing, which I know would be the first step.

            My goal is to gather statistics on each batch of emails sent out, like bounce rates, opens etc. Perhaps even identify which email addresses bounced or had errors. Ideally I'd like to gather this information in our own admin system and store this in our internal databases.

            I understand I can send the events to Cloudwatch or Kineses Data Firehose. If I were to do either one of these, how would I go about fetching/parsing the information out of these services in order to use it in our in-house apps? Don't understand which of the services above would be appropriate in this regard (if at all) and how to approach it from there.

            Any suggestions on how to architecture this, or where to read up on how to do this? I've seen posts on how to go into Cloudwatch and look at metrics from within the console, but can't find much on how to extract this data.

            UPDATE: I did find this: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples-getting-metrics.html which would allow me to gather statistics for a time period. Not quite what I wanted, as I'd like to track statistics per a bulk send, but still useful. Also don't see a way to track which emails were rejected, so as maybe to remove them from our list.

            ...

            ANSWER

            Answered 2021-Nov-15 at 21:57

            For bounced, success and complaints emails you need to enable the SNS topics for them in SES.

            configure-sns-notifications

            A SQS queue can then be connected to the SNS topic for example bounced emails and then you can get the SQS queue to trigger a Lambda that can process the bounced email information and save it to your DB for further analysis. You can then also use this to remove any email addresses from your address book that bounced and might affect your success rate. Note this is not fine grained.

            For fine grained statistics look at this link. You will need to setup configuration sets in SES and use those when you send emails. That will allow you to do fine grained analysis in Cloud Watch.

            amazon-ses-now-provides-fine-grained-email-sending-metrics

            If you do not want to use Cloud Watch to analyze the metrics then you can export it to Kinesis Firehose or write it to S3 by setting up a Metric Stream in Cloud Watch.

            Metric Streams

            Source https://stackoverflow.com/questions/69980201

            QUESTION

            What are "private Amazon CloudWatch URLs" & do I need OpenSSL for the AWS SDK for PHP?
            Asked 2021-Oct-13 at 08:48

            The AWS SDK for PHP getting started guide mentions:

            To use the AWS SDK for PHP, you must be using PHP version 5.5.0 or later with the SimpleXML PHP extension enabled. If you need to sign private Amazon CloudWatch URLs, you also need the OpenSSL PHP extension.

            1. What are private Amazon CloudWatch URLs?
            2. Is OpenSSL required when using the AWS SDK for PHP?
            ...

            ANSWER

            Answered 2021-Oct-11 at 13:21

            Unfortunately, that looks like a typographical error in the documentation as private Amazon CloudWatch URLs do not exist.

            It probably meant to say sign Amazon CloudFront URLs for private distributions which you can find more about here & in specific to PHP, here.

            And no - if you do not need to create signed URLs, there should be no need for the OpenSSL PHP extension when using the AWS SDK for PHP.

            Source https://stackoverflow.com/questions/69526820

            QUESTION

            Lightsail+ STS to obtain temporary credentials
            Asked 2021-Sep-05 at 08:03

            Is it possible to retrieve temporary credentials from within a Lightsail instance without storing user credentials within ENV or an AWS credentials file? If possible, I'd like to use those temporary credentials to assume a service role with the necessary permissions to my AWS resources.

            I was hoping it'd be possible to grant permission to the instance ARN (similar to EC2) but I haven't been able to figure out how. Any help would be appreciated.

            ...

            ANSWER

            Answered 2021-Sep-05 at 08:03

            the frustrating situation is, amazon lightsail is managed outside of your aws account, in short, there's no support for instance profile like in ec2

            the only way to access aws resources from your lightsail instance is to use an iam user with correct credentials

            Source https://stackoverflow.com/questions/69061024

            QUESTION

            Cannot connect to s3 from ec2 via php sdk - cURL error 7
            Asked 2021-Jul-14 at 15:48

            I am having an issue with my EC2 instance connecting to our S3 Bucket.

            On my ec2 instance, I have php, httpd, aws-cli, aws-sdk installed. I am able to reach the index page where the code is located. Credentials file is set up /usr/share/httpd/.aws/credentials

            Code I am using from the Getting Started Basic Usage Guide

            ...

            ANSWER

            Answered 2021-Jul-14 at 15:47

            The issue is that the webserver, httpd, was not able to communicate with outside networks. That's why I could use the aws cli and telnet/ ping from the command line, but it was unreachable from the browser.

            After running the command setsebool -P httpd_can_network_connect 1, I was able to connect to my s3 buckets.

            Source https://stackoverflow.com/questions/68369203

            QUESTION

            How to use API generated values in entity virtual fields in CakePHP?
            Asked 2021-Apr-18 at 12:35

            Note: I am working through installing an AWS PHP SDK api connection in this question, although my question is entirely about CakePHP structure. Any of the AWS terminology I am using should be pretty simple and is only there to demonstrate the issue with Cake I am running into, if your not familiar with AWS.

            I am currently writing some new tables / entities for a CakePHP application I maintain, called Files. They represent images stored on a bucket in Amazon S3. Files contains a value called 'Key' which is more or less the filename of the file represented by the my entity in Cake, matching the filename on S3. The entity looks like this:

            ...

            ANSWER

            Answered 2021-Apr-18 at 12:35

            I would not perform an active lookup in a virtual field. I think it's more conventional to only use it for simple things, with data already present.

            I think a model (or table-like object) is a more suitable location for code like this.
            You might find this question useful for this point: Cakephp 3 - How to integrate external sources in table?

            You can make your own finders (neatly tucked inside Behaviors to group your logic) that combine your AWS data with your database data in this order:

            1. Collect database data, produce an array of lookup keys
            2. Use the array of keys to perform a single remote lookup
            3. Combine the remote data with database data.

            Source https://stackoverflow.com/questions/67077616

            QUESTION

            How to test if S3 object does not exist AWS PHP SDK (Version 3)?
            Asked 2021-Apr-14 at 21:23

            I have written an integration for the AWS SDK in PHP to send the keys for files on an S3 bucket and retrieve a pre-signed url, which more or less follows this example. This worked perfectly except I need to now check if the file exists on s3 and return empty string if it does not.

            I am doing this with my code below:

            ...

            ANSWER

            Answered 2021-Apr-14 at 18:47

            You need the s3:GetObject permission to invoke the HeadObject API, which is what the PHP SDK invokes when your code calls doesObjectExist().

            If the object you request does not exist, the error Amazon S3 returns depends on whether you also have the s3:ListBucket permission.

            • If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an HTTP status code 404 ("no such key") error.
            • If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP status code 403 ("access denied") error.

            So, you probably have s3:ListBucket but not s3:GetObject.

            Source https://stackoverflow.com/questions/67097271

            QUESTION

            Safe location to write oauth key files in laravel
            Asked 2021-Jan-21 at 13:51

            I am deploying my laravel application to AWS Elastic Beanstalk and I'm encountering the problem of persisting the oauth keys for laravel passport.

            I went through this and this. While the S3 option sounds reasonable, I still wanted a more secure way and wanted to checkout secret manager from AWS.

            Since laravel passport provides the option to load keys from a custom folder, I figured I could use the AWS PHP SDK to retrieve a secret key and write it to storage/app/oauth-public.key and storage/app/oauth-private.key and have passport load it from there.

            This approach is working fine after deployment to beanstalk but is the storage/app folder a safe location to generate the oauth.*.key files? or is there a better way/safer place?

            The following is my boot function in Providers/AuthServiceProvider.php

            ...

            ANSWER

            Answered 2021-Jan-20 at 21:45

            Generally your applications on AWS should be stateless. This means that no data should be stored on the instances as they can be replaced at any time due to scaling in activities, AZ re-balancing or other activities.

            Consequently, usually you would store application data outside of your instances. For secretes, such as your keys, good locations could be SSM Parameter Store or Secrets Manager (SM).

            You are already using SM which is good in my view. If you store them locally in storage/app this folder will be deleted anytime you deploy new version of your application. So you have to make sure that you always get the keys from SM. Also you could consider them storing the files in memory, rather then on a hard drive. This would allow you to get them faster without reading them from the local storage.

            Source https://stackoverflow.com/questions/65815958

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install sdk-for-php

            To install via Composer:.

            Support

            This library is auto-generated by Appwrite custom SDK Generator. To learn more about how you can help us improve this SDK, please check the contribution guide before sending a pull-request.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/appwrite/sdk-for-php.git

          • CLI

            gh repo clone appwrite/sdk-for-php

          • sshUrl

            git@github.com:appwrite/sdk-for-php.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Backend As A Service Libraries

            Try Top Libraries by appwrite

            appwrite

            by appwriteTypeScript

            pink

            by appwriteHTML

            sdk-for-web

            by appwriteTypeScript

            demo-todo-with-react

            by appwriteJavaScript

            sdk-for-python

            by appwritePython