• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Library cross load issue

#1
using ci 3.1.10

foo_library.php
PHP Code:
public function __construct() {
$ci =$ get_instance();
$ci->load->library('bar_library');



bar_library.php
PHP Code:
public function __construct() {
$ci =$ get_instance();
$ci->load->library('foo_library');



no problem in 3.1.6

but 3.1.10, infinity load library. Huh

23
0.0267
1406784
Foo_library->__construct( )
.../Loader.php:1285


24
0.0268
1411640
CI_Loader->library( )
.../Foo_library.php:23


25
0.0268
1411640
CI_Loader->library( )
.../Loader.php:202


26
0.0268
1411640
CI_Loader->_ci_load_library( )
.../Loader.php:218


27
0.0268
1412440
CI_Loader->_ci_init_library( )
.../Loader.php:1083


28
0.0268
1412544
Bar_library->__construct( )
.../Loader.php:1285


29
0.0268
1412544
CI_Loader->library( )
.../Bar_library.php:20


30
0.0268
1412544
CI_Loader->_ci_load_library( )
.../Loader.php:218


31
0.0268
1412624
CI_Loader->_ci_init_library( )
.../Loader.php:1063


32
0.0268
1412720
Foo_library->__construct( )
.../Loader.php:1285


33
0.0269
1412720
CI_Loader->library( )
.../Foo_library.php:23


34
0.0269
1412720
CI_Loader->library( )
.../Loader.php:202


35
0.0269
1412720
CI_Loader->_ci_load_library( )
.../Loader.php:218


36
0.0269
1412816
CI_Loader->_ci_init_library( )
.../Loader.php:1063


37
0.0269
1412920
Bar_library->__construct( )
.../Loader.php:1285


38
0.0269
1412920
CI_Loader->library( )
.../Foo_library.php:20
Reply

#2
@resuki,

Instead of...

$ci =$ get_instance();

You should have...

$CI =& get_instance();

Documentation ( https://www.codeigniter.com/user_guide/g...ur-library )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.