1. Go to this page and download the library: Download bedita/import-tools library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use BEdita\ImportTools\Utility\CsvTrait;
class MyImporter
{
use CsvTrait;
public function import(string $filename): void
{
foreach ($this->readCsv($filename) as $obj) {
// process $obj
}
}
}
use BEdita\ImportTools\Utility\FileTrait;
class MyImporter
{
use FileTrait;
public function read(string $file): void
{
[$fh, $close] = $this->readFileStream($path);
try {
flock($fh, LOCK_SH);
// do your stuff
} finally {
$close();
}
}
}
use BEdita\ImportTools\Utility\TreeTrait;
class MyImporter
{
use TreeTrait;
public function import(string $filename, string $destination): void
{
foreach ($this->readCsv($filename) as $obj) {
$this->setParent($obj, $destination);
}
}
}
use BEdita\ImportTools\Utility\Import;
class MyImporter
{
public function import(string $filename, string $type, ?string $parent, ?bool $dryrun): void
{
$import = new Import($filename, $type, $parent, $dryrun);
$import->saveObjects();
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.