Download the PHP package ben-rowan/vcsv-stream without Composer

On this page you can find all versions of the php package ben-rowan/vcsv-stream. 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 vcsv-stream

vcsv://stream

A virtual CSV stream for creating unit / integration test fixtures.

Install

Modes

You can generate CSV fixtures in two modes with vcsv://stream, online and offline.

Online

You can use vcsv://stream as a direct replacement for your standard file stream. In this mode vcsv://stream will dynamically generate fake CSV data based on the provided configuration.

pros:

cons:

Offline

You can also use vcsv://stream to generate a CSV fixture on disk. You can then use this later in your test.

pros:

cons:

Usage

Online

The first step is to call vcsv://streams setup method in your test. This initialises and registers the stream:

Next you load your configuration (see [here]() for config docs):

Finally you can use the stream as you would any other file stream:

Offline

The provided generate:csv command makes this easy:

This will output a CSV file to stdout so you can easily see what's being generated. Once you're happy you can dump it to disk:

Configuration

vcsv://stream uses yaml configuration files to define your CSV fixtures. This has many benifits over simply creating CSV files and adding them to source control:

Example

Here's a complete example of some vcsv://stream configuration. We'll go through each section below:

header

This section defines the header for your CSV. It's required even if you choose not to output a header because it defines the default data generators for each of the columns.

include

When set to true the CSV will include a header. When set to false it wont.

columns

This is how we tell vcsv://stream how many columns we'd like to give our CSV and how to generate data for those columns by default.

The name provided for each column will become the columns header if this is enabled. The names must be unique.

vcsv://stream can generate data in three ways:

value Columns

You can provide a fixed value that you'd like this column to contain:

faker Columns

You can randomly generate data using one of the Faker libraries formatters:

By setting unique to true we're telling Faker that we don't want this column to contain any duplicate data.

text Columns

You can also tell vcsv://stream that you'd just like the column to contain lorem ipsum:

records

This defines the actual CSV data. We define the data in 'chunks' meaning we can vary the data throughout the file. Each record has a name, this should be something that helps you remember why it was created.

count

This defines the number of rows that should be created using this set of config.

columns

This defines a set of override data generators. If we don't define a column here then the previously defined default header data generator will be used instead.

Note: the column names here must match one of the header columns.


All versions of vcsv-stream with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
fzaninotto/faker Version ^1.7
ext-posix Version *
symfony/console Version ^4.3
symfony/yaml Version ^4.3
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 ben-rowan/vcsv-stream contains the following files

Loading the files please wait ....