Xampp and Zend Framework

Discussion in 'PHP' started by Sloshed, Apr 11, 2010.

  1. #1
    Howdy all!

    I'm trying to get Xampp and Zend Framework working together, but I can't quite get it to do so. I found an old topic from 2008, but that doesn't seam to help.

    Xampp Version: 1.7.3
    Zend Framework Version: 1.10.2

    I have extracted the Zend zip into the Xampp folder, and edited the PHP.ini (hopefully correctly) but it doesn't work.

    Here's the include path for the php.ini:
    include_path = ".;\win\xampp\php\PEAR\;C:\win\xampp\ZendFramework-1.10.2\library\"

    I'm trying to get into Zend for myself for a few projects that I want to do, it will also help with work too.

    Any ideas on what could be going wrong?

    Also could someone also provide some small snippet of code that I could test out?

    Thanks all.
     
    Sloshed, Apr 11, 2010 IP
  2. webria

    webria Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Please read on zend boot strap files deeply.
    here is my boot stap file which works along with the index.php as shown

    bootstrap.php

    <?php

    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
    {

    protected function _initView()
    {
    // Initialize view
    $view = new Zend_View();
    $view->doctype('XHTML1_STRICT');
    $view->headTitle('My Project');
    $view->env = APPLICATION_ENV;

    // Add it to the ViewRenderer
    $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
    $viewRenderer->setView($view);

    // Return it, so that it can be stored by the bootstrap
    return $view;
    }


    }

    ?>
    index.php
    <?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'
    );

    //print dirname(__FILE__) .'/../../application/controllers';

    //$application->bootstrap()->start();
    $application->bootstrap()->run();
     
    webria, Apr 12, 2010 IP