HowTo enable/show debug output while installing a module ??

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
ghostrifle
Forum Members
Forum Members
Posts: 54
Joined: Wed Mar 02, 2005 11:03 pm

HowTo enable/show debug output while installing a module ??

Post by ghostrifle »

Hey there,

I have stupid error somewhere in my adodb code while installing my module. The problem is now I can't find the error. So I tried to enable debugging etc... but there' no output available during installing / uninstalling a module.

There' for sure an option or something similar... so.. please tell me ;)

uhhmm.. and is there a "global debugging variable" ??

Bye, ghostrifle
User avatar
ghostrifle
Forum Members
Forum Members
Posts: 54
Joined: Wed Mar 02, 2005 11:03 pm

Re: HowTo enable/show debug output while installing a module ??

Post by ghostrifle »

Well,

this line of code just enables reporting on all php errors. But I think this is not the problem I have... In my install() method of my module, I'm creating several tables.. and one of it doesn't gets created. So, now I want to see the ADODB debug messages with turning on $this->cms->db to true. Well, doing this on normal module output works except in the install() method.

Code: Select all

	/**
	* method which gets called by the plugin-manager of CMS to install the module
	*/
	function Install()
	{
		error_reporting  (E_ALL);
		$this->setupVars();
		
		$db = $this->cms->db;
		$db->debug = true;
		
		//creating ADODB dictionary
		//for reading: http://phplens.com/lens/adodb/docs-datadict.htm
		$dict = NewDataDictionary($db);

		//what type of table and database do we use ??
		$tabletype = array('mysql' => 'TYPE=MyISAM');

		// we need another table for our reselling stuff...dvds etc
                // this is the table which causes me problems!
		$fields ="
			id I KEY AUTO,
			review_fk I,
			img_logo C(255),
			text X,
			url C(255)
			";	
		$sqlarray = $dict->CreateTableSQL(cms_db_prefix(),"module_moviereview_reselling",$fields,$tabletype);
		if($sqlarray == false)
			return false;

		if($dict->ExecuteSQLArray($sqlarray) == 0)
			return false;
              etc.......
The only error I'm getting is in my php log files:

Code: Select all

[client 127.0.0.1] PHP Warning:  implode(): Bad arguments. in /var/www/asia-addi ct/lib/adodb/adodb-datadict.inc.php on line 660, referer: http://localhost/asia- addict/admin/plugins.php
Well but the code runs.... so I wanted to see whole output generated by adodb....  any suggestions ??

ghostrifle
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: HowTo enable/show debug output while installing a module ??

Post by Ted »

Turn on debug in config.php
Post Reply

Return to “Developers Discussion”