Openbiz Cubi: A Robust PHP Application Framework, Part 1

This entry is part 1 of 2 in the series Openbiz Cubi: A Robust PHP Application Framework

Openbiz Cubi: A Robust PHP Application Framework

The web has been a standard platform for both consumer-facing and business-facing applications for more than 10 years. The enormous amount of open source projects, commercial tools, and frameworks make fast web development possible.

Openbiz Cubi is a robust PHP application framework giving developers the ability to create business applications with minimal effort. In this two-part series I’ll explain the concepts and steps necessary to create your own business web applications with Cubi. We’ll look first at the challenges web developers face and how Openbiz Cubi can help, and then how to install Cubi. In part 2 we’ll see how to create our own modules.

Openbiz Cubi Features

Even with many choices for a web development framework, application development is still a very challenging job.

A good framework can help developers code with good programming practices such MVC and ORM, although to build a real world application we sometimes have to spend time writing code beyond the capability of the framework.

  • Learn the framework and code with it. After creating a “Hello World” app with the framework, developers still have a steep learning curve to build the first prototyped application.
  • Implement common features like user registration, login, password reset, etc.
  • Provide permission control for users. Because of the complexity of generalizing access control, permission logic is often hardcoded in the software.
  • Make a professional UI. Fine-tuning HTML, CSS, and JavaScript is time-consuming, especially to please all major browsers.

All the above tasks are necessary but not the highlighted features of the application. Spending too much time on them brings frustration to both clients and the development team.

Openbiz Cubi is a mature platform, mainly for the fast development of business applications. It was designed to relieve the pain of such application development by providing:

  • An XML-based coding scheme. Developers use intuitive XML to describe the data objects, pages and forms, as well as user interaction.
  • A modular platform that has many common component built-in. Developers make their own modules and load them in the platform.
  • A default professional-looking UI with multi-theme support.
  • Flexible permission control options, from simple to sophisticated.

To learn more about Cubi, be sure to visit the project site code.google.com/openbiz-cubi and official website www.openbiz.me.

Installing Openbiz Cubi

To install Openbiz Cubi, you need to download either the source code or Windows installer from code.google.com/p/openbiz-cubi/downloads/list, or you can get the latest source code from the Openbiz Cubi SVN server.

When you choose to download the source ZIP archive or get the source from SVN, you can follow the steps below to install it:

  1. Prepare the LAMP stack. Openbiz Cubi can be run on Unix, Windows, and Mac servers. The runtime environment should include:
    • Web server – Apache, IIS, etc.
    • Database server – MySQL, MSSQL, Oracle, PgSQL, and databases supported by Zend_DB
    • PHP 5.2 and above with mysql, PDO, and mcrypt extensions
  2. In your web server’s web directory, create a folder named cubi.
  3. Unzip the Cubi ZIP file to the directory (or check out the source from SVN under this directory).

If you use Windows as your development environment, you can install Cubi with its Windows Installer. The installer:

  • Installs Apache 2.4, PHP 5.4 and MySQL 5.3. After installation is completed, you can find Apache and MySQL in the System Services list.
  • Installs the Openbiz Cubi platform and business applications. You can choose to unselect the options of installing business applications which are not released under open source.
  • Adds desktop icons and start menu items.

After the code is installed to the web server’s directory, you can launch Cubi’s web installation wizard in a browser to set up the database and load modules. Run the installation wizard by launching http://host/cubi/install in your browser.

cubi-1-1

Click the Start Now button and follow the steps until you see Installation Completed page. Then you’ll be ready to test drive Cubi.

cubi-1-2

A Quick Tour of Openbiz Cubi

After you log in to Cubi as admin, you’ll see the Administration dashboard. You may see other tabs as well, like “Contacts” and “Calendar”.

Cubi is made of modules. All modules are under the cubi/modules directory. Of the many built-in modules, the following are the most important; they are core modules that are often used by other modules:

  • System module – provides the ability for system administrators to manage users, roles, modules, groups and permissions.
  • Menu module – provides support for page navigation by menus, tabs, and breadcumbs.
  • User module – provides functions for users to register, sign in, and reset passwords.
  • MyAccount module – provides My Account pages where a user can manage his own profile, preferences, activities, and password.

Cubi comes with other modules such as Contact, Email, Event Log, Security, Theme, Translation, Attachment, Picture, Chart, Payment, OAuth, Web Service, and more.

A typical Cubi page on the front-end is composed of four sections:

  • Header – this section contains the logo, My Account link, application tabs, and breadcrumb navigation.
  • Left Menu – this section contains navigation menus and other widgets.
  • Content – this is the main area users will work in with their data and business logic.
  • Footer – the footer may have links about the application provider, copyright, etc.

cubi-1-3

Manage Users and Roles

For the application administrator, one of the most important tasks is to manage users and their permissions to access certain resources. Cubi supports several widely used access control models including Role-based access control (RBAC) and Group-based access control (similar to Unix file permissions). I’ll briefly discuss how to use RBAC.

A Cubi user account is simply called “user”. A role usually means a type of user. Different roles are permitted to do different things. Cubi comes with three roles: administrator, member, and visitor. A user can be assigned to one or many roles.

An administrator needs to use the Role Management page to allow or deny resources for a given role. When he wants to grant a user certain permissions, he associates the user to a new role that has those permissions.

cubi-1-4

Conclusion

This is where I’ll end the first part of the series. So far we’ve talked about the challenges web developers face and how Openbiz Cubi can help, how to install Cubi, and undertook a brief overview of how Cubi is organized. In the next part I’ll dig deeper and show you how to create your own module. Stay tuned!

Image via Fotolia

Openbiz Cubi: A Robust PHP Application Framework

Openbiz Cubi: A Robust PHP Application Framework, Part 2 >>

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

  • fxfhfqlj

    How on earth they can claim this is open source when the majority of php scripts are encoded? Besides it is super slow / sluggish .. this article should be discarded

    • Rocky Swen

      I believe you used windows installer. You actually can choose to unselect the options of installing business applications which are not open source. Cubi framework and core modules are open source.

      On some Windows system, MySQL may be connected very slowly due to DNS resolve issue. The same thing was discussed at http://serverfault.com/questions/408550/connecting-to-mysql-from-php-is-extremely-slow. The answer has been provided in the discussion thread. Another solution is to change database host name to ip address (e.g. change ‘localhost’ to ‘127.0.0.1’) in cubi/application.xml. The slowness happened for one Cubi developer on his Windows 7. After he fixed it, the pages are loaded smoothly.

  • Stelian Mocanita

    This is actually not an informational resource of any kind, it is just hidden advertising. phpmaster, please be straight to your users and add a banner.

    As for this being open source, please do not embarrass yourself with such statements. It’s opened enough to allow you to sell further. Believe it or not, you did not patent this business model, it’s been here for a long time and it’s failing with blazing glory, have a look at CodeIgniter / Elislab.

  • bbhdev

    I am very disappointed in PHPmaster. This pseudo “article” is a bad move. It’s easy to lose credibility, and very hard to regain it.

  • willy

    It looks like “part 2″ show some real things about the unique design of the framework. Defining application logic with xml may work well for CRM type web sites. The concern is that the overhead of handling xml can impact the performance.

    • Rocky Swen

      Openbiz uses a two-level cache for processing XML metadata. The first time metadata is loaded into memory, the framework serializes it and saves it to APC cache if the extension is enabled, otherwise it saves it to file system. Later on if the XML is not modified, the cache version will be unserialized to memory without parsing the XML.

  • Sebastiaan Stok

    $password = md5(md5($password.$this->username).md5($profile['create_time']));
    Really?

    And storing the password as sha1() with no random-salt or repetition is very bad practice, any computer can brute-force this hash in no time.

    if($password==$realPassword)
    Known to be vulnerable to remote timing attacks.