• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

Is it possible to have variable or something with out $ symbol ?

I have cakephp application working fine through browser etc., but when I run cron way calling some controller (cron) , I get the below error on this line,

error line -> DEBUG=3;
return $config['Cake.version'] = '2.0.0-dev';

2 ->PHP Parse error:  syntax error, unexpected '=' in /var/www/xxxx/core/cake/config/config.php on line 19

"DEBUG " is it constant or variable ?
0
Loganathan Natarajan
Asked:
Loganathan Natarajan
  • 2
  • 2
  • 2
  • +3
6 Solutions
 
Michel PlungjanIT ExpertCommented:
Show the code. It does not look correct
In php you have VARs with $ but not FUNCTIONs with $
so
$somevar = config($someparm);
0
 
Loganathan NatarajanLAMP DeveloperAuthor Commented:
thanks, check the attachment.full code
0
 
Jagadishwor DulalBraces MediaCommented:
It may be the constant value written in the  config Like below:
Configure::write('debug', 3);

Open in new window

0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Dave BaldwinFixer of ProblemsCommented:
If that's in the 'configure.php' file, yours does not match what I just downloaded.  If this is a new installation, you should look at getting a newer version of CakePHP.  https://github.com/cakephp/cakephp/tags
0
 
Michel PlungjanIT ExpertCommented:
Here is an example of a core configuration file

https://github.com/cakephp/cakephp/blob/master/app/Config/core.php

There is no way your statement would work in PHP regardless of framework in my opinion
0
 
Dave BaldwinFixer of ProblemsCommented:
I agree with @mplungjan, I don't see how it would ever work.
0
 
Jagadishwor DulalBraces MediaCommented:
Better one to reinstall the cakephp framework
0
 
Loganathan NatarajanLAMP DeveloperAuthor Commented:
Thanks to all, let me check & back.
0
 
hieloCommented:
>>or something with out $ symbol ?
In PHP, variables have the '$' prefix, but constants do not.  So, to set DEBUG to 3 (without the '$') you would need to use define():

<?php
define('DEBUG',3);//After this line DEBUG is a constant - you cannot reassign a value to it
echo DEBUG; //should show 3
?>

Open in new window

0
 
Ray PaseurCommented:
Agree with Dave -- reinstall Cake!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now