Repo for the search and displace core module including the interface to select files and search and displace operations to run on them.
https://searchanddisplace.com
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
836 B
36 lines
836 B
<?php
|
|
|
|
namespace App\SearchDisplace\Searchers;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
abstract class SearcherCreator
|
|
{
|
|
protected $name;
|
|
protected $id;
|
|
protected $description;
|
|
protected $rows;
|
|
protected $storage;
|
|
|
|
public function __construct($name, $description)
|
|
{
|
|
$this->name = $name;
|
|
$this->description = $description;
|
|
$this->id = md5(uniqid(rand(), true));
|
|
$this->storage = Storage::disk('local');
|
|
}
|
|
|
|
abstract public function create();
|
|
|
|
protected function store()
|
|
{
|
|
$contents = [
|
|
'id' => $this->id,
|
|
'name' => $this->name,
|
|
'description' => $this->description,
|
|
'rows' => $this->rows,
|
|
];
|
|
|
|
$this->storage->put("searchers/{$this->id}_{$this->name}.json", json_encode($contents));
|
|
}
|
|
}
|