Dear maintainer
I, Yukari, like to thank you for hard work and reporting some strange behavior of phel/sql.
The case :
I use phel.sql as web app its work well when using php -S localhost:8080 -t public, I see no problem. Meanwhile in compiled form the translation into PHP, I encounter some error at out/phel/sql.php line 107 the translation of this line, it said :
Uncaught RuntimeException: Cannot locate sql/util for (load ...).
The code :
$__phelLoadKey = "sql/util";
$__phelCallerDir = "phel";
$__phelLoadPath = null;
$__phelSibling = __DIR__ . DIRECTORY_SEPARATOR . $__phelLoadKey . '.php';
if (file_exists($__phelSibling)) {
$__phelLoadPath = $__phelSibling;
}
if ($__phelLoadPath === null) {
$__phelSrcDirs = \Phel\Compiler\Domain\Analyzer\Resolver\LoadClasspath::read();
$__phelFullKey = $__phelCallerDir === '' ? $__phelLoadKey : $__phelCallerDir . '/' . $__phelLoadKey;
foreach ($__phelSrcDirs as $__phelSrcDir) {
foreach ([$__phelFullKey, $__phelLoadKey] as $__phelAttempt) {
$__phelCandidatePhp = $__phelSrcDir . '/' . $__phelAttempt . '.php';
if (file_exists($__phelCandidatePhp)) { $__phelLoadPath = $__phelCandidatePhp; break 2; }
$__phelCandidatePhel = $__phelSrcDir . '/' . $__phelAttempt . '.phel';
if (file_exists($__phelCandidatePhel)) { $__phelLoadPath = $__phelCandidatePhel; break 2; }
}
}
}
This issue was tackled :
- changing
$__phelSibling = __DIR__ into $__phelSibling = dirname(__DIR__), or
- manually move
out/sql into out/phel so it turned into out/phel/sql
The latter way is preferred. Type of phenomenon only rise in compiled form while its not trigger in interpreted evaluation.
My assumption this happen because src/sql.phel from phel-sql not moved to out/phel, and the out/phel/sql.phel trying load sql/utils while thinking there sql folder are in same directory as itself. It not found since sql/utils.phel located at out directory not out/phel.
Thank you, End of report.
Dear maintainer
I, Yukari, like to thank you for hard work and reporting some strange behavior of phel/sql.
The case :
I use phel.sql as web app its work well when using
php -S localhost:8080 -t public, I see no problem. Meanwhile in compiled form the translation into PHP, I encounter some error atout/phel/sql.phpline 107 the translation of this line, it said :The code :
This issue was tackled :
$__phelSibling = __DIR__into$__phelSibling = dirname(__DIR__), orout/sqlintoout/phelso it turned intoout/phel/sqlThe latter way is preferred. Type of phenomenon only rise in compiled form while its not trigger in interpreted evaluation.
My assumption this happen because
src/sql.phelfrom phel-sql not moved toout/phel, and theout/phel/sql.pheltrying loadsql/utilswhile thinking theresqlfolder are in same directory as itself. It not found sincesql/utils.phellocated atoutdirectory notout/phel.Thank you, End of report.