复制Zend项目

时间:2014-02-13 15:32:55

标签: php zend-framework

我对Zend Framework只有非常基本的把握。我被要求复制一个现有项目(使用1.12版本),以便重新命名并将其用于其他客户端。

我复制了整个项目并将其上传到不同的托管空间。我认为它应该正常工作是错误的,因为所有文件仍然在相对于彼此的相同位置?我在其他地方读过,它应该只是复制整个项目的情况,但它对我不起作用。

目录结构如下:

project
- application
- - configs
- - - application.ini
- - controllers
- - - helpers
- - - ErrorController
- - docs 
- - forms
- - models
- - - DbTable
- - modules
- - - admin
- - - controllers
- - - payment
- - - touradmin
- - - - controllers
- - - - - IndexController
- - - - - BookingController
- - - - forms
- - - - models
- - - - views
- - - - - filters
- - - - - helpers
- - - - - layouts
- - - - - scripts
- - - - - - index
- - - - - - - index.phtml
- - - tourview
- - plugins
- - services
- - template
- - views
- - bootstrap.php
- my.project.ie
- - tourmanager
- - - index.php
- - index.php
- library
- logs
- stats     

我完全按照原样复制了所有内容。在原始网站上my.project.ie是公共文件夹(我认为) - 没有像大多数zend项目那样的名为pu​​blic的文件夹,在这种情况下my.project.ie是'public'文件夹。如果我在浏览器中加载它,我会得到通用的“欢迎使用Zend Framework”消息。该网站上的主要活动发生在my.project.ie/tourmanager/touradmin。我猜测touradmin模块中的IndexController是访问此URL时发生的事情。

复制文件并将my.project.ie设置为域的web目录后,我也得到了Zend欢迎屏幕。但是,如果我访问新的my.project.ie/tourmanager/,我会收到一条消息说

Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in /home/shane/sites/project/my.project.ie/tourmanager/index.php on line 34

我可以通过编辑行来获取“欢迎使用zend框架”屏幕以显示在my.project.ie/tourmanager/

defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));

但如果我转到my.project.ie/tourmanager/touradmin,我会收到“404 Not Found”页面。我不知道这是否是朝着正确方向迈出的一步。

我也尝试将resources.frontController.baseUrl ='/ sites / project / my.project.ie'添加到application.ini。

我缺少一些简单的步骤吗?

编辑: 这是tourmanager / index.php

<?php

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

if (APPLICATION_ENV == 'testing') {
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));

}


// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
        ->run();

0 个答案:

没有答案