codebase

From SkyPHP

Jump to: navigation, search

A codebase is a folder that contains code for a website.

Contents

Codebase Folders

A codebase uses the following folder structure:

config.php
components/
classes/
js/
models/
pages/
validation/

public_html

Keep your public_html folder clean and simple. It should look like this:

+  public_html/
    +  .htaccess
    +  index.php
    +  my-codebase/
    +  skyphp/

where my-codebase is the name of your codebase.

  • If you have multiple websites that share common pages or functions, create another codebase for the shared files.

Cascading Codebases

Websites use a heiarchy of cascading codebases. This allows for maximum flexibility for sharing code among various websites.

For example, when accessing a URL, if the file is not found in the first codebase, the second codebase is checked and so forth. A 404 error page is displayed in the browser if the file does not exist in any of the codebases. (see 404.php)

Define Codebases

The path to each codebase that your website uses must be defined in the website's index.php file using the $codebase_path_arr array.

Database Tables

A codebase usually has database tables associated with it. It is recommended to name the tables with a common prefix.

Limitations

Defining too many codebases *could* have a negative impact on performance.

Personal tools