Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8019945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:32:50+00:00 2026-06-04T21:32:50+00:00

The manual for RedBean suggests a method for integrating the ORM into Zend Framework

  • 0

The manual for RedBean suggests a method for integrating the ORM into Zend Framework.

From the manual:-

open your Zend bootstrap file and add:

   public function run() {
         $loader = Zend_Loader_Autoloader::getInstance()->registerNamespace("RedBean_");
         require_once( APPLICATION_PATH . "/../library/RedBean/redbean.inc.php"); //or rb.php
         R::setup( "mysql:host=localhost;dbname=timereg", "root" );
         Zend_Registry::set("tools", R::$toolbox);
         Zend_Registry::set("db", R::$adapter);
         Zend_Registry::set("redbean", R::$redbean);
         parent::run();
   }

This method does not strike me as being the most efficient as the ORM is being set up in every controller, whether it is needed or not. It is also using Zend_Registry which I don’t like.

There are also certain features of RedBean that need integrating properly and that may benefit from configuration via application.ini:-

  • Set as frozen/fluid
  • Set location of models for Fuse to allow custom models to work.
  • Setup the connection to the RDBMS
  • Set Debug mode.

How can RedBean ORM be integrated into the Zend Framework in a more efficient Zend like manner?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:32:52+00:00Added an answer on June 4, 2026 at 9:32 pm

    Depending on what redbean.inc.php does, I don’t think you’ll be able to improve the efficiency of this too much. The overhead of requiring in a file and setting up a DB connection isn’t likely to be significant.

    I’d change the suggested code slightly to:

    protected function _initRedBean()
    {
        $loader = Zend_Loader_Autoloader::getInstance()->registerNamespace("RedBean_");
        require_once APPLICATION_PATH . "/../library/RedBean/redbean.inc.php"; //or rb.php
        R::setup( "mysql:host=localhost;dbname=timereg", "root" );
        Zend_Registry::set("tools", R::$toolbox);
        Zend_Registry::set("db", R::$adapter);
        Zend_Registry::set("redbean", R::$redbean);
    }
    

    to take advantage of the bootstrap’s inbuilt resource loading, instead of overriding the run() method (bad practice).

    It might be possible to simply pass in an existing PDO connection if you are also using Zend_Db, to avoid creating a 2nd connection, but that would require some digging around in the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my Manual.java file: public class Manual extends Activity implements OnClickListener{ Button create;
Perforce manual says that if you want to automatically expand RCS keywords in file
The ARM reference manual doesn't go into too much detail into the individual instructions
PHP manual suggests to autoload classes like function __autoload($class_name){ require_once(some_dir/.$class_name..php); } and this approach
In the PHP manual, the file operations reference an optional context (e.g. for copy
From the manual : Cookies will not become visible until the next loading of
From the manual : void __halt_compiler ( void ) This function halts the execution
From the PHP manual: class Bear { // define properties public $name; public $weight;
The PHP manual says Like static members, constant values can not be accessed from
The manual on extract shows you can extract an array like: extract(array('one'=>1,'two'=>2)); into $one,$two...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.