Download the PHP package brunty/kahlan-pdo without Composer

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

Kahlan PDO

Build Status SensioLabsInsight

🗄 Provides functionality to work with PDO, reset a database and load fixtures within Kahlan

Requirements

Installation

composer require brunty/kahlan-pdo --dev

Setup

Folders:

  1. Create a folder to store your database related files (/spec/db is suggested)
  2. Create a folder to store your SQL files to load into the database (/spec/db/sql is suggested)
  3. Within the folder where your database related files will be stored created a file reset.php which will be the file you'll use to reset your DB whenever you call the function to do so.
  4. Within the folder where your database related files will be stored, created a fixtures folder
  5. Create fixtures as you need for your tests in the fixtures folder.

Config:

In kahlan-config.php setup the path to your db folder and if you wish to use the \Brunty\Kahlan\PDO\sql() helper function, add the path to a directory that will hold SQL files as follows:

Usage

Using the \Brunty\Kahlan\PDO\reset() function without a parameter will create an in-memory database in SQLite, but you can pass the DSN, username and password to it and it'll use those instead.

With loading fixtures, you can then create a file within /spec/db/fixtures and call the name of that file (without the .php extension) to do whatever you might need to load data into the database.

For example:

\Brunty\Kahlan\PDO\load('things'); would load the file: /spec/db/fixtures/things.php into the database.

You could setup objects yourself with something like Faker or you could just load SQL into the database directly:

In /spec/db/fixtures/things.php:

The helper function \Brunty\Kahlan\PDO\db() returns the instance of PDO that is in the Kahlan box.

The helper function \Brunty\Kahlan\PDO\sql() loads SQL from the file given (in the \Kahlan\box('db.path.sql') directory, without the .sql extension) into the PDO instance in the Kahlan box.

Contributing

This started as a small personal project.

Although this project is small, openness and inclusivity are taken seriously. To that end a code of conduct (listed in the contributing guide) has been adopted.

Contributor Guide


All versions of kahlan-pdo with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
kahlan/kahlan 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 brunty/kahlan-pdo contains the following files

Loading the files please wait ....