fresh Posted May 2, 2007 Share Posted May 2, 2007 Hello, I am very new to PHP and I am trying to get a CMMS written in PHP working. I have tracked the execution and have found it stops on this line of code: return $this->templates["login"]->blocks["Login"]->output; I'm not sure what "blocks" is, I cant find this in the templates class. Should this be a function? Also what is ->output? Is this a PHP function or variable? Can anyone direct me to a good PHP langauge source? I am using PHP 5 and I think this app was written in pre PHP 5 days. -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/49586-solved-execution-stops/ Share on other sites More sharing options...
trq Posted May 2, 2007 Share Posted May 2, 2007 That line is useless to us without context. If you really think this is a bug in the application, I suggest you post your question (with more details ie filename) to a help forum specifically catering toward whatever CMS it is your using. Quote Link to comment https://forums.phpfreaks.com/topic/49586-solved-execution-stops/#findComment-243100 Share on other sites More sharing options...
fresh Posted May 2, 2007 Author Share Posted May 2, 2007 I understand that this has no context I was just asking if anyone could see an simple syntax error. Secondly Its a CMMS and not a CMS. The reason why I'm not posting on a more relevant forum is because there is none. The CMMS is located @ http://www.maintenance-software.org/. Maybe someone knows of a forum or is familiar with this application. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/49586-solved-execution-stops/#findComment-243107 Share on other sites More sharing options...
trq Posted May 2, 2007 Share Posted May 2, 2007 Actually, there may be a problem there. I thought you may be able to get away with that but apparently not. This code won't work for me either. [code] #!/usr/bin/php <?php class b { function foo() { echo "here is foo"; } } class a { function c() { return new b(); } } $a = new a(); $a->c->foo(); ?> [/code] Have you got error reporting switched on? Quote Link to comment https://forums.phpfreaks.com/topic/49586-solved-execution-stops/#findComment-243122 Share on other sites More sharing options...
fresh Posted May 2, 2007 Author Share Posted May 2, 2007 I have error_reporting = E_ALL and display_errors = ON in the php.ini. I am also logging errors, but nothing seems to show up in the logs. This error is in the creation of the layout and login page so it may be showing the error but I don't see anything. Again I am very new to PHP so I may have other config settings wrong. Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/49586-solved-execution-stops/#findComment-243232 Share on other sites More sharing options...
fresh Posted May 3, 2007 Author Share Posted May 3, 2007 Ok I solved the problem, Its a bit vague, but I read a forum post about PHP5 migration and its something to do with not using "$this" as this will cause a problem. The post was a bit unclear and I don't know why, Ive only been into PHP for 3 days now. So I did a find and replace $this to $_this and its all good now. This is what the line of code looks like now: return $_this->templates["login"]->blocks["Login"]->output; Does anyone understand this issue. I will post here if I find out why. Thanks for your help thorpe. Quote Link to comment https://forums.phpfreaks.com/topic/49586-solved-execution-stops/#findComment-244031 Share on other sites More sharing options...
trq Posted May 3, 2007 Share Posted May 3, 2007 Does anyone understand this issue. Does this line of code appear within a class? Have you a link to the post? Quote Link to comment https://forums.phpfreaks.com/topic/49586-solved-execution-stops/#findComment-244038 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.