mirror of
https://github.com/slawkens/myaac.git
synced 2026-03-16 16:03:31 +01:00
Nothing important, var name
This commit is contained in:
@@ -6,26 +6,25 @@ use MyAAC\Cache\PHP as CachePHP;
|
|||||||
|
|
||||||
class Items
|
class Items
|
||||||
{
|
{
|
||||||
private string $error;
|
private string $error = '';
|
||||||
|
|
||||||
public function getError(): string
|
public function getError(): string {
|
||||||
{
|
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load(): bool
|
public function load(): bool
|
||||||
{
|
{
|
||||||
$file_path = config('data_path') . 'items/items.toml';
|
$file = config('data_path') . 'items/items.toml';
|
||||||
if (!file_exists($file_path)) {
|
if (!file_exists($file)) {
|
||||||
$this->error = 'Cannot load file ' . $file_path;
|
$this->error = 'Cannot load file ' . $file;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//$toml = file_get_contents($file_path);
|
//$toml = file_get_contents($file);
|
||||||
//$items = \Devium\Toml\Toml::decode($toml, asArray: false);
|
//$items = \Devium\Toml\Toml::decode($toml, asArray: false);
|
||||||
|
|
||||||
$itemsParser = new ItemsParser();
|
$itemsParser = new ItemsParser();
|
||||||
$itemsParsed = $itemsParser->parse($file_path);
|
$itemsParsed = $itemsParser->parse($file);
|
||||||
|
|
||||||
$items = [];
|
$items = [];
|
||||||
foreach ($itemsParsed as $item) {
|
foreach ($itemsParsed as $item) {
|
||||||
|
|||||||
Reference in New Issue
Block a user