Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaz29/FileFixture
FileFixture Plugin for CakePHP2.x
https://github.com/kaz29/FileFixture
Last synced: 3 months ago
JSON representation
FileFixture Plugin for CakePHP2.x
- Host: GitHub
- URL: https://github.com/kaz29/FileFixture
- Owner: kaz29
- Created: 2013-03-24T04:11:39.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-20T02:38:09.000Z (over 10 years ago)
- Last Synced: 2024-05-29T23:17:23.821Z (6 months ago)
- Language: PHP
- Homepage:
- Size: 179 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FileFixture Plugin for CakePHP2.x
[![Build Status](https://travis-ci.org/kaz29/FileFixture.png)](https://travis-ci.org/kaz29/FileFixture)
## Feature
- Load fixture data from csv(Comma-Separated Values)/tsv(TAB-Separated Values) file
- Load master data from csv(Comma-Separated Values)/tsv(TAB-Separated Values) file## Requirements
- PHP >= 5.3.x
- CakePHP >= 2.0## Installation
Put 'FileFixture' directory on app/Plugin or plugins in your CakePHP application.
Then, add the following code in bootstrap.phparray('type' => 'integer', 'null' => false, 'default' => null, 'length' => 11, 'key' => 'primary'),
'title' => array('type' => 'string', 'null' => true, 'length' => 50),
'body' => array('type' => 'text', 'null' => true, 'length' => 1073741824),
'created' => array('type' => 'datetime', 'null' => true),
'modified' => array('type' => 'datetime', 'null' => true),
'indexes' => array(
'PRIMARY' => array('unique' => true, 'column' => 'id')
),
'tableParameters' => array()
);public $importRecords = array(
// 'path' => [path to Fixture File Path], // Optional(default is 'app/Test/Fixture/Data/')
'file' => 'posts.csv',
);
}app/Test/Fixture/Data/posts.csv
title,body,created,modified
"The title","This is the post body.","2011-06-20 23:10:57","2011-06-20 23:10:57"
"A title once again","And the post body follows.","2011-06-20 23:10:57","2011-06-20 23:10:57"
"Title strikes back","This is really exciting! Not.","2011-06-20 23:10:57","2011-06-20 23:10:57"### FileImporter