I have an application which I want to convert to Zend Application. I have to continue by doing next tasks in zend but previous pages should work as they are working. Existing php project is a simple php project with very simple directory structure and all files are in one folder.
I created a zend project(test) separately and put all existing project files in public folder. I set to local host that points to test/public folder when use test.dev. When I use test.dev in browser then index.php of existing project is called and existing project's initial page is shown. Now I created a controller(person) and action(index). Now when I use test.dev/person/index then existing project content is shown first and then in the end of the page person/index(controller/action) content is shown.
I want if there is controller and action in url then it should show only zend project files content and when there is a file in url then it should show that file simply.
my test/public/index.php file is like this at the moment.
<html>
<head>
</head>
<body>
This is existing project's index content.
</body>
</html>
<?php
// 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(),
)));
// Determine the protocol to use (http or https).
if (APPLICATION_ENV == 'production') {
define('HTTP_PROT', 'https://');
} else {
define('HTTP_PROT', 'http://');
}
/** 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();
?>