刚安装完OrangeHRM打开index.php提示Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ']' in C:\wamp\www\orangehrm-2.6.11.2\symfony\plugins\orangehrmCorePlugin\lib\filter\orangehrmPostExecutionFilter.php on line 65如何解决?

解决方案 »

  1.   

    代码如下:本人新手,如何修改?
    <?php/* TODO: Rename this class with a proper name as it hangle both pre & post levels together  */class orangehrmPostExecutionFilter extends sfFilter {
        const PRE_EXEC = 'pre-exec';
        const POST_EXEC = 'post-exec';
        
        const REDIRECT_ACTION = 'redirect';    protected static $servicePool = array();    public function execute(sfFilterChain $filterChain) {        $module = $this->getContext()->getModuleName();
            $action = $this->getContext()->getActionName();        $actionsStack = PluginExecutionManager::instance()->getPreExecuteMethodStack($module, $action);        $this->performServiceOpteration($actionsStack, self::PRE_EXEC);        $filterChain->execute();        $actionsStack = PluginExecutionManager::instance()->getPostExecuteMethodStack($module, $action);
            $this->performServiceOpteration($actionsStack, self::POST_EXEC);
        }    /**
         *
         * @param string $className 
         * @return BaseService
         */
        protected function getServiceClassInstance($className) {
            if (!array_key_exists($className, self::$servicePool)) {
                self::$servicePool[$className] = new $className();
            }
            return self::$servicePool[$className];
        }    protected function performServiceOpteration($actionsStack, $execLevel) {        foreach ($actionsStack as $methodCall) {
                $service = $methodCall['service'];
                $method = $methodCall['method'];
                $messages = $methodCall['messages'];
                $resultUsageOption = isset($methodCall['useResultTo']) ? $methodCall['useResultTo'] : null;            $serviceInstance = $this->getServiceClassInstance($service);
                if (method_exists($serviceInstance, $method)) {                if ($execLevel == self::PRE_EXEC) {
                        $request = $this->getContext()->getRequest();
                        $returnValue = $serviceInstance->$method($request);
                    } elseif ($execLevel == self::POST_EXEC) {
                        $form = $this->getContext()->getActionStack()->getFirstEntry()->getActionInstance()->getForm();
                        $returnValue = $serviceInstance->$method($form);
                    } else {
                        // TODO: Warn
                    }
                    
                    if (!empty($resultUsageOption)) {
                        $this->peformActionOperation($resultUsageOption, $returnValue);
                    }                if (isset($messages[$serviceInstance::getState()])) {
                        MessageRegistry::instance()->addMessage($messages[$serviceInstance::getState()], $module, $action);
                    }
                }
            }
        }    protected function peformActionOperation($operation, $result) {
            switch ($operation) {
                case self::REDIRECT_ACTION:
                    if (!empty($result)) {
                        $this->getContext()->getActionStack()->getFirstEntry()->getActionInstance()->redirect($result);
                    }
                    break;            default:
                    break;
            }
        }}
      

  2.   

    php版本?5.3之上才支持这种带参数形式的静态函数调用方式