CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 CCS 5.0.0.15750 (demo): Parse Error / Syntax Error

Print topic Send  topic

Author Message
abbymsmith

Posts: 23
Posted: 05/04/2012, 6:07 PM

Hi All,

I used Codecharge Studio 4 to develop a reservations system several years ago which is still in production today, but in need of an upgrade. I was so excited to see the new version of CodeCharge as I think many of the new features are exactly what I need. I downloaded the trial version (CCS 5.0.0.15750), but I'm having trouble getting even a simple test page to work.

After publishing a test page (grid for a single table) I'm getting the following error: "Parse error: syntax error, unexpected '=', expecting ')' in /homepages/10/d355560415/htdocs/res40dev/Common.php on line 1713"

My Local environment:
Windows 7 Home Premium 64 bit
MySQL 5.5

My Server (managed server where I publish pages to test):
Linux infong 2.4
PHP 4.4.9 (more info can be seen here www.mothermeeradev.com/hello.php -- this script runs phpinfo();)
MySQL 5.0

I have set the PHP version to 4.x in the codecharge project settings.

When setting up the server database connections I tried both making the host "localhost:/tmp/mysql5.sock" and setting the host to be "localhost" and the port/Socket to be "/tmp/mysql5.sock". (On my server the host is localhost and the socket is /tmp/mysql5.sock, but I've been told the socket can also be appended to the hostname as in the first example - not quite sure how codecharge wants this info, or if it's even related to the problem, so this may be a red herring). I still got the same error above in both cases.

I tried removing all designs / templates (I had been trying to use a template from Artisteer and wondered if that might be causing the issue) but even when I create a new vanilla project I get the same error.

I sent a message to Yes support but haven't heard back yet -- thought I'd try posting here in case someone has had the same issue or can give me some ideas to try. (Really want to get this working!)

Thanks,
Abby
View profile  Send private message
Lucius

Posts: 220
Posted: 05/07/2012, 1:50 AM

Hi,

And have you checked the Common.php on line 1713 ?

Most likely it is a case of some typo in some object properties, which is then passed to some common routines in this file. Usually it is easy to pinpoint the issue if you check the mentioned file...
View profile  Send private message
abbymsmith

Posts: 23
Posted: 05/07/2012, 6:33 AM

Thank you for your reply! I did check the code, but unfortunately that had about the same effect as me opening up the hood of my car to see what the problem is. (I'm a data architect / dba by trade, and only a very mediocre (at best) coder. This is why I need CodeCharge :-/ )

Here is the code starting from line 1712:

//CCGetTemplate @0-E585C61B
function & CCGetTemplate(& $Component = null) {
global $Tpl;
if ($Component == null) return $Tpl;
$parent_page = & CCGetParentPage($Component);
if (!isset($parent_page->Tpl) || !is_a($parent_page->Tpl, "clsTemplate")) { return $Tpl; }
else { return $parent_page->Tpl; }
}
//End CCGetTemplate

So line 1713 is "function & CCGetTemplate(& $Component = null)"

Is there an obvious, glaring error staring me in the face? For some reason I thought comments.php, classes.php, etc. were files that we weren't supposed to edit directly in codecharge... but maybe I'm setting something up wrong that's causing it to generate wrong.

I have gotten different variations on the same error when I've tried different things in the project settings (either an error on a different line of Common.php or another file I've generated) -- but always the same parse / syntax error.

Any help greatly appreciated.
View profile  Send private message
Lucius

Posts: 220
Posted: 05/08/2012, 1:50 AM

Hi,

Those files are auto-generated by CCS, however they use parameters that are passed from your code, or properties of objects you create/set in CCS. So sometimes you will get an error that will reference only to Common.php, even though the reason for this error is somewhere else.

As for code you have quoted. For me this function is little different:

//CCGetTemplate @0-D8640D95  
function & CCGetTemplate(& $Component = null) {  
    global $Tpl;  
    if ($Component == null) return $Tpl;  
    $TplClassName = "clsTemplate";  
    $parent_page = & CCGetParentPage($Component);  
    if (!isset($parent_page->Tpl) || !($parent_page->Tpl instanceof $TplClassName)) { return $Tpl; }   
    else { return $parent_page->Tpl; }  
}  
//End CCGetTemplate 

Different line is here: $TplClassName = "clsTemplate";

I have however different version of CCS than you do: 5.0.0.15521, so this might be the reason of your issues.

Or it might be the PHP version. This is actually most probable reason. I run 5.x version. If possible upgrade on local machine and give it a try...

Another reason might be that I use a folder to store templates. Go to Settings -> Server/Script and there you will find "Template folder" property. Try changing it to for example "/templates/" and rebuild your whole project (F9). A long-shot but maybe this will help...
View profile  Send private message
abbymsmith

Posts: 23
Posted: 05/11/2012, 8:59 AM

So my friend ran my common.php file through a generic php syntax checker and got the same syntax error. He removed the second & from line 1713 (in my common.php file) and it checked out fine in the syntax checker.

In other words he changed:

function & CCGetTemplate(& $Component = null) {

to

function & CCGetTemplate( $Component = null) {


I made the same change in my common.php file and published the project and now it works. (??). So I guess this is resolved but I feel a little uncomfortable knowing that I'm potentially going to have to be debugging the common files while I develop? Also, I'm not sure exactly why we made this change as it appears the same & is correct in your code above. Yes never answered my support request on this topic.


View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.