Download the PHP package forrest79/phpgsql-nette without Composer

On this page you can find all versions of the php package forrest79/phpgsql-nette. 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 phpgsql-nette

PhPgSql - Nette

Build

Use PhPgSql with Nette Framework.

Introduction

Extension to easy use PhPgSql in Nette application.

Installation

The recommended way to install PhPgSql - Nette is through Composer:

PhPgSql requires PHP 8.1.0 and pgsql binary extension.

Using

First, register extension in neon configuration:

Then, register connection (one connection is as default):

Or multiple connections:

IMPORTANT! You can't name connection as config.

First connection is autowired as Forrest79\PhPgSql\Fluent\Connection. If you want to autowired other connection or none connection, you must explicitly set autowired: false.

You can also get a connection by:

Second can be got by:

Use your own connection class

By default Forrest79\PhPgSql\Fluent\Connection is registered to DI as connection class. If you want to use other (your own) connection class, you need to use your own connection factory. This is class that implements Forrest79\PhPgSql\Nette\Connection\ConnectionCreator interface, and you must specify the concrete return type with your connection class.

Example:

Function prepareConfig(array $config) create connection string (key='value' key='value' ...) from the array with configuration. Items with NULL values are skipped.

And now, you just need to override old connection factory with this one in DI configuration, services section, like this:

Where default is connection name.

Query dumper

SQL queries are dumped in Tracy\Bar and in Tracy\Bluescreen and you can use different dumpers/formatters. Three are included:

You can install better formatting via Doctrine\Sql-Formatter just for your dev environment with composer require doctrine/sql-formatter --dev.

Or you can use your own query dumper, just create a class-extending abstract class PhPgSql\Tracy\QueryDumper, register it to the DI container and set service to queryDumper: @class/serviceName

Tracy BarPanel

BarPanel for Tracy with DB queries is showing links to PHP source files, where the query was sent to the database. This is made using PHP function debug_backtrace(). This function returns the whole call stack. To get the correct place in the PHP source file, we must ignore some internal library classes where the query is sent to the database in real. Basically, BarPanel ignores all classes/function from PhPgSql library to show the most accurate place in the PHP source.

When you use some own custom wrapping objects, you want to ignore in the call stack, you can extend backtraceContinueIterate() method and add your own logic here. For example:


All versions of phpgsql-nette with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
forrest79/phpgsql Version ^1.7
nette/di Version ^3.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 forrest79/phpgsql-nette contains the following files

Loading the files please wait ....