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

[3.0] Gettext adapter constructor error #12157

Closed
Zaszczyk opened this issue Aug 21, 2016 · 11 comments
Closed

[3.0] Gettext adapter constructor error #12157

Zaszczyk opened this issue Aug 21, 2016 · 11 comments
Assignees
Labels
bug A bug report status: medium Medium
Milestone

Comments

@Zaszczyk
Copy link
Contributor

I got similar error like #11760:

0 Phalcon\Translate\Adapter\Gettext->prepareOptions(Array([locale] => pl_PL.UTF-8, [directory] => /var/www/xxx/www/apps/config/locale, [defaultDomain] => message))

1 Phalcon\Translate\Adapter\Gettext->__construct(Array([locale] => pl_PL.UTF-8, [directory] => /var/www/xxx/www/apps/config/locale, [defaultDomain] => message))

2 XXX\Plugins\Translation->__construct(Array([locale] => pl_PL.UTF-8, [directory] => /var/www/xxx/www/apps/config/locale, [defaultDomain] => message))

3 Closure->{closure}()

4 Phalcon\Di\Service->resolve(null, Object(Phalcon\Di\FactoryDefault))

5 Phalcon\Di->get(translation, null)

6 Phalcon\Di->getShared(translation)

7 Phalcon\Di\Injectable->__get(translation)

8 Modules\Company\Controllers\ControllerBase->initialize()

9 Phalcon\Dispatcher->_dispatch()

10 Phalcon\Dispatcher->dispatch()

11 Phalcon\Mvc\Application->handle()

My code:

class Translation extends \Phalcon\Translate\Adapter\Gettext
{
    public function __construct(array $options)
    {
        parent::__construct($options);
        ...

}

Details

  • Phalcon version: 3.0.0
  • PHP Version: 7.0.9
  • Operating System: Ubuntu 14.04
  • Installation type: Compiling from source
  • Zephir version (if any): -
  • Server: Apache
@sergeyklay
Copy link
Contributor

Could you please provide Exception message?

@Zaszczyk
Copy link
Contributor Author

Sure, I'm sorry.
Error: Call to private method Phalcon\Translate\Adapter\Gettext::getoptionsdefault() from context 'FitCompany\Plugins\Translation'
in line:
parent::__construct($options);

@sergeyklay
Copy link
Contributor

sergeyklay commented Aug 21, 2016

@Zaszczyk Could you please try test 3.0.x branch?

@Zaszczyk
Copy link
Contributor Author

I have Phalcon 3.0.0, so I've switched to branch 3.0.x

git checkout 3.0.x

made git status:

On branch 3.0.x
Your branch is up-to-date with 'origin/3.0.x'.

and run:

sudo ./install
service apache2 restart

I have still Phalcon 3.0.0 in phpinfo() after compilation, is it right? Because this error is still occurred. Should I upgrade Phalcon another way?

@Jurigag
Copy link
Contributor

Jurigag commented Aug 22, 2016

No, you need to use zephir. Like:

git clone https://github.com/phalcon/zephir
cd zephir
./install -c

go to phalcon repo
zephir build

@sergeyklay
Copy link
Contributor

sergeyklay commented Aug 22, 2016

@Zaszczyk For dev branches you have to use

zephir fullclean
zephir build --backend=ZendEngine3 # For PHP 5 without --backend param

@Jurigag
Copy link
Contributor

Jurigag commented Aug 22, 2016

This --backend is not needed, as far as i know it's only for generating c source for different php version than actual ?

@sergeyklay
Copy link
Contributor

@Zaszczyk

@Zaszczyk
Copy link
Contributor Author

@sergeyklay it works right with 3.0.x.
Little offtopic: what IDE do You use to developing cphalcon? I've installed Zephir plugin to PHPStorm and it looks good, but is there something better maybe?

@Jurigag
Copy link
Contributor

Jurigag commented Aug 23, 2016

Im using phpstorm and it's fine enough.

@sergeyklay
Copy link
Contributor

PHPStorm + Zephir plugin

@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

4 participants