KKoPV / PVLng

PhotoVoltaic Logger new generation, a logging and data warehouse system for measuring data of sensors and photovoltaic plants, see
http://pvlng.com
Other
8 stars 2 forks source link

Windows: Loader fails to create classmap #36

Open andig opened 9 years ago

andig commented 9 years ago

I'm trying to get pvlng running on Windows. I've created a vhost in apache:

Listen 81

<VirtualHost *:81>
    ServerName localhost
    DocumentRoot "c:/htdocs/PVlng"

    <Directory "c:/htdocs/PVlng">
        DirectoryIndex index.html index.php
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    LogLevel debug

    ErrorLog "logs/pvlng.log"
    CustomLog "logs/pvlng-access.log" common
</VirtualHost>

Any access to :81 results in error 500, logfiles remain empty of any error messages.

Source of the problem seem to be the rewrite rules in /.htaccess. As soon as those are commented out directory index is loaded.

Any idea if/which problem that might be?

andig commented 9 years ago

Finally found that the problem is not due to .htaccess but to invalid classmap being generated on Windows. With classmap invalid, loader fails loading slimmvc\Config.

So the real issue is: classmap generation broken on Windows.

K-Ko commented 9 years ago

I think this line do not work on Windows.

Could you please change to

                                $pattern = str_replace('%s', '([\w/\\\\]+)', $pattern);

and test?!

K-Ko commented 9 years ago

Could you checkout the development branch and re-install?!

You have to recreate the database also...

andig commented 9 years ago

Fixing the line as suggested does not help- classmap remains empty. I've simply changed it like this (obviously missing functionality there):

if (!$file->isDir()) {
    $filename = str_replace($path.DS, '', $file->getPathname());
    $classname = str_replace('.php', '', $filename);
    if ($classname) {
        self::$ClassMap[$classname] = $name;
    }
K-Ko commented 9 years ago

Ok,

from 3.0.0 composer class loading is used and should handle Windows correctly.