Search by

survos / global-giving-bundle

tacman1123

Symfony integration for the GlobalGiving client

Package info

github.com/survos/global-giving-bundle

Type:symfony-bundle

pkg:composer/survos/global-giving-bundle

Fund package maintenance!

kbond

Statistics

Installs: 19

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.28.7 2026-09-15 10:44 UTC

This package is auto-updated.

Last update: 2026-09-15 11:01:39 UTC


README

Symfony 8.1 / PHP 8.5 integration for survos/global-giving-client, using survos/kit-bundle.

# config/packages/survos_global_giving.yaml
survos_global_giving:
    api_key: '%env(GLOBAL_GIVING_API_KEY)%'
    # base_uri: 'https://api.globalgiving.org/api/public/'

Inject Survos\GlobalGiving\GlobalGivingClient for API/download calls and Survos\GlobalGiving\Xml\ExportReader for typed streaming records. Credentials remain in app environment configuration; the standalone client never reads environment variables.

$client->download(Export::ActiveProjects, $xmlPath);
foreach ($reader->read($xmlPath, Export::ActiveProjects) as $project) {
    // $project is a typed Project DTO; optional $project->organization is an Organization DTO.
}

Migration from 1.x

This is a breaking modernization: replace GlobalGivingService and its unstructured array calls with the typed client. featuredProjects() returns Project DTOs; project($id) returns one Project. Full datasets use download(Export::..., $path) and ExportReader::read(). Retired paginated all-project methods, placeholder Twig filters and hasApiKey() are removed. Check configured credentials in application configuration instead.

Signed URLs are never cached. Daily snapshot caching belongs to the importing app. The bundle supplies a dedicated unlogged HttpClient to avoid recording keys and signed URLs in profiler logs. See client docs/contract.md for supported operations and transport/format limitations.

The consuming app is https://github.com/survos-sites/global-giving . Both package directories are registered in the monorepo split workflow; publication follows the normal reviewed monorepo release process.