Documentation

Libraries

Hubzero

Location:

/libraries/Hubzero

The Hubzero library contains code that is essential for a hub to run properly and altering or adding to the library without Hubzero approval is strongly discouraged.

File Formatting

For files that contain only PHP code, the closing tag ("?>") is omitted. It is not required by PHP, and omitting it prevents the accidental injection of trailing white space into the response.

Class Names

Class names may only contain alphanumeric characters. Numbers are permitted in class names but are discouraged in most cases. Underscores are only permitted in place of the path separator; the filename "/libraries/Hubzero/User/Helper.php" must map to the class name "Hubzero_User_Helper".

If a class name is comprised of more than one word, the first letter of each new word must be capitalized. Successive capitalized letters are not allowed, e.g. a class "Hubzero_PDF" is not allowed while "Hubzero_Pdf" is acceptable.

Note: Code deployed alongside Hubzero libraries must never start with "Hubzero_".

Filenames

Hubzero standardizes on a class naming convention whereby the names of the classes directly map to the directories in which they are stored. The root level directory of Hubzero's standard library is the "/libraries/Hubzero" directory. All Hubzero classes are stored hierarchically under this root directory.

For all other files, only alphanumeric characters, underscores, and the dash character ("-") are permitted. Spaces are strictly prohibited.

File names must map to class names as described above.

Last modified: