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

Fatal error: Uncaught Error: Access to undeclared static property: Phalcon\Di::$_default #12110

Closed
oupula opened this issue Aug 8, 2016 · 2 comments
Labels
duplicate Duplicate issue. The duplicate issue is referenced in the comments

Comments

@oupula
Copy link

oupula commented Aug 8, 2016

( ! ) Fatal error: Uncaught Error: Access to undeclared static property: Phalcon\Di::$_default in D:\website\test\applications\common\config\service.php:22 
Stack trace: 
#0 [internal function]: Phalcon\Di->__construct() 
#1 D:\website\test\applications\common\config\service.php(22): Phalcon\Di\FactoryDefault->__construct() 
#2 D:\website\test\backend\index.php(21): include('D:\\website\\test\\...') 
#3 {main} Next Error: Access to undeclared static property: Phalcon\Di::$_default in D:\website\test\applications\common\config\service.php on line 22

Provide minimal script to reproduce the issue

<?php
use Phalcon\Di;
use Phalcon\Di\FactoryDefault;
use Phalcon\Tag;
use Phalcon\Mvc\Url;
use Phalcon\escaper;
use Phalcon\Http\Response;
use Phalcon\Http\Request;
use Phalcon\Mvc\Application;
use Phalcon\Mvc\View;
use Phalcon\Mvc\View\Engine\Volt;
use Phalcon\Db\Adapter\Pdo\Mysql as DB;
use Phalcon\Events\Manager as EventsManager;
use Phalcon\Mvc\Dispatcher as MvcDispatcher;
use Phalcon\Db\Profiler as DbProfiler;
use Phalcon\Logger;
use Phalcon\Logger\Formatter\Line as LineFormatter;
use Phalcon\Logger\Adapter\File as FileAdapter;
use Phalcon\Mvc\Model\Transaction\Manager as TransactionManager;
use Phalcon\Text;

$di = new \Phalcon\DI\FactoryDefault();

Details

  • Phalcon version:3.0.0
  • PHP Version:7.0.7
  • Operating System:Windows 10 / Apache 2.4 x64 (php7_module) / PHP 7.07 x64
  • Installation type:phalcon_x64_vc14_php7.0.0_3.0.0_nts.zip
  • Server: Apache
@Dublerq
Copy link

Dublerq commented Aug 8, 2016

What's the point of use Phalcon\Di\FactoryDefault; if you use $di = new \Phalcon\DI\FactoryDefault(); ?

Nevertheless DI\FactoryDefault is designed to be created only once. I suspect that you might have created another FactoryDefault instance before, and you're trying to make another one.

Phalcon php5.6, Windows 7, couldn't reproduce

@sergeyklay
Copy link
Contributor

#12056

@sergeyklay sergeyklay added the duplicate Duplicate issue. The duplicate issue is referenced in the comments label Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate issue. The duplicate issue is referenced in the comments
Projects
None yet
Development

No branches or pull requests

3 participants