I am having trouble using the spout library in kohana 3.2 to import a big Excel file into mysql. These are the installation steps I have taken:
In the portal file index.php, I added this line of code:
require_once APPPATH.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'kohana'.DIRECTORY_SEPARATOR.'Spout'.DIRECTORY_SEPARATOR."Autoloader/autoload.php";
This is my reader
method:
public static function reader($filename){
$result = array();
$reader = ReaderFactory::create(Type::XLSX);
$reader->open($filename);
while ($reader->hasNextRow()) {
$row = $reader->nextRow();
$code = $row[1];
$result[] = $code;
}
return $result;
}
When I try calling the method, this error message appears:
ERROR: ErrorException [ 1 ]: Class 'ReaderFactory' not found ~ APPPATH/classes/kohana/spoutexcel.php [ 70 ]
2015-09-25 14:29:10 --- STRACE: ErrorException [ 1 ]: Class 'ReaderFactory' not found ~ APPPATH/classes/kohana/spoutexcel.php [ 70 ]
What am I doing wrong?
Spout can be found here: https://github.com/box/spout