Download the PHP package gemvc/connection-pdo without Composer

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

PDOGEMVC

gemvc/connection-pdo

PHPStan Unit Tests Integration Tests Class Coverage

PDO connection library implementation package for GEMVC framework.

Package Information

Purpose

This package provides PDO connection implementation for GEMVC framework:

  1. PdoConnection - Real implementation that creates actual PDO connections

    • Creates: new PDO($dsn, $user, $pass) - REAL IMPLEMENTATION
    • Implements: ConnectionManagerInterface (from connection-contracts package)
    • Used by: Framework's connection management system
    • Supports multiple database drivers:
      • MySQL (default, primary) - Optimized with MySQL-specific features
      • PostgreSQL - Optimized with PostgreSQL-specific defaults and SSL support
      • SQLite - Supported for testing and development
      • Other PDO drivers - via standard DSN format
  2. PdoConnectionAdapter - Adapter that wraps PDO instances
    • Wraps: Existing PDO instances (doesn't create them)
    • Implements: ConnectionInterface (from connection-contracts package)
    • Used by: PdoConnection to wrap created PDO instances

It's designed for traditional PHP-FPM environments where each request gets its own PHP process.

Features

Installation

Dependencies

Required

Framework Dependencies (Runtime)

Note: This package is framework-agnostic and only depends on connection-contracts. The framework should ensure $_ENV is populated before using this package.

Usage

Using the Real Implementation

MySQL (Default)

PostgreSQL

Note: PostgreSQL uses driver-specific defaults: port 5432, username postgres, charset UTF8. Unlike MySQL, PostgreSQL's PDO DSN does not support a charset parameter — charset/encoding is applied via SET NAMES immediately after connecting instead.

SQLite (for Testing/Development)

Programmatic Configuration Override (for CLI/Docker)

For CLI commands in dockerized applications where you need to override database configuration:

Note: setConfig() clears any cached connections and DSN, ensuring new connections use the updated configuration.

Using the Adapter

Architecture

This package provides two components that work together with connection-contracts:

1. PdoConnection - Real Implementation

Creates actual PDO connections:

Database Driver Support:

Configuration Methods:

  1. Environment Variables (default): Reads from $_ENV
  2. Programmatic Override: Use setConfig() method to override programmatically (useful for CLI/docker)

Environment Variables:

Programmatic Configuration Methods:

2. PdoConnectionAdapter - Adapter

Wraps existing PDO instances:

Complete Flow

Integration with connection-contracts

Testing

Running Tests

Test Coverage

The package includes comprehensive test coverage:

Test Classes

Generating Coverage Report

The HTML report will be generated in the coverage-report/ directory.

License

MIT


Made with ❤️ by Ali Khorsandfard

This package is part of the GEMVC Repository framework ecosystem.

GEMVC is PHP framework built for Microservice.


All versions of connection-pdo with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
gemvc/connection-contracts Version ^1.0
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 gemvc/connection-pdo contains the following files

Loading the files please wait ...