Internship2Career:2011 Spring System Development

From Openitware
Jump to: navigation, search


Development Documents


Code Base

Project code base is hosted on Google Code at Internship2Career. The Google Code hosted project uses Subversion for version control. (note: add more information about project as configured on Google Code - such as license). To become a committer, email professor, Mihaela Sabin.

Coding Standards


Line length
Limit each line of code to 80 characters.
DO NOT use TABs in NetBeans or Eclipes. Change tabs to TWO spaces.


PHP function and variable names
Use "camel case" for function and variable names. For example:
function addTwoNumbers($firstNumber, $secondNumber)
  $sum = $firstNumber + $secondNumber;
  return $sum;
PHP class names
Class names are capitalized.


Don't use MySql Reserved Words
Don't use MySql reserved words to name tables or columns.
Click for Examples
Prevent SQL injection
  • Preventing SQL injection is easy; db_query provides a way to use parametrized queries. Drupal's database functions replace the sprintf-like placeholders with the properly escaped arguments in order of appearance:
    • %d - integers
    • %f - floats
    • %s - strings, enclose in single quotes
    • %b - binary data, do not enclose in single quotes
    • %% - replaced with %
  • Literal (constant) arguments can either be included in the query body or handled in the same way as variable arguments.
  • Any string literal or %s placeholder must be enclosed by single quotes: ' . Never use double quotes.
Use singular nouns for table names since they describe the entity the table represents.

Staging Site

Project Links