Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][Zend] Pusta strona przeniesienie.
cykcykacz
post 5.02.2010, 20:05:14
Post #1





Grupa: Zarejestrowani
Postów: 550
Pomógł: 9
Dołączył: 29.05.2009
Skąd: Ostrów Wielkopolski

Ostrzeżenie: (0%)
-----


Witam, postanowiłem przenieść mój projekt stworzony za pomocą Zend Tool z Windowsa na Linuxa.
Jednak po wprowadzeniu http://localhost/public/index.php Wyświetla mi pustą białą stronę bez żadnego błędu. sadsmiley02.gif
Help!
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
cykcykacz
post 6.02.2010, 13:08:57
Post #2





Grupa: Zarejestrowani
Postów: 550
Pomógł: 9
Dołączył: 29.05.2009
Skąd: Ostrów Wielkopolski

Ostrzeżenie: (0%)
-----


Ok nie wiem jak to zrobić mój application.ini:
CODE

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
autoloadernamespaces.0 = "Zend_"
autoloadernamespaces.1 = "forms_"
resources.layout.layoutpath = APPLICATION_PATH "/layouts"

resources.db.adapter = mysqli
resources.db.isDefaultAdapter = true
resources.db.params.host = localhost
resources.db.params.username = xxx
resources.db.params.password = xxxx
resources.db.params.dbname = xxxx
resources.db.params.charset = 'utf8'

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

Bootstrap.php
CODE

<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
private $_acl;
private $_auth;

protected function _initAutoLoad() {

$modelLoader = new Zend_Application_Module_AutoLoader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH ));

$this->_acl = new Model_LibraryAcl;
$this->_auth = Zend_Auth::getInstance();

$fc = Zend_Controller_Front::getInstance();
$fc->registerPlugin(new Plugin_AccessCheck($this->_acl, $this->_auth));


return $modelLoader;
}

function _initViewHelpers() {
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getview();

$view->doctype('HTML4_STRICT');
$view->headMeta()->appendHttpEquiv('Content-Type','text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language','pl-PL')
->appendName('description', 'Using view helpers in Zend_view');

$view->headTitle()->setSeparator(' - ');
$view->headTitle('Sala');

$navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$navContainer = new Zend_Navigation($navContainerConfig);

$view->navigation($navContainer);
}

}

index.php
CODE

<?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(dirname(__FILE__) . '/../library'),
realpath(dirname(__FILE__) . '/../application'),
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();

Jak dodam nowy projekt przy pomocy Zend Tool ładnie wyświetla.
EDIT
Tak wygląda działający projekt:
application.ini
CODE

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

CODE

<?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(),
)));

/** 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();

Tylko w tym projekcie nie ma funkcji w bootstrapie.

Ten post edytował cykcykacz 6.02.2010, 13:21:16
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 16:49