SOLUTION:Fresh install & Receiving " T_PAAMAYIM_NEKUDOTAYIM"

Technical Information on PHP scripting language

Moderator: Admin

SOLUTION:Fresh install & Receiving " T_PAAMAYIM_NEKUDOTAYIM"

Postby Joshua Walker » Sun Oct 30, 2011 1:18 am

Hi guys,

Before you read this post, this is my first post and I am 16 years of age so please don't jump the gun if this is something that you guys are already aware of.

Although, I downloaded OrangeHRM today and installed it on to my web server (fresh install) and the installation went successful. However, after installing the script I couldn't physically use the script as the script was returning me to an error page which stated "Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ']'"

I researched in to this and people said it was because I needed to upgrade my PHP version although, after tampering with the code I found a solution without the need to upgrade.

The actual error was being outputted from line 65 within the "orangehrmPostExecutionFilter.php".
Can be found in: "/symfony/plugins/orangehrmCorePlugin/lib/filter"

The way I resolved the parse error was by locating line 65 within the file above and you should notice this syntax of code:

Code: Select all
}

                if (isset($messages[$serviceInstance::getState()])) {
                    MessageRegistry::instance()addMessage($messages[$serviceInstance::getState()], $module, $action);
                }


The way I fixed this issue was by making the following modification below:

Code: Select all
}

                if (isset($messages[$serviceInstance->getState()])) {
                    MessageRegistry::instance();addMessage($messages[$serviceInstance->getState()], $module, $action);
                }


I replaced $serviceInstance::getState() with $serviceInstance->getState() and also on the line underneath I added a semi-colon after the function called Instance()

Finally, on the same line once again I replaced [$serviceInstance::getState()] to [$serviceInstance->getState()]

and boom I re-uploaded the file and the script now works! :)

I hope this comes in useful for people how have this error when attempting to log-in to the script for the first time after the installation process.

Many thanks,

Joshua Walker.
Joshua Walker
 
Posts: 3
Joined: Sun Oct 30, 2011 1:03 am

Re: SOLUTION:Fresh install & Receiving " T_PAAMAYIM_NEKUDOTAYIM"

Postby shaunb » Mon Oct 31, 2011 8:11 am

We are thrilled to see you being 16, using the system.
Your inputs are so helpful to us and the community. Thanks and continue to helps us.
shaunb
 
Posts: 162
Joined: Tue Sep 06, 2011 3:41 pm

Re: SOLUTION:Fresh install & Receiving " T_PAAMAYIM_NEKUDOTAYIM"

Postby Gayanath » Thu Nov 03, 2011 4:26 pm

Hi Joshua,

Thanks for the fix. It's implemented in OrangeHRM trunk at revision 8681 and will be available in OrangeHRM 2.6.12.
Gayanath
 
Posts: 111
Joined: Fri Aug 01, 2008 11:05 am

Re: SOLUTION:Fresh install & Receiving " T_PAAMAYIM_NEKUDOTAYIM"

Postby elam » Thu Dec 08, 2011 3:55 pm

Thanks dude .. it works perfect :)

Elam
elam
 
Posts: 1
Joined: Thu Dec 08, 2011 3:45 pm

Re: SOLUTION:Fresh install & Receiving " T_PAAMAYIM_NEKUDOTAYIM"

Postby dakisan » Tue Jan 03, 2012 2:33 pm

I don't think the semicolon is necessary. I applied Joshua's fix without adding the semicolon after Instance()
Code: Select all
MessageRegistry::instance()->addMessage ...etc
and the login screen still appeared.

Great job getting to the bottom of this one Joshua,you saved me untold woe - thanks!
dakisan
 
Posts: 4
Joined: Tue Dec 13, 2011 10:28 pm


Return to PHP

Who is online

Users browsing this forum: No registered users and 1 guest