API
여기에 나열된 메서드는 0.5 릴리스에서 문서화된 API입니다. 일부 클래스는 storh 엔진 간 내부 협력을 위해 추가 공개 메서드를 제공할 수 있습니다. 이 페이지에 나열되지 않았다면 구현 세부 정보로 간주하세요.
StorageRoot
StorageRoot::at(string $root): StorageRootStorageRoot::resolve(string $root, string $namespace = 'runtime-storage'): stringpath(string $namespace = 'runtime-storage'): stringroot(): string
DocStore
DocPerFileStore의 별칭입니다.
put(array $data, ?string $id = null): StorageRecordputMany(iterable $records): arrayputStream(iterable $records): intget(string $id): ?StorageRecorddelete(string $id): voidstream(?RecordQuery $query = null): Generatorquery(): QueryBuilderindexes(): DocStoreIndexManagerreindex(): arraystats(): arrayhealth(): arrayverify(): arrayrepair(): arraycompact(): arrayimportJsonl(string $path): intexportJsonl(string $path): intpath_for_id(string $id): string
SegmentedLog
SegmentedLogStore의 별칭입니다.
put(array $data, ?string $id = null): StorageRecordappendMany(iterable $records): arrayappendStream(iterable $records): intget(string $id): ?StorageRecorddelete(string $id): voidstream(?RecordQuery $query = null): Generatorquery(): QueryBuilderretain(): SegmentedLogRetentioncompact(): voidrecover(): voidstate_index(): arraystats(): arrayhealth(): arrayverify(): arrayrepair(): array
Queue
LogQueue의 별칭입니다.
enqueue(array $payload, ?string $id = null): stringenqueueMany(iterable $jobs): arrayclaim(): ?StorageRecordclaimMany(int $limit): arraycomplete(string $id, bool $keep_done = true): voidcompleteMany(iterable $ids, bool $keep_done = true): intrequeue_timed_out(int $timeout_seconds): intpurgeDone(int $olderThanSeconds = 0): intcounts(): arraystats(): arrayhealth(): arrayverify(): arrayrepair(int $processingTimeoutSeconds = 3600): array
QueryBuilder
where(string $field): QueryFieldBuilderandWhere(callable $callback): QueryBuilderorWhere(callable $callback): QueryBuilderorderBy(string $field, string $direction = 'asc'): QueryBuilderlimit(int $limit): QueryBuildercursor(string $id): QueryBuilderpage(int $size): QueryBuilderget(): arrayfirst(): ?StorageRecordcount(): intexplain(): array
DocStoreIndexManager
field(string $field): DocStoreIndexFieldBuilderdefine_field(string $field, bool $unique = false, bool $range = false): DocStoreIndexManagerapply_schema(Schema $schema): DocStoreIndexManagersync(bool $rebuild = true): voidrebuild(): arraydefinitions(): array
Schema
Schema::collection(string $collection): Schemastring(string $field): SchemaFieldBuilderint(string $field): SchemaFieldBuilderfloat(string $field): SchemaFieldBuilderbool(string $field): SchemaFieldBuildermixed(string $field): SchemaFieldBuilderrequired(array $fields): Schemavalidate(array $data): void
Cache
Cache::memory(int $maxEntries = 10000, ?int $maxBytes = null): CacheInterfaceCache::apcu(string $prefix = 'storh'): CacheInterfaceCache::null(): CacheInterface
CacheValidation
CacheValidation::HASHCacheValidation::STATCacheValidation::TRUST
SqlMirror
ext-pdo(sqlite 또는 mysql 드라이버) 또는 ext-mysqli가 필요합니다.
new SqlMirror(PDO|mysqli|SqlMirrorConnection $connection, string $prefix = 'storh_', ?string $driver = null)collection(FileStoreInterface $store, string $name, ?Schema $schema = null): SqlMirrorinstall(): voiduninstall(): voidpush(?string $name = null): arrayflush(string $name, array $ids): arraypull(?string $name = null): arrayverify(): arrayrebuild(?string $name = null): arraytable(string $name): string
SqlMirrorConnection
사용자 지정 데이터베이스 계층을 통해 SqlMirror을 구동하려면 이 인터페이스와 SqlMirrorStatement를 구현하세요.
PdoSqlMirrorConnection 및 MysqliSqlMirrorConnection은 기본 제공 구현입니다.
driver(): stringexecute(string $sql): voidrows(string $sql): Generatorstatement(string $sql): SqlMirrorStatementbegin(): voidcommit(): voidrollback(): voidin_transaction(): bool
RecordQuery
RecordQuery::all(): RecordQueryafter(string $id): RecordQuerytime_range_ms(?int $from_ms, ?int $until_ms): RecordQuerywhere_equal(string $field, mixed $value): RecordQuerylimit(int $limit): RecordQuerycontinue_on_error(callable $handler): RecordQueryon_segment_open(callable $handler): RecordQuery
StorageRecord
id(): stringdata(): array