hoaproject / Core

The Hoa\Core library.

Home Page:https://hoa-project.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warning: fwrite() expects parameter 1 to be resource, boolean given in .../Hoa.central/Hoa/Core/Protocol.php on line 844

1e1 opened this issue · comments

commented

As I didn't found Embryo.git, I start a Hoa project from scratch. I didn't use the "whereishoa" command.

My first lines are:

<?php

define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__DIR__));

require ROOT.DS.'Hoa.central'.DS.'Hoa'.DS.'Core'.DS.'Core.php';


from('Hoa')
-> import('File.Write')
;

from('Hoathis')
-> import('Hero.Identity~')
-> import('Hero.Unit.Uuid')
;


event('hoa://Event/Exception')->attach(new Hoa\File\Write('hoa://Data/Variable/Exception.log'));

Then I throw an exception:

throw new \Hoa\Core\Exception('undefined "%s"', crc32(__METHOD__), [$name]);

But if I change 'hoa://Data/Variable/Exception.log' to 'Exception.log', it works.
Where I have to map 'hoa://Data/Variable' to a real path?
Perhaps; you should add a thrown exception if an unregistered stream is used?

I have to write:

$hoa = Hoa\Core\Core::getInstance();
$hoa->setProtocol('hoa://Application/Public', ROOT);
$hoa->setProtocol('hoa://Data', dirname(__ROOT__).DS.'Data');
`̀``
Is it suffisant for all hoa://Data/* paths? 
commented

It could be in the same issue.

I remove $hoa->setProtocol(...);
I change from('Hoathis')->import(... to from('Devengers')->import(...

My files are as:

+ Hoa.central
+ MyWebSite
+ Data
  + Etc/*
  + Library
    + Devengers
      - Hero/*
  + Lost+found
  + Temporary
  + Variable
    - Cache
    - Database
    - Log (chmod 777)
    - Private
    - Run
    - Test

My Hero's classes are found.
It seems be the default tree.
But the issue about Protocol.php is still here.

Hello :-),

What do you want to achieve exactly?

commented

Solved on IRC, thx Hywan! \o/

And if Data/Library is invalid, it's because I had neither Hoa nor Hoathis in this directory :/