Merge pull request #177 from akira28/w3c

Fixed w3c validator errors for "Duplicate ID"
This commit is contained in:
Phil Sturgeon
2012-10-14 06:36:26 -07:00
42 changed files with 42 additions and 42 deletions

View File

@@ -1,2 +1,2 @@
# Getting Started
# Getting Started {#getting_started_title}

View File

@@ -3,7 +3,7 @@ title: Use the Current Stable Version (5.4)
isChild: true
---
## Use the Current Stable Version (5.4)
## Use the Current Stable Version (5.4) {#use_the_current_stable_version_54_title}
If you are just getting started with PHP make sure to start with the current stable release of [PHP 5.4][php-release]. PHP has made great strides adding powerful [new features](#language_highlights) over the last few years. Don't let the minor version number difference between 5.2 and 5.4 fool you, it represents _major_ improvements. If you are looking for a function or it's usage, the documentation on the [php.net][php-docs] website will have the answer.

View File

@@ -3,7 +3,7 @@ title: Built-in Web Server
isChild: true
---
## Built-in web server
## Built-in web server {#builtin_web_server_title}
You can start learning PHP without the hassle of installing and configuring a full-fledged web server (PHP 5.4 required). To start the server, run the following from your terminal in your project's web root:

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Mac Setup
## Mac Setup {#mac_setup_title}
OSX comes prepackaged with PHP but it is normally a little behind the latest stable. Lion comes with PHP 5.3.6 and
Mountain Lion has 5.3.10.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Windows Setup
## Windows Setup {#windows_setup_title}
PHP is available in several ways for Windows. You can [download the binaries](php-downloads) and until recently you could use a '.msi'
installer. The installer is no longer supported and stops at PHP 5.3.0.

View File

@@ -1,4 +1,4 @@
# Code Style Guide
# Code Style Guide {#code_style_guide_title}
The PHP community is large and diverse, composed of innumerable libraries, frameworks, and components. It is common for
PHP developers to choose several of these and combine them into a single project. It is important that PHP code adhere

View File

@@ -1 +1 @@
# Language Highlights
# Language Highlights {#language_highlights_title}

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Programming Paradigms
## Programming Paradigms {#programming_paradigms_title}
PHP is a flexible, dynamic language that supports a variety of programming techniques. It has evolved dramatically over
the years, notably adding a solid object-oriented model in PHP 5.0 (2004), anonymous functions and namespaces in PHP 5.3

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Namespaces
## Namespaces {#namespaces_title}
As mentioned above, the PHP community has a lot of developers creating lots of code. This means that one library's PHP code may use the same class name as another library. When both libraries are used in the same namespace, they collide and cause trouble.

View File

@@ -3,7 +3,7 @@ title: Standard PHP Library
isChild: true
---
## Standard PHP Library
## Standard PHP Library {#standard_php_library_title}
The Standard PHP Library (SPL) is packaged with PHP and provides a collection of classes and interfaces. It is made up primarily of commonly needed datastructure classes (stack, queue, heap, and so on), and iterators which can traverse over these datastructures or your own classes which implement SPL interfaces.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Command Line Interface
## Command Line Interface {#command_line_interface_title}
PHP was created primarily to write web applications, but it's also useful for scripting command line interface (CLI) programs. Command line PHP programs can help you automate common tasks like testing, deployment, and application administrativia.

View File

@@ -1,4 +1,4 @@
# Dependency Management
# Dependency Management {#dependency_management_title}
There are a ton of PHP libraries, frameworks, and components to choose from. Your project will likely use several of them — these are project dependencies. Until recently, PHP did not have a good way to manage these project dependencies. Even if you managed them manually, you still had to worry about autoloaders. No more.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Composer and Packagist
## Composer and Packagist {#composer_and_packagist_title}
Composer is a **brilliant** dependency manager for PHP. List your project's dependencies in a `composer.json` file and, with a few simple commands, Composer will automatically download your project's dependencies and setup autoloading for you.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## PEAR
## PEAR {#pear_title}
Another veteran package manager that many PHP developers enjoy is [PEAR][1]. It behaves much the same way, and is also worth researching for your projects. [Learn about PEAR][1].

View File

@@ -1 +1 @@
# Coding Practices
# Coding Practices {#coding_practices_title}

View File

@@ -2,7 +2,7 @@
isChild: true
---
## The Basics
## The Basics {#the_basics_title}
PHP is a vast language that allows coders of all levels the ability to produce code not only quickly, but efficiently.
However while advancing through the language, we often forget the basics that we first learnt (or overlooked) in favor

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Date and Time
## Date and Time {#date_and_time_title}
PHP has a class named DateTime to help you when reading, writing, comparing or calculating with date and time. There are
many date and time related functions in PHP besides DateTime, but it provides nice object-oriented interface to most

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Design Patterns
## Design Patterns {#design_patterns_title}
When you are building your application it is helpful to use common patterns in your code and common patterns for the
overall structure of your project. Using common patterns is helpful because it makes it much easier to manage your code

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Exceptions
## Exceptions {#exceptions_title}
Exceptions are a standard part of most popular programming languages, but they are often overlooked by PHP programmers.
Languages like Ruby are extremely Exception heavy, so whenever something goes wrong such as a HTTP request failing, or

View File

@@ -2,7 +2,7 @@
title: Databases
---
# Databases
# Databases {#databases_title}
Many times your PHP code will use a database to persist information. You have a few options to connect and interact
with your database. The recommended option _until PHP 5.1.0_ was to use native drivers such as [mysql][mysql], [mysqli][mysqli], [pgsql][pgsql], etc.

View File

@@ -1 +1 @@
# Security
# Security {#security_title}

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Web Application Security
## Web Application Security {#web_application_security_title}
There are bad people ready and willing to exploit your web application. It is important that you
take necessary precautions to harden your web application's security. Luckily, the fine folks at [The Open Web Application Security Project][1] (OWASP) have compiled a comprehensive list of known security issues and methods to protect yourself against them. This is a must read for the security-conscious developer.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Password Hashing with Bcrypt
## Password Hashing with Bcrypt {#password_hashing_with_bcrypt_title}
Eventually everyone builds a PHP application that relies on user login. Usernames and (hashed) passwords are stored in a database and later used to authenticate users upon login.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Data Filtering
## Data Filtering {#data_filtering_title}
Never ever (ever) trust foreign input introduced to your PHP code. Always sanitize and validate
foreign input before using it in code. The `filter_var` and `filter_input` functions can sanitize text and validate text formats (e.g.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Configuration Files
## Configuration Files {#configuration_files_title}
When creating configuration files for your applications, best practices recommend that one of the following methods
be followed:

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Register Globals
## Register Globals {#register_globals_title}
**NOTE:** As of PHP 5.4.0 the `register_globals` setting has been removed and can no
longer be used. This is only included as a warning for anyone in the process of upgrading a legacy application.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Error Reporting
## Error Reporting {#error_reporting_title}
Error logging can be useful in finding the problem spots in your application, but it can also expose information about
the structure of your application to the outside world. To effectively protect your application from issues that could

View File

@@ -1,4 +1,4 @@
# Testing
# Testing {#testing_title}
Writing automated tests for your PHP code is considered a best practice and can lead to well-built
applications. Automated tests are a great tool for making sure your application

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Test Driven Development
## Test Driven Development {#test_driven_development_title}
From [Wikipedia](http://en.wikipedia.org/wiki/Test-driven_development):

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Behavior Driven Development
## Behavior Driven Development {#behavior_driven_development_title}
There are two different types of Behavior-Driven Development (BDD): SpecBDD and StoryBDD. SpecBDD focuses on technical behavior or code, while StoryBDD focuses on business or feature behaviors or interactions. PHP has frameworks for both types of BDD.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Complementary Testing Tools
## Complementary Testing Tools {#complementary_testing_tools_title}
Besides individual testing and behavior driven frameworks, there are also a number of generic frameworks and helper libraries useful for any preferred approach taken.

View File

@@ -1,3 +1,3 @@
# Servers and Deployment
# Servers and Deployment {#servers_and_deployment_title}
PHP applications can be deployed and run on production web servers in a number of ways.

View File

@@ -3,7 +3,7 @@ title: Platform as a Service (PaaS)
isChild: true
---
## Platform as a Service (PaaS)
## Platform as a Service (PaaS) {#platform_as_a_service_paas_title}
PaaS provides the system and network architecture necessary to run PHP applications on the web. This means little to no
configuration for launching PHP applications or PHP frameworks.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Virtual or Dedicated Servers
## Virtual or Dedicated Servers {#virtual_or_dedicated_servers_title}
If you are comfortable with systems administration, or are interested in learning it, virtual or dedicated servers give you complete control of your application's production environment.

View File

@@ -2,6 +2,6 @@
isChild: true
---
## Shared Servers
## Shared Servers {#shared_servers_title}
PHP has shared servers to thank for its popularity. It is hard to find a host without PHP installed, but be sure it's the latest version. Shared servers allow you and other developers to deploy websites to a single machine. The upside to this is that it has become a cheap commodity. The downside is that you never know what kind of a ruckus your neighboring tenants are going to create; loading down the server or opening up security holes are the main concerns. If your project's budget can afford to avoid shared servers you should.

View File

@@ -1,4 +1,4 @@
# Caching
# Caching {#caching_title}
PHP is pretty quick by itself, but bottlenecks can arise when you make remote connections, load files, etc.
Thankfully, there are various tools available to speed up certain parts of your application, or reduce the number of times these various time consuming tasks need to run.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Bytecode Cache
## Bytecode Cache {#bytecode_cache_title}
When a PHP file is executed, under the hood it is first compiled to bytecode (also known as opcode) and, only then, the bytecode is executed.
If a PHP file is not modified, the bytecode will always be the same. This means that the compilation step is a waste of CPU resources.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Object Caching
## Object Caching {#object_caching_title}
There are times when it can be beneficial to cache individual objects in your code, such as with data that is expensive
to get or database calls where the result is unlikely to change. You can use object caching software to hold these

View File

@@ -1,4 +1,4 @@
# Resources
# Resources {#resources_title}
## From the Source

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Frameworks
## Frameworks {#frameworks_title}
Rather than re-invent the wheel, many PHP developers use frameworks to build out web applications. Frameworks abstract away many of the low-level concerns and provide helpful, easy-to-use interfaces to complete common tasks.

View File

@@ -2,7 +2,7 @@
isChild: true
---
## Components
## Components {#components_title}
As mentioned above "Components" are another approach to the common goal of creating, distributing and implementing shared code. Various
component repositories exist, the main two of which are:

View File

@@ -1,4 +1,4 @@
# Community
# Community {#community_title}
The PHP community is as diverse as it is large, and it's members are ready and willing to support new PHP programmers. You should consider joining your local PHP user group (PUG) or attending larger PHP conferences to learn more about the best practices shown here. You can also hang out on IRC in the #phpc channel on irc.freenode.com and follow the [@phpc][phpc-twitter] twitter account. Get out there, meet new developers, learn new topics and, above all, make new friends.