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

locale #2

Closed
cyrille38 opened this issue Nov 5, 2011 · 9 comments
Closed

locale #2

cyrille38 opened this issue Nov 5, 2011 · 9 comments
Labels
Milestone

Comments

@cyrille38
Copy link

App::import('Lib', 'Locale.Locale');

doesn't work

@quickapps
Copy link
Owner

¿What are you trying to do?
¿How can I reproduce this issue?
¿Why do you need to include this class anyway?
Locale class is just a utility library used by some Modules to list languages names and other listing realted to languages such as countries.


App::import('Lib', 'Locale.Locale'); seems to work in the lastest version of QA.

    App::import('Lib', 'Locale.Locale'); 
    pr(Locale::languages()); // print a list of languages

(Also it is a Plugin Class, you can not import this class without loading/register the Plugin before, so if you are tring to import it in bootstrap then will fail)


I think this topic is related to cakePHP API and not QuickApps API, more info here:
http://book.cakephp.org/2.0/en/core-utility-libraries/app.html?highlight=app%3A%3Aimport#App::import

@ghost ghost assigned quickapps Nov 5, 2011
@cyrille38
Copy link
Author

in the admin page, in language tab
admin/locale/languages

i've got this error
Fatal error: Call to undefined method Locale::languages() in /app/Plugin/Locale/Controller/LanguagesController.php on line 144

also in /user/register
Fatal error: Call to undefined method Locale::time_zones() in /app/Plugin/User/View/User/register.ctp on line 13

@quickapps
Copy link
Owner

Interesting,
Class is being properly loaded, undefined method means that class exists but not the requested method.
¿is the content of the corresponding .php file ok? (app/Plugin/Locale/Lib/Locale.php)

  • Try do add a die("HERE"); at the begining of that file, and watch if the "HERE" message appears in admin/locale/languages and /user/register, in order to verify that .php file is being properly loaded.
  • Also, try to add App::uses('Locale', 'Locale.Lib') before each App::import() in the code.
  • ¿Have you verify this issue on other servers?
  • ¿Is you QuickApps copy up to date (lastest = 58257f8)?

I have tested fresh installations in different servers and O.S; all they seems to work properly.
Also demo site seems to work ok.

I'll leave this ticket open in case anyone else has this same problem.

@cyrille38
Copy link
Author

i try on php 5.2.9, it's works, thanks

doesn't work on PHP Version 5.3.3-7+squeeze1

@quickapps
Copy link
Owner

This is probably a CakePHP bug/issue, you can open a ticket in cake's lighthouse and explain it.

Closing as resolved

@analogrithems
Copy link
Contributor

I get this same issue when I click on the configuration tab. My version of php is also 5.3.3. I'll try to post this bug back to cake.

@quickapps quickapps reopened this Jan 11, 2012
@quickapps
Copy link
Owner

Great, thanks!
Did you try to do the steps described on the previous comment ?
And try to see what may be the cause.

Now I Am using 5.3.8, but I'll try to downgrade a 5.3.3 on my local machine and check what is going on.

@analogrithems
Copy link
Contributor

ya, i added CakePlugin::load('Locale'); to app/Config/bootstrap.php and put App::import('Lib', 'Locale.Locale');
in /home/asynonymous/vault.asynonymous.net/htdocs/cms/app/Plugin/System/View/Configuration/admin_index.ctp

no dice. I verified that the plugin is being loaded.
" PHP Fatal error: Call to undefined method Locale::time_zones() "

@analogrithems
Copy link
Contributor

It looks like the issue is that in PHP 5.3 their was an actual Locale class introduced see
http://php.net/manual/en/class.locale.php
so when you import that class, nothing happens,

I confirmed it by changing the class Locale.Locale to Locale.QALocale and even extended the built-in locale class

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

No branches or pull requests

4 participants