解析错误:语法错误,意外'('我在下面的代码中遇到错误

时间:2014-03-31 09:08:25

标签: php zend-framework

function _initAutoload() {
    Zend_Application_Module_Autoloader;
    new ( array ('namespace' => 'Eicra', 'basePath' => bbddbgdiaa( __FILE__ ) ) );
    $autoloader = ;
    return $autoloader;
}

在上面的函数中我得到一个Parse错误:语法错误,意外'('。

如何修复错误。请回复我

请检查完整代码我遇到了很多错误。因为新的如何解决这个请帮帮我..

<?php

class Install extends Zend_Application_Bootstrap_Bootstrap {
    private $_installed = false;

    function _initAutoload() {
        Zend_Application_Module_Autoloader;
        new ( array( 'namespace' => 'Eicra', 'basePath' => bbddbgdiaa( __FILE__ ) ) );
        $autoloader = ;
        return $autoloader;
    }

    function _initSystem() {
        Zend_Currency::setcache( Eicra_View_Helper_Cache::getsystemcache(  ) );
    }

    function _initCheckInstall() {
        if (cjajebcjhc( APPLICATION_PATH . '/configs/config.ini' )) {
            Zend_Config_Ini;
            new ( APPLICATION_PATH . '/configs/config.ini' );
            $config = ;

            if (( null != $config->install && null != $config->install->date )) {
                $this->_installed = true;
            }
        }

    }

    function _initResourceAutoload() {
        Zend_Loader_Autoloader_Resource;
        new ( array( 'basePath' => LIBRARY_PATH, 'namespace' => 'Eicra', 'resourceTypes' => array( 'global' => array( 'path' => 'Sessions/', 'namespace' => 'Global' ), 'acl' => array( 'path' => 'Modules/Acls/', 'namespace' => 'Libs' ), 'helpers' => array( 'path' => 'Modules/Helpers/', 'namespace' => 'VHelper' ), 'dbtable' => array( 'path' => 'Default/Models/Dbtables/', 'namespace' => 'Abstract' ), 'api' => array( 'path' => 'Apis/', 'namespace' => 'Lib' ), 'utility' => array( 'path' => 'Utility/', 'namespace' => 'File' ), 'routing' => array( 'path' => 'Modules/Menu/', 'namespace' => 'Menu' ), 'import' => array( 'path' => 'Import/', 'namespace' => 'Import' ), 'importerFactory' => array( 'path' => 'Import/', 'namespace' => 'Import' ), 'adapter' => array( 'path' => 'Import/Adapter', 'namespace' => 'Import_Adapter' ), 'mysqli' => array( 'path' => 'Import/Adapter/Mysqli', 'namespace' => 'Import_Adapter_Mysqli' ), 'license' => array( 'path' => 'Version/', 'namespace' => 'License' ) ) ) );
        $resourceLoader = ;
        return $resourceLoader;
    }

    function _initRoutes() {
        Zend_Controller_Front::getinstance(  );
        $front = ;
        $front->getRouter(  );
        $router = ;
        $router->removeDefaultRoutes(  );

        if ($this->_installed == true) {
            Zend_Controller_Router_Route;
            ( 'install_step_already', new $router->addRoute( '/', array( 'module' => 'default', 'controller' => 'Install', 'action' => 'stepinstalled' ) ) );
        }
        else {
            Zend_Controller_Router_Route;
            ( 'install_step1', new $router->addRoute( '/', array( 'module' => 'default', 'controller' => 'Install', 'action' => 'step1' ) ) );
        }

        Zend_Controller_Router_Route;
        ( 'install_step2', new $router->addRoute( '/step2/', array( 'module' => 'default', 'controller' => 'Install', 'action' => 'step2' ) ) );
        Zend_Controller_Router_Route;
        ( 'install_step3', new $router->addRoute( '/step3/', array( 'module' => 'default', 'controller' => 'Install', 'action' => 'step3' ) ) );
        Zend_Controller_Router_Route;
        ( 'install_step4', new $router->addRoute( '/step4/', array( 'module' => 'default', 'controller' => 'Install', 'action' => 'step4' ) ) );
        Zend_Controller_Router_Route;
        ( 'install_step5', new $router->addRoute( '/step5/', array( 'module' => 'default', 'controller' => 'Install', 'action' => 'step5' ) ) );
        Zend_Controller_Router_Route;
        ( 'install_step6', new $router->addRoute( '/step6/', array( 'module' => 'default', 'controller' => 'Install', 'action' => 'step6' ) ) );
    }

    function _initLanguage() {
        Eicra_View_Helper_Translator;
        $translator = new (  );
        Zend_Registry::set( 'translator', $translator );
        Exception {
            echo $e->getMessage(  );
            exit(  );
            return null;
        }
    }

    function _initView() {
        Zend_Layout::startmvc( array( 'layoutPath' => APPLICATION_PATH . DS . 'layouts' . DS . 'scripts' . DS . 'default' ) );
        Zend_Layout::getmvcinstance(  )->setLayout( 'install' );
        Zend_Registry::set( 'front_template', 'Default' );
        Eicra_License_Version;
        ( 'version', new Zend_Registry::set(  ) );
    }
}

?>

1 个答案:

答案 0 :(得分:0)

正如我在评论中所说,这是错误的:

new ( array ('namespace' => 'Eicra', 'basePath' => bbddbgdiaa( __FILE__ ) ) );

语法错误,无用。这就是您收到错误的原因。


现在提出一些建议(作为评论):

请阅读此处有关使用Zend Autoloader的信息:http://framework.zend.com/manual/1.12/en/zend.loader.autoloader.html

似乎这就是你所需要的(但详细介绍了文档):

$autoloader = Zend_Loader_Autoloader::getInstance();

$autoloader->pushAutoloader(array ('namespace' => 'Eicra', 'basePath' => bbddbgdiaa( __FILE__ ) ) );