CodeIgniter Forums
Importing class file in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Importing class file in CI (/showthread.php?tid=11656)



Importing class file in CI - El Forum - 09-18-2008

[eluser]Computerzworld[/eluser]
Hello,
I am having one class that is created in traditional PHP and using adodb for database connection. I want to use this class in my controller. Is it possible to do so? If yes then how? Please tell me. Thanks in advance.


Importing class file in CI - El Forum - 09-18-2008

[eluser]xwero[/eluser]
put it in the application/libraries directory and load it like a CI library.


Importing class file in CI - El Forum - 09-18-2008

[eluser]Sumon[/eluser]
[quote author="xwero" date="1221764422"]put it in the application/libraries directory and load it like a CI library.[/quote]
xwero,
i have one question in my mind. shall i have to exclude database from my config\autoload?
Code:
$autoload['libraries'] = array('session', 'email');  //removed 'database'
if not then there will be two active database connection. One CI and another adobd. and both are active at the same time. Right?


Importing class file in CI - El Forum - 09-18-2008

[eluser]Computerzworld[/eluser]
ya i am facing this issue as sumon has said...
i tried to include my class in CI as library but as soon as I included it the page goes blank...
i don't know what should be the problem behind this...


Importing class file in CI - El Forum - 09-18-2008

[eluser]xwero[/eluser]
So you have altered the class to use CI database functions? Then i would recommend you use it as a model.


Importing class file in CI - El Forum - 09-19-2008

[eluser]Sumon[/eluser]
[quote author="Computerzworld" date="1221813755"]ya i am facing this issue as sumon has said...
i tried to include my class in CI as library but as soon as I included it the page goes blank...[/quote]
from my experience this is always tough to find out the problem when there are no warning or error but the page is blank. however, i found two situations where the page display blank. First when there is an include file name and the file path or file name is incorrect. and secondly when there is php 5 coding(use of static variable or etc) and the server version is 4. These are from my non CI development experience.