steering_docs/php-tech/metadata.md
šØ CRITICAL - Must be completed BEFORE any code generation
# Step 1: List available knowledge bases
ListKnowledgeBases()
# Step 2: Query coding standards (REQUIRED)
QueryKnowledgeBases("coding-standards-KB", "PHP-code-example-standards")
# Step 3: Query implementation patterns (REQUIRED)
QueryKnowledgeBases("PHP-premium-KB", "PHP implementation patterns metadata")
# Step 4: AWS service research (REQUIRED)
search_documentation("What is [AWS Service] and what are its key API operations?")
read_documentation("https://docs.aws.amazon.com/[service]/latest/[relevant-page]")
FAILURE TO COMPLETE KNOWLEDGE BASE CONSULTATION WILL RESULT IN INCORRECT CODE STRUCTURE
Generate proper project structure, Composer configuration, and metadata files for PHP AWS SDK examples.
example_code/{service}/
āāā Hello{Service}.php # Standalone hello scenario file
āāā {Service}Actions.php # Individual action examples
āāā {Service}Service.php # Service wrapper class
āāā Runner.php # Interactive menu runner
āāā composer.json # Composer configuration
āāā README.md # Service documentation
āāā tests/
āāā {Service}Test.php # Unit and integration tests
āāā phpunit.xml # PHPUnit configuration
MANDATORY for every service directory:
{
"name": "awsdocs/{service}-examples",
"description": "AWS SDK for PHP examples for {AWS Service}",
"type": "library",
"license": "Apache-2.0",
"authors": [
{
"name": "AWS Documentation Team",
"email": "[email protected]"
}
],
"require": {
"php": "^8.1",
"aws/aws-sdk-php": "^3.209",
"ext-readline": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"{Service}\\": "./"
}
},
"autoload-dev": {
"psr-4": {
"{Service}\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"test-unit": "phpunit --group unit",
"test-integ": "phpunit --group integ"
}
}
{Service}Actions.php (e.g., S3Actions.php)Hello{Service}.php (e.g., HelloS3.php)Runner.php (standard entry point){Service}Test.php{Service}Service.phpS3\, DynamoDb\)MANDATORY for every PHP file:
<?php
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
<?php
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
namespace {Service};
use Aws\{Service}\{Service}Client;
use Aws\Exception\AwsException;
use Aws\{Service}\Exception\{Service}Exception;
class {Service}Service
{
// Class implementation
}
awsdocs/{service}-examples format"autoload": {
"psr-4": {
"{Service}\\": "./"
}
},
"autoload-dev": {
"psr-4": {
"{Service}\\Tests\\": "tests/"
}
}
composer validatecomposer dump-autoloadcomposer installcomposer test