Download the PHP package blackops/skeleton without Composer

On this page you can find all versions of the php package blackops/skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package skeleton

BlackOps Quickstart

Feature-firstのBlackOps Application Skeletonである。Inline GET /welcome、調査用Inline Failure POST /failures、Database Transaction付きPOST /orders、Deferred POST /reports、PostgreSQL 18、FrankenPHP 1、PHP 8.5 CLIを含む。

Distribution Status

このDirectoryは公開済みExperimental Stable 1.2.1のQuickstartであると同時に、Packagist Package blackops/skeletonのSource of Truthである。Release WorkflowがこのDirectoryだけをkubotak-is/blackops-skeletonへSplitし、Frameworkと同じVersionで公開する。1.2.1にはHeader Authentication、Phase 13のDatabase/Transaction Journey、POST /ordersが含まれる。

Local検証ではCommitted QuickstartだけをPackage Rootへ抽出し、SkeletonとFrameworkをsymlink=falseの別々のLocal Repositoryとして通常/--no-scripts Create-projectする。Remote検証は空のComposer HomeからPackagist Packageだけを取得する。

Setup

Composer create-projectはpost-create-project-cmdから同じbin/setupを実行する。--no-scriptsで作成した場合、またはSetupを明示的に再実行する場合はProject Root内外のどのWorking Directoryからでもphp /path/to/my-app/bin/setupを実行できる。Setupは.envがない場合だけ.env.exampleをCopyし、var/build/とvar/log/を準備する。既存.envは変更しない。

Quickstartのbootstrap/app.phpはFrameworkのwithEnvironmentFile()でProcess Environmentを優先してOptional .envを一度だけSnapshotします。Classic/Workerのpublic/index.php/public/worker.phpはBlackOps\Http\SapiRuntimeへApplicationを渡すだけです。Environment、PSR-7、SAPI Emit、UUIDv7のRuntime実装はFrameworkが所有するため、Skeleton Composer MetadataへそのRuntime Packageを重複宣言しません。DBAL/MigrationsなどApplicationが実ImportするPackageだけをApplication Direct Dependencyとして追加します。

公開Packageのblackops/framework:^1.2はPackagistから解決できます。認証付き/welcome//reportsとPhase 13の/ordersを試す場合は、利用者向けQuickstartの公開Package手順で1.2.1をInstallし、生成したDirectoryでphp bin/setupを実行します。

Install、Build、MigrationはImage startupに含まれない。Default docker compose up はHealthyなPostgreSQLとWorker Mode HTTPだけを起動し、Deferred Worker、Scheduler、Migration、Retention Purgeは起動しない。HTTP Portは .env の HTTP_PORT で変更でき、既定は8080である。

Setupは次手順を表示するだけで、Composer/pnpm Install、Network Access、Docker、Database、Migration、Artifact Build、Frontend生成、TypeScript Test、Worker、Scheduler、Retentionを実行しない。Backendだけで利用する場合はpnpm、frontend:generate、frontend:check、pnpm testを省略できる。build:compileはBackend Artifactと小さいFrontend Contract Artifactを作るが、TypeScript SourceやNode Dependencyを生成しない。

Frontend Operation Objects

Install直後のSkeletonは、Application所有のconfig/frontend.php、package.json、pnpm-lock.yaml、tsconfig*.json、resources/js/application/、tests/Frontend/を含む。resources/js/blackops/はPHP Operationから明示生成するため配布物へ固定せず、.gitignore対象にする。

frontend:generateとfrontend:checkはbuild:compileを暗黙実行しない。frontend:checkはFreshならExit 0、Missing/DriftならExit 1、Config/Artifact/Contract不正ならExit 2を返す。生成したModuleはCallableでもThenableでもなく、通信する.fetch()、一回だけ状態を取得する.status()、明示した期限まで待つ.wait()、送信しない.toRequest()、URLを返す.url()、Readonly Metadataを持つOperation Objectである。

recipientEmailの名前と型は送信に必要なWrite-only Input Contractへ含むが、その実値をGenerated Tree、Result、Log Helperへ埋め込まない。X-Sample-TokenもApplicationが呼出単位で注入する。Generated TypeはAuthentication/Authorization、CORS、CSRF、Encryption、Browser Storageを代替しない。

.fetch()は202後に自動Pollingしない。.status()はGET /operations/{operationId}を一回だけ呼び、.wait()だけがServerのRetry-Afterに従って有限に待つ。.wait()には購読可能なAbort Signalと正のmaxWaitMillisecondsが必須である。401、404、410、500、Network Error、不正Responseでは自動Retryせず停止する。

QuickstartはSampleOperationStatusAuthorizerをApplicationServiceProviderから明示Bindingする。同じuser Actorが受け付けたOperationだけを同じActorが参照できる最小Same-origin Exampleであり、Tenant/Role/Resourceを扱うProduction Policyではない。ProductionではApplicationが認証方式とStatus参照Policyを実装する。Operation IDは相関KeyでありSecretではないが、IDを知っているだけでは参照できない。

HTTP

Failure ResponseのoperationIdはHuman/JSONのどちらでも調べられる。

config/logging.phpはApplication/Framework相関Logをvar/log/application.jsonlへJSONLで出力する。Docker-only QuickstartではPostgreSQLをHostへPublishせず、ViewerもCLI ContainerのLoopback限定なので、Hostからphp blackops operation:viewerを実行したりHost Browserで開いたりできない。Docker利用時は上記Human/JSON Inspectを使う。ViewerはConsumer E2Eと同様にViewer/HTTP Clientを同じCLI ContainerとLocal Network Namespaceへ置く場合だけ検証でき、Host Browser公開の手順ではない。

BrowserでViewerを利用するには、Application/PHP CLI/PostgreSQL/Browserが同じLocal Network Namespaceから到達可能なNative Runtimeを準備し、Project Rootでphp blackops operation:viewerを明示実行する。Non-loopback Bindへ緩めずLoopbackを維持し、起動ごとに変わるBootstrap Tokenを保存/共有しない。

OrderはDefault DBAL ConnectionをConstructor InjectionしたRepositoryを使う。CreateOrder::handle()の#[Transactional]が最外Transactionを所有し、Container管理のCreateOrderCommandは#[Transactional]で同じConnectionへNested Required参加する。Order Rowと成功Terminal JournalがCommitした後、#[AfterCommit]のRecordOrderCommit::record()がCommit確認Rowを追加する。

After Commitは同期Best-effortであり、Process Crashを越える再送やDeliveryを保証しない。Email、Webhook、Message Publish等をat-least-onceで配送する場合はTransactional Outboxを使い、Relay停止/再開、Retry、Dead Letter再開を明示的に運用する。外部配送のExactly Onceは保証しない。

X-Sample-TokenはAuthentication Middlewareだけが読み、Operation Value、Transport、Journalへ保存しない。SAMPLE_API_TOKENが未設定または空なら、Authenticatorは既知値へFallbackせず構成を失敗させる。

ReportのrecipientEmailは業務上のSensitive値の例である。HTTP内で完了するValidation RejectionのObserved Projectionではvar/log/journal.jsonlへ[masked]として記録する。Valid Deferred ReportのWorker EventはJSONLへ転送せず、Raw ValueとActor IDを含むCanonical PostgreSQL Journalが正本となる。既定Observer Deliveryはbest_effortである。

このHeader Token認証はLocal Development専用のExampleである。ProductionではApplicationがSession、Bearer Token、External IdP等の認証方式とSecret管理へ置き換える。

Headerを省略するとAuthentication MiddlewareはAnonymousとして通過させ、#[Authorize]を持つOperationがOperation ID付き401でRejectする。不正なHeader値はOperation受付前の401となり、Operation IDとJournalを作らない。

FrankenPHP Worker Mode

Default HTTPはWorker Modeであり、Process単位でApplication、Environment、Configuration、Compile済みRuntimeを一度だけ構成する。

FRANKENPHP_MAX_REQUESTSはWorker Threadを安全に再起動するRequest上限で、既定は1000である。Frameworkは各Request前にDatabase Connectionをhealth-checkし、Stale Connectionをcloseして一度再接続する。再接続できない場合は500として失敗し、成功Responseとして扱わない。Request終了時はOperation Scopeを検査し、JSONL Observerをflushする。Throwableまたは未完了TransactionのConnectionは次Requestへ持ち越さずcloseする。

FrankenPHPはWorker callback終了後にRequest Superglobalをcleanupするが、$_ENVはRequest間でresetしない。EntrypointはProcess開始時の$_ENVへ毎Request復元する。Application ServiceはRequest Body、Actor、Tenant、PSR-7 Request等のRequest固有Stateをpropertyやstaticへ保持せず、Operation ValueまたはExecution Contextから受け取る。

Classic Modeは明示Fallbackとしてclassic-mode Profileから起動できる。既定Portは8081で、CLASSIC_HTTP_PORTから変更する。

Worker and Maintenance

Sample Report Operationは最初のAttemptでRetryを要求し、次のAttemptで成功する。変更を適用するPurgeは --confirm を明示した場合だけ実行する。

Removing Starter Features

Welcomeは app/Feature/Welcome/、Reportは app/Feature/Report/、Local Failure Exampleはapp/Feature/Diagnostics/を削除するだけでよい。Orderを削除する場合はapp/Feature/Order/とmigrations/Version20260718000000.phpを削除し、ApplicationServiceProviderからOrder用の3 Bindingを外す。config/operations.php のDiscovery Rootへ追加したOperationは次のBuildで検出される。

Operation自身に handle(OperationValue): Outcome、またはAttempt等の実行情報が必要なら handle(OperationValue, ExecutionContext): Outcome を定義するTyped Self-handledが標準形である。ValueとOutcomeはSignatureから推論され、#[Accepts]、#[Returns]、OperationResult::completed()は不要である。予期された業務拒否はFrameworkの OperationRejectedException、一時障害は通常のRetryable Exceptionをthrowする。FrameworkはOperationをContainerへAutowireする。Repository InterfaceやExternal Client等のConstructor Dependencyが必要な場合だけ、ServiceProvider を作り config/app.php の services へ登録する。

Creating an Operation

Framework所有のGeneratorから、Build可能なTyped Self-handled Operation、Value、Outcomeを作成できる。

Generatorはapp/Feature/Billing/CreateInvoice/へ3 Fileを作成する。既存Fileは上書きせず、Route、Deferred設定、Build、Database操作は行わない。生成後のSourceはApplication所有であり、Framework Updateによって書き換えられない。CommandとStubはFramework Packageが所有するため、composer update blackops/framework後の新規生成には更新済み実装が使われ、Projectのblackopsを置き換える必要はない。

Creating a Migration

Application固有のMigrationはFramework所有Generatorで作成する。

最初の実行時にmigrations/が作られ、UTC VersionのApp\Migrations Classが生成される。up()/down()へApplicationのSQLを記述した後、Framework Migrationと同じ明示Commandで確認・適用する。

Generator自身はDatabase接続、Migration適用、Buildを行わない。Application Migrationがない場合、空のmigrations/は不要である。

Creating and Running a Seeder

Install直後のSkeletonは標準Root app/Infrastructure/Seed/DatabaseSeeder.phpを持つ。追加SeederはFramework所有Generatorで作り、Rootから明示順に実行する。

Migration、Build、Seedは互いを暗黙実行しない。SeederはBuild時に検出されるため、Source変更後は必ず再Buildする。Transaction、再実行方針、Conflict処理はApplicationが所有する。


All versions of skeleton with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
blackops/framework Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package blackops/skeleton contains the following files

Loading the files please wait ...