API
Οι μέθοδοι που παρατίθενται εδώ είναι οι τεκμηριωμένες API των εκδόσεων 0.5. Ορισμένες κλάσεις εκθέτουν επιπλέον δημόσιες μεθόδους, ώστε οι μηχανές 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
Υλοποιήστε αυτή τη διεπαφή (και το SqlMirrorStatement) για να συνδέσετε το SqlMirror μέσω προσαρμοσμένου επιπέδου βάσης δεδομένων. Τα 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