Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ Install the PHP dependencies, including the Castle PHP SDK:
composer install
```

> **Note:** until the SDK 4.0 release lands on Packagist, `composer.json` pulls
> `castle/castle-php` from the `feat/php-namespaces` branch via a VCS repository.
> If Composer hits a GitHub API rate limit while resolving it, add a token:
> **Note:** `composer.json` requires the released `castle/castle-php` `^4.0`,
> resolved from the SDK's Git tags via a VCS repository. Once `4.0` is available
> on Packagist, the `repositories` block can be dropped. If Composer hits a
> GitHub API rate limit while resolving it, add a token:
> `composer config --global github-oauth.github.com <token>` (or `gh auth token`).
> After the SDK is released, switch the requirement to a tagged version
> (e.g. `"castle/castle-php": "^4.0"`) and drop the `repositories` block.

The Castle browser SDK is served at runtime straight from `node_modules`, so
install the npm dependencies too:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"php": ">=7.4",
"ext-curl": "*",
"ext-json": "*",
"castle/castle-php": "dev-feat/php-namespaces"
"castle/castle-php": "^4.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6"
Expand Down
8 changes: 3 additions & 5 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ function castle_configure(): void
{
Castle::setApiKey(env('castle_api_secret'));

// Set connection / request timeouts (milliseconds).
Castle::setCurlOpts([
CURLOPT_CONNECTTIMEOUT_MS => 3000,
CURLOPT_TIMEOUT_MS => 5000,
]);
// Set the request timeout in milliseconds (applies to both the connection
// and the transfer).
Castle::setRequestTimeout(5000);
}

// ---------------------------------------------------------------------------
Expand Down
Loading