Download the PHP package amund/pdo-silo without Composer

On this page you can find all versions of the php package amund/pdo-silo. 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 pdo-silo

PDO-Silo

A silo to store and link resources, via a simple API.

Latest Stable Version

License: MIT
PHP: 8.1+
Drivers: MySQL, SQLite, PostgreSQL


Installation

Quick Overview

API

Silo lifecycle

Method Description
__construct(\PDO $pdo, string $prefix = 'resource') Create a Silo instance.
create(): void Create the 4 database tables (PREFIX_meta, PREFIX_attribute, PREFIX_link, PREFIX_cache)
destroy(): void Drop all 4 tables

Resources

Method Description
set(string $class, array $attributes = [], bool $get = false): int\|array Create a resource. Returns its id (or full resource if $get is true).
get(int $id, bool $links = false, bool $getLinks = false): ?array Retrieve a resource by id. Optionally include its links.
getMeta(int $id): ?array Returns ['id', 'class'] or null.
setMeta(?int $id, string $class): int Create ($id = null) or update a resource class. Returns the resource id.
getAttr(int $id, string $attr): ?string Returns the attribute value, or null.
setAttr(int $id, string $attr, mixed $value): mixed Set/update/delete an attribute. null and '' delete the attribute. '0' and 0 are stored.
getAttributes(int $id): array Returns all attributes as ['name' => 'value', ...].
setAttributes(int $id, ?array $attributes): ?array Replace all attributes, or pass null to delete them all.

Links

Method Description
link(int $from, int $to, ?string $attribute = null): bool Create a link. Default attribute = target class name.
unlink($from, $to): bool Remove a specific link, all links from, all links to, or all links for an id.
linkFrom(int $id, bool $get = false): array Get child links, grouped by attribute.
linkTo(int $id, bool $get = false): array Get parent links, grouped by attribute.
getList(int $parent, string $attribute): array Get an ordered list of linked resources (by position).
setList(int $parent, string $attribute, array $children): void Replace an ordered list.
listFrom(int $id, bool $get = false): array Get list children, grouped by attribute.
listTo(int $id, bool $get = false): array Get list parents, grouped by attribute.

Search

Method Description
search(array $arg = [], bool $get = false, bool $links = false, bool $getLinks = false): array Search resources. Returns ['total', 'results', 'duration']. Supports where, order, limit, and offset keys.
filter(string $field, string $operator, string\|int\|float\|array $value): string Build a WHERE clause fragment. Operators: =, !=, <, >, <=, >=, LIKE, IN. int/float values produce numeric comparisons.
group(string $operator, string ...$filters): string Combine filters with AND or OR.

Cache

Method Description
emptyCache(): void Clear all cached resources.

Running Tests

Tests use SQLite :memory:. Each test creates and destroys its own silo.

Static Analysis

Requirements

About

The idea behind PDO-Silo is to provide a minimal persistence layer for PHP projects — a nano ORM / DBAL. It is simple, small, fast, and fun to use.

Built by Dimitri Avenel. Originally created in 2016.


All versions of pdo-silo with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-pdo Version *
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 amund/pdo-silo contains the following files

Loading the files please wait ...