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

Class path problem with case sensitive file system #2

Open
yookoala opened this issue Jul 27, 2020 · 0 comments · May be fixed by #3
Open

Class path problem with case sensitive file system #2

yookoala opened this issue Jul 27, 2020 · 0 comments · May be fixed by #3

Comments

@yookoala
Copy link

Problem

  1. The directories in this repository is named in small cases (''linq/factory", "linq/helper") but the namespace names used are capitalized ("Linq/Factory", "Linq/Helper")
  2. The composer autoloader loads the file by matching the namespace path to the directory path. The directory path resolves depends on the file system.
  3. Most filesystem are designed to be case sensitive (i.e. APFS of macOS, bascially all filesystem in Linux of Unix).
  4. Since (1), the autoloader cannot find the small cap directories by the capitalized namespace .

Example

<?php

require 'vendor/autoload.php';

$linq = LinqFactory::createLinq();
    return $linq->from([
     ['name' => 'Alice'],
     ['name' => 'Bob'],
   ]);

If you are running this on a case sensitive file system (i.e. macOS, Linux, or most system other than Windows), you will run into this error:

Class 'Linq\Factory\JoinFactory' not found
in vendor/linq/php-linq/linq/LinqFactory.php line 25

Solution

Just rename capitalize all directories within "linq" folder.

yookoala added a commit to yookoala/php-linq that referenced this issue Jul 27, 2020
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

Successfully merging a pull request may close this issue.

1 participant