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

[BUG] Locale problem #1095

Closed
tugrul opened this issue Aug 15, 2013 · 11 comments
Closed

[BUG] Locale problem #1095

tugrul opened this issue Aug 15, 2013 · 11 comments

Comments

@tugrul
Copy link
Contributor

tugrul commented Aug 15, 2013

I'm not sure. Maybe this is PHP's bug. There is not problem without change the locale.

setlocale(LC_ALL, 'tr_TR.UTF8');
use Phalcon\DI\FactoryDefault;

gives

Fatal error: Class 'Phalcon\DI\FactoryDefault' not found

I think there is a character problem because 'capital I' equivalent to 'small case ı' and 'capital İ' equivalent to 'small case i

@dreamsxin
Copy link
Contributor

You can say which version you are and what the environment?
I use Phalcon 1.3.0 and PHP 5.4.9 test it, it's returned to normal.

<?php
setlocale(LC_ALL, 'tr_TR.UTF8');
use Phalcon\DI\FactoryDefault;

echo "Everything is OK\n";
return;
```php

@ghost
Copy link

ghost commented Aug 16, 2013

I get the same error:

<?php
use Phalcon\DI\FactoryDefault;

echo "Everything is OK\n";
return;

Then,

$ php tr.php 
Everything is OK

$ LC_ALL=tr_TR.UTF-8 php tr.php 
Can't register interface with parent: phalcon\dispatcherinterface
PHP Fatal error:  Unable to start phalcon module in Unknown on line 0

@dreamsxin
Copy link
Contributor

@sjinks Because I did not has tr_TR.UTF-8 language packs, it is not an error?

@ghost
Copy link

ghost commented Aug 16, 2013

Could be. But the locale has to be set before PHP starts up.

@dreamsxin
Copy link
Contributor

I install tr_TR.UTF-8, execute commands:

$ LC_ALL = tr_TR.Utf-8
bash: warning: setlocale: LC_ALL: cannot change locale (tr_TR.UTF-8)
$ LC_ALL=tr_TR.UTF-8 php test.php
bash: warning: setlocale: LC_ALL: cannot change locale (tr_TR.UTF-8)
Can't register interface with parent: phalcon\dispatcherinterfacePHP Fatal error:  Unable to start phalcon module in Unknown on line 0

But, in file add setlocale(LC_ALL, 'tr_TR.UTF-8'); run is ok.

@ghost
Copy link

ghost commented Aug 16, 2013

Yes, this is has to do something with how Zend stores class names:

stdclass
traversable
Iteratoraggregate
Iterator
arrayaccess
serializable
exception
errorexception
closure
datetime
datetimezone
dateInterval
phalcon\dI\InjectionawareInterface
phalcon\forms\elementInterface
phalcon\mvc\model\validatorInterface
phalcon\validation\validatorInterface
phalcon\events\eventsawareInterface
phalcon\cache\backendInterface
phalcon\cache\frontendInterface
phalcon\mvc\model\metadataInterface
phalcon\db\dialectInterface
phalcon\db\adapterInterface
phalcon\annotations\adapterInterface
phalcon\logger\adapterInterface
phalcon\logger\formatterInterface
phalcon\paginator\adapterInterface
phalcon\mvc\view\engineInterface
phalcon\mvc\model\resultsetInterface
phalcon\mvc\model\behaviorInterface
phalcon\flashInterface
phalcon\mvc\model\resultInterface
phalcon\exception
phalcon\db\adapter
phalcon\dispatcherInterface
phalcon\dI\Injectable

letter 'I' is not lowercased

@dreamsxin what version of PHP do you run?

@ghost
Copy link

ghost commented Aug 16, 2013

Relevant changes in the PHP tree:

The difference is that new PHP versions use zend_tolower_ascii vs zend_tolower.

Unless we always pass lowercased names to PHALCON_REGISTER_(CLASS|INTERFACE)(_EX) there's no way we can fix this.

@dreamsxin
Copy link
Contributor

@sjinks

PHP 5.4.9-4ubuntu2.2 (cli) (built: Jul 15 2013 18:23:35) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

@tugrul
Copy link
Contributor Author

tugrul commented Aug 16, 2013

My PHP version

threedot@flash:~$ php -v
PHP 5.3.23-1~dotdeb.0 with Suhosin-Patch (cli) (built: Mar 25 2013 23:14:06)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH

phalcon pushed a commit that referenced this issue Aug 17, 2013
Fix #1095 (Issues with inheritance in tr_TR locale)
@phalcon
Copy link
Collaborator

phalcon commented Aug 23, 2013

This is fixed in 1.3.0

@phalcon phalcon closed this as completed Aug 23, 2013
@zekiunal
Copy link
Contributor

@tugrul how you fixed this issue?

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

3 participants