ICT. PHP coding. Universityy. in any



Similar documents
Oracle Database: SQL and PL/SQL Fundamentals

CSE 308. Coding Conventions. Reference

Facebook Twitter YouTube Google Plus Website

Oracle Forms Services Secure Web.Show_Document() calls to Oracle Reports Server 6i

PL/SQL MOCK TEST PL/SQL MOCK TEST I

Oracle Database: SQL and PL/SQL Fundamentals NEW

How To Write A File System On A Microsoft Office (Windows) (Windows 2.3) (For Windows 2) (Minorode) (Orchestra) (Powerpoint) (Xls) (

Creating PL/SQL Blocks. Copyright 2007, Oracle. All rights reserved.

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle Database: SQL and PL/SQL Fundamentals

Database Programming with PL/SQL: Learning Objectives

PHP Tutorial From beginner to master

Web development... the server side (of the force)

Data Domain Profiling and Data Masking for Hadoop

Oracle Forms Services Secure Web.Show_Document() calls to Oracle Reports

AppendixA1A1. Java Language Coding Guidelines. A1.1 Introduction

Web Development using PHP (WD_PHP) Duration 1.5 months

Cross Site Scripting (XSS) and PHP Security. Anthony Ferrara NYPHP and OWASP Security Series June 30, 2011

Oracle 10g PL/SQL Training

Using Temporary Tables to Improve Performance for SQL Data Services

Specialized Programme on Web Application Development using Open Source Tools

CA Workload Automation Agent for Microsoft SQL Server

SQL injection: Not only AND 1=1. The OWASP Foundation. Bernardo Damele A. G. Penetration Tester Portcullis Computer Security Ltd

What's New in ADP Reporting?

!"#"$%&'(()!!!"#$%&'())*"&+%

Domains and Competencies

PL / SQL Basics. Chapter 3

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

Advanced PostgreSQL SQL Injection and Filter Bypass Techniques

Oracle SQL. Course Summary. Duration. Objectives

Oracle Database: Develop PL/SQL Program Units

Dolphin Dynamics. Document Configuration: HTML Editor

Web Application diploma using.net Technology

HP OpenView AssetCenter

Course Outline Basic Web Development

MICHIGAN TEST FOR TEACHER CERTIFICATION (MTTC) TEST OBJECTIVES FIELD 050: COMPUTER SCIENCE

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Zend Framework Database Access

OKLAHOMA SUBJECT AREA TESTS (OSAT )

Specialized Programme on Web Application Development using Open Source Tools

DataDirect XQuery Technical Overview

Unit 3. Retrieving Data from Multiple Tables

Elgg 1.8 Social Networking

Webapps Vulnerability Report

Web Service Facade for PHP5. Andreas Meyer, Sebastian Böttner, Stefan Marr

ISI ACADEMY Web applications Programming Diploma using PHP& MySQL

Using Crystal Reports with Enprise Job

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

#820 Computer Programming 1A

Dinopolis Java Coding Convention

Higher Computing Science Course Assessment Specification (C716 76)

Sales Rush Sales Order Processing S01- Lean Baseline Package. SAP Lean Baseline Package Version: V1.500 Country: UK Language: EN Date: February 2006

Sentinel EMS v7.1 Web Services Guide

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT

Novell Identity Manager

Oracle FLEXCUBE Universal Banking 12.0 RAD Notification Development. Release 1.0

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

Computer Programming I & II*

CA Clarity PPM. Connector for Microsoft SharePoint Product Guide. Service Pack

Oracle Database: SQL and PL/SQL Fundamentals NEW

AGFA MEDICAL IMAGING DICOM Conformance Statement

ADP Workforce Now V3.0

XSLT Mapping in SAP PI 7.1

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Oracle Database 10g: Program with PL/SQL

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl

Some Scanner Class Methods

Java Application Developer Certificate Program Competencies

Case Study. Data Governance Portal Brainvire Infotech Pvt Ltd Page 1 of 1

Adeptia Suite 6.2. Application Services Guide. Release Date October 16, 2014

Zend Server Amazon AMI Quick Start Guide

50 Computer Science MI-SG-FLD050-02

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

Vendor: Crystal Decisions Product: Crystal Reports and Crystal Enterprise

Custom Javascript In Planning

Oracle Database 10g: Introduction to SQL

PowerPay User Guide. Table of Contents

Auditing manual. Archive Manager. Publication Date: November, 2015

SAP 3D Visual Enterprise Rapid-Deployment Solution

RIPS. A static source code analyser for vulnerabilities in PHP scripts. NDS Seminar. A static source code analyser for vulnerabilities in PHP scripts

Computer Programming I

Best Practices for Dynamic SQL

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.

v4.8 Getting Started Guide: Using SpatialWare with MapInfo Professional for Microsoft SQL Server

SQL Server 2005 Reporting Services (SSRS)

Oracle PL/SQL Programming

TaskCentre v4.5 Run Crystal Report Tool White Paper

ICADBS504A Integrate database with a website

PeopleSoft Enterprise Human Resources 9.1 PeopleBook: Administer Compensation

PL/JSON Reference Guide (version 1.0.4)

Lecture 5: Java Fundamentals III

ICAB4136B Use structured query language to create database structures and manipulate data

MySQL for Beginners Ed 3

Certification criteria for. Internal QMS Auditor Training Course

Transcription:

Information Technology Services Division ICT Volume 3 : Application Standards ICT 3.2.1.1-2011 PHP Coding Standards Abstract This document defines the standards applicable to PHP coding. Copyright Deakin Universityy All rights reserved. No part of thiss work coveredd by Deakin University's copyright may bee reproduced or copied in any form or by any means (graphic, electronic or mechanical, includingg photocopying, recording, taping t or information retrieval systems) without the written permissionn of Deakin University.

Document Control Document Title ICT 3.2.1.1-2011 PHP Coding Standards Version 2011 Controlled Copy (Electronic Reference) Document History Ver. Primary Author(s) Description of Version Date Completed 0.01 Steven George Initial draft 26-11-2008 0.02 Steven George Standards compliance 25-02-2009 0.03 Steven George Standards compliance 18-03-2009 0.04 Steven George Update from Melb PHP User Group Feedback 27-03-2009 0.05 Steven George Corrected numbering error 07-04-2009 0.06 Steven George Update from feedback 17-04-2009 1.0 Steven George Annual review 05-07-2010 2.0 Steven George 2011 Update 03-11-2010 Information Technology Services Division Page 2 of 8 Version: 2011

Table of Contents 1 CODING STANDARDS... 6 1.1 THE ZEND FRAMEWORK CODING STANDARD FOR PHP SHALL BE ADOPTED... 6 1.2 EXCEPTIONS... 6 1.2.1 Section B.4.2.4 - String Concatenation... 6 1.2.2 Section B.4.4.1. Class Declaration... 6 1.2.3 Section B.4.6 Control Statements... 6 1.2.4 Section B.4.6.1. If/Else/Elseif... 6 1.2.5 Section B.4.6.2 - Switch... 7 1.2.6 B.4.7.4 Functions... 7 1.2.7 Indentation shall be via tab characters... 7 1.3 ADDITIONS... 7 1.3.1 Output of HTML via PHP shall be avoided where practical... 7 1.3.2 "Magic numbers" shall not be used... 7 2 APPENDIX A... 8 Information Technology Services Division Page 3 of 8 Version: 2011

ICT Volume 3 : Application Standards ICT 3.1 Design Standards ICT 3.1.1 Object Oriented Design Standards ICT 3.2.1.1 PHP Coding Standards ICT 3 Application Standards ICT 3.2 Development Standards ICT 3.2.1 Coding Standards ICT 3.2.2 Web Application Development Standards ICT 3.2.1.2 Oracle PL/SQL and SQL Coding Standards ICT 3.3 Testing Standards ICT 3.3.1 Web Application Testing Standards Information Technology Services Division Page 4 of 8 Version: 2011

Standards Brief This document serves to outline standards that shall apply within Deakin University. Standard Document Access All Deakin University staff and authorised/approved contracted personnel are provided access to this document. Policy These standards must be used in conjunction with all other referenced standards, and when considered in isolation from the referenced standards may not constitute adequate conformance. Conflict of Information or Clarification Whenever a conflict of information occurs or clarification of instruction is required, all queries shall be made to the Deakin University Information Technology Services Division (ITSD). Information Technology Services Division Page 5 of 8 Version: 2011

1 Coding standards 1.1 The Zend Framework Coding Standard for PHP shall be adopted All conventions outlined in the Zend Programmer's Reference Guide Appendix B.4, "Coding Style" shall be adopted with exception to items identified under section 1.2 herein. http://framework.zend.com/manual/en/coding-standard.coding-style.html 1.2 Exceptions Exceptions to standard 1.1 for Deakin University coding standards. Unless otherwise stated, a section refers to the relevant section within the Zend Framework Coding Standard for PHP document referenced in 1.1 above. 1.2.1 Section B.4.2.4 - String Concatenation A space is not required before or after the concatenation operator. 1.2.2 Section B.4.4.1. Class Declaration Classes must be named according to Deakin s class naming conventions 1.2.3 Section B.4.6 Control Statements All braces in program code shall appear on a new line. This includes control statements, as well as class and function definitions. Example: if () { // Code here } 1.2.4 Section B.4.6.1. If/Else/Elseif Braces may be omitted in the instance where the body of the control structure consists of only one line. Note that indentation rules shall always apply. Example: if () // Code here else //Code here Information Technology Services Division Page 6 of 8 Version: 2011

The alternate syntax for control structures (http://au2.php.net/manual/en/controlstructures.alternative-syntax.php) may be used. 1.2.5 Section B.4.6.2 - Switch The guidelines state: All content within the "switch" statement must be indented using four spaces This should be changed to: All content within the "switch" statement must be indented using a Tab The break directive should be included; however, documentation is mandatory if break is to be excluded. 1.2.6 B.4.7.4 Functions The @param tag must be included, along with the type of parameter that is expected. If two types are accepted, they should both be specified, eg. string boolean If more than two types are accepted, then the parameter type should be mixed. 1.2.7 Indentation shall be via tab characters Code shall be indented via tabs and not via spaces. 1.3 Additions The following additions shall apply to the Zend Framework Coding Standard for PHP document referenced in 1.1 above. 1.3.1 Output of HTML via PHP shall be avoided where practical Any HTML output that is required to be returned to the client must be emitted outside of php delimiter tags, rather than via php functions such as echo or print where practical. 1.3.2 "Magic numbers" shall not be used Constants shall be employed to represent any constant value. Configuration files shall be employed to represent any configurable value. Magic numbers shall not be used within any program code. Where applicable, class constants must be used in preference over global constants (per http://framework.zend.com/manual/en/coding-standard.naming-conventions.html#codingstandard.naming-conventions.constants) Information Technology Services Division Page 7 of 8 Version: 2011

2 Appendix A Definitions Term/Abbreviation. Class Definition The basic building block of software in the object-oriented programming paradigm. Zend Framework An open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License Information Technology Services Division Page 8 of 8 Version: 2011