{"id":21710267,"url":"https://github.com/cloudinary-devs/php_credentials","last_synced_at":"2025-03-20T17:50:52.263Z","repository":{"id":262344007,"uuid":"886953058","full_name":"cloudinary-devs/php_credentials","owner":"cloudinary-devs","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-12T10:03:21.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T16:32:03.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudinary-devs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-11T22:56:57.000Z","updated_at":"2024-11-12T10:03:25.000Z","dependencies_parsed_at":"2024-11-11T23:34:54.004Z","dependency_job_id":"9c8a69f2-ccc6-4cb9-a56e-b18964085f50","html_url":"https://github.com/cloudinary-devs/php_credentials","commit_stats":null,"previous_names":["cloudinary-devs/php_credentials"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary-devs%2Fphp_credentials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary-devs%2Fphp_credentials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary-devs%2Fphp_credentials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary-devs%2Fphp_credentials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudinary-devs","download_url":"https://codeload.github.com/cloudinary-devs/php_credentials/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244666424,"owners_count":20490286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T23:14:24.291Z","updated_at":"2025-03-20T17:50:52.236Z","avatar_url":"https://github.com/cloudinary-devs.png","language":"PHP","readme":"## PHP Configure Cloudinary\n\nThis is a simple PHP project that demonstrates how to configure and use Cloudinary for image management. The program loads Cloudinary credentials from a .env file, generates an image tag with specified transformations, and outputs it to the browser.\n\n\n### Prerequisites\n\n* PHP (version 7.4 or higher recommended)\n* Composer for dependency management\n* A Cloudinary account (you can sign up here if you don’t have one)\n\n\n### Installation\n\n1. Clone the repository:\n    ```\n    git clone https://github.com/cloudinary-devs/php_credentials.git\n    cd php_credentials\n    ```\n\n2. Install dependencies: \u003cp\u003eRun the following command to install PHP dependencies using Composer:\u003c/p\u003e\n    ```\n    composer install\n    ```\n\n3. Set up environment variables:\n    * Create a .env file in the root of your project.\n    * Add your Cloudinary URL (from the [API Keys](https://console.cloudinary.com/settings/api-keys) page in the Console Settings) in the `.env` file like this:\n        ```\n        CLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAME\n        ```\n\n4. This project uses `vlucas/phpdotenv` to load environment variables, so make sure your `.env` file is in the same directory as your PHP file.\n\n### Usage\n\n1. Start a local server: You can use the built-in PHP server to serve the file:\n    ```\n    php -S localhost:8000\n    ```\n\n2. Access the program: Open your browser and go to `http://localhost:8000` to see the output, which will display a Cloudinary image with specified transformations.\n\n### Code Explanation\n\n* **Dotenv**: This project uses `vlucas/phpdotenv` to load environment variables from a `.env` file.\n* **Cloudinary PHP SDK**: The code configures Cloudinary using credentials from `.env` and generates an image tag with a transformation (resizing to 400px width).\n* **Image transformation**: The example includes a resize transformation for the sample image using Resize::scale().\n\n### Example Output\n\nThe program will display the following HTML image tag:\n\n```\n\u003cimg src=\"https://res.cloudinary.com/my-shop/image/upload/c_scale,w_400/cld-sample\"\u003e\n```\n\n### Dependencies\n\n* `vlucas/phpdotenv` for environment variable management\n* Cloudinary PHP SDK for managing Cloudinary assets\n\n### License\n\nThis project is licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary-devs%2Fphp_credentials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudinary-devs%2Fphp_credentials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary-devs%2Fphp_credentials/lists"}