Download the PHP package magical-yuri/magical-girl without Composer

On this page you can find all versions of the php package magical-yuri/magical-girl. 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 magical-girl

What is MagicalGirl?

This is a library that insert test-data to your database.
MagicalGirl generate the random value for test-data that suitable for your table in database, and insert the test-data.

Environment

How to Install

You need Composer to install MagicalGirl.

1. Install Composer

2. Prepare 'composer.json'

3. Install MagicalGirl

Prepare to Use

1. Initialize

Please execute the following command.

2. Database Connection Setting

Please implement the method to get DB-host, DB-user-name and DB-password in 'lib/DB/DBConnections.php'
The following is an example, that database-name is 'example'.

3. Generate the Importer class for your Table

Execute the following command, and two files will be generated.

Do not modify the file that named 'Base...php'.
Every time you execute magicalgen command, it re-generate the file 'Base...php' from table structure of run time.
When you need to customize the Importer, please modify only the file '[databaseName][tableName]Importer.php'

4. Prepare Master-data

When you always need to import the same data, for example, master-data, you prepare the master-data formed tsv file.
Please prepare tsv file in following directory structure.

This tsv file does not include the header.
You can get this tsv file by executing the following command.

How to Use

For example, you can use MagicalGirl by creating the following file.

API

TableImporter class

__construct($option = null)

Create a TableImporter object.
MagicalGirl expect you to specify following values for $option.
Default option is OPTION_WITH_TRUNCATE.

addRow(array $values = array(), array $ngValues = array())

Insert test-data to your table.

@param array $values array(fieldName => value, ...) MagicalGirl will insert these values in these columns.
@param array $ngValues array(fieldName => array(value, value, ...)) MagicalGirl will never insert these values in these columns.
@access public
@return array $row array(fieldName => value, ...) actually inserted values

MasterDBImporter class

import($tsvDirPath = null)

Import the master-data from tsv files.
Default value of $tsvDirPath is masterData, generated by magicalinit command.

@param string $tsvDirPath directory path that has tsv files
@access public
@return void

How to Test the TableImporter class

I will explain how to test The TableImporter class that is auto-generated from magicalgen command or is customized by you.
You need 'phpunit'.

For example, you can test the TableImporter class by creating the following file.

Testing by executing the following command.

License

MIT

Copyright

MagicalGirl is Copyright 2014 by MagicalYuri.


All versions of magical-girl with dependencies

PHP Build Version
Package Version
No informations.
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 magical-yuri/magical-girl contains the following files

Loading the files please wait ....