Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Loader fails to create classmap #36

Open
andig opened this issue Jul 2, 2015 · 5 comments
Open

Windows: Loader fails to create classmap #36

andig opened this issue Jul 2, 2015 · 5 comments
Assignees
Milestone

Comments

@andig
Copy link

andig commented Jul 2, 2015

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
Copy link
Author

andig commented Jul 6, 2015

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
Copy link
Member

K-Ko commented Jul 6, 2015

I think this line do not work on Windows.

Could you please change to

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

and test?!

@K-Ko
Copy link
Member

K-Ko commented Jul 6, 2015

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

You have to recreate the database also...

@K-Ko K-Ko self-assigned this Jul 6, 2015
@andig
Copy link
Author

andig commented Jul 7, 2015

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;
    }

@andig andig changed the title Windows: Apache 2.4 setup impossible due to rewrite rules Windows: Loader fails to create classmap Jul 7, 2015
@K-Ko K-Ko added this to the v3.0.0 milestone Jul 7, 2015
@K-Ko
Copy link
Member

K-Ko commented Jul 7, 2015

Ok,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants