anlutro / php-curl

Simple PHP curl wrapper class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change "cURL" to "curl" or "Curl"

anlutro opened this issue · comments

Needlessly annoying to type. Obviously a breaking change.

Why is this a breaking change? Class names and namespaces are case insensitive. And otherwise you could use use anlutro\cURL\cURL as Curl.

Class names and namespaces are indeed case-insensitive, but composer's autoloader is not.

andreas@oberyn ~/dev/php/test
$ cat composer.json 
{
  "autoload": {
    "psr-4": {
      "Test\\": "src/"
    }
  }
}
andreas@oberyn ~/dev/php/test
$ cat src/Test.php 
<?php
namespace Test;
echo 'loading '.__FILE__."\n";
class Test {}
andreas@oberyn ~/dev/php/test
$ cat test.php 
<?php
require __DIR__.'/vendor/autoload.php';
var_dump(class_exists('test\test'));
var_dump(class_exists('Test\Test'));
andreas@oberyn ~/dev/php/test
$ php test.php 
bool(false)
loading /home/andreas/dev/php/test/src/Test.php
bool(true)