diff --git a/_posts/01-04-01-Mac-Setup.md b/_posts/01-04-01-Mac-Setup.md index 471c2fa..403d6ba 100644 --- a/_posts/01-04-01-Mac-Setup.md +++ b/_posts/01-04-01-Mac-Setup.md @@ -12,9 +12,8 @@ There are multiple ways to install PHP on OS X. ### Install PHP via Homebrew -[Homebrew](http://brew.sh/) is a powerful package manager for OS X, which can help you install PHP and various -extensions easily. [Homebrew PHP] is a repository that contains PHP-related "formulae" for Homebrew, and will let you -install PHP. +[Homebrew] is a powerful package manager for OS X, which can help you install PHP and various extensions easily. +[Homebrew PHP] is a repository that contains PHP-related "formulae" for Homebrew, and will let you install PHP. At this point, you can install `php53`, `php54`, `php55` or `php56` using the `brew install` command, and switch between them by modifying your `PATH` variable. @@ -27,8 +26,8 @@ applications/projects require different versions of PHP, and you are not using v ### Compile from Source Another option that gives you control over the version of PHP you install, is to [compile it yourself][mac-compile]. -In that case be sure to have installed either Xcode or Apple's substitute ["Command Line Tools for XCode"] -downloadable from Apple's Mac Developer Center. +In that case be sure to have installed either [Xcode][xcode-gcc-substitution] or Apple's substitute +["Command Line Tools for XCode"] downloadable from Apple's Mac Developer Center. ### All-in-One Installers @@ -38,10 +37,9 @@ you and tie them all together, but ease of setup comes with a trade-off of flexi [Homebrew]: http://brew.sh/ [Homebrew PHP]: https://github.com/Homebrew/homebrew-php#installation +[phpbrew]: https://github.com/phpbrew/phpbrew [mac-compile]: http://php.net/install.macosx.compile [xcode-gcc-substitution]: https://github.com/kennethreitz/osx-gcc-installer - ["Command Line Tools for XCode"]: https://developer.apple.com/downloads [mamp-downloads]: http://www.mamp.info/en/downloads/ -[phpbrew]: https://github.com/phpbrew/phpbrew [xampp]: http://www.apachefriends.org/en/xampp.html diff --git a/_posts/01-05-01-Windows-Setup.md b/_posts/01-05-01-Windows-Setup.md index 1a56bf2..72c8838 100644 --- a/_posts/01-05-01-Windows-Setup.md +++ b/_posts/01-05-01-Windows-Setup.md @@ -20,10 +20,10 @@ FastCGI built in and ready to go, you just need to configure PHP as a handler. F there is a [dedicated area on iis.net][php-iis] for PHP. [php-downloads]: http://windows.php.net -[phpmanager]: http://phpmanager.codeplex.com/ [wpi]: http://www.microsoft.com/web/downloads/platform.aspx [zsce]: http://www.zend.com/en/products/server-ce/ [xampp]: http://www.apachefriends.org/en/xampp.html [easyphp]: http://www.easyphp.org/ [wamp]: http://www.wampserver.com/en/ +[phpmanager]: http://phpmanager.codeplex.com/ [php-iis]: http://php.iis.net/ diff --git a/_posts/03-02-01-Programming-Paradigms.md b/_posts/03-02-01-Programming-Paradigms.md index cdc7924..0ec474c 100644 --- a/_posts/03-02-01-Programming-Paradigms.md +++ b/_posts/03-02-01-Programming-Paradigms.md @@ -47,15 +47,17 @@ available as `__call()` and `__callStatic()`. * [Read about Magic Methods][magic-methods] * [Read about Reflection][reflection] +* [Read about Overloading][overloading] + -[namespaces]: http://php.net/language.namespaces -[overloading]: http://php.net/language.oop5.overloading [oop]: http://php.net/language.oop5 +[traits]: http://php.net/language.oop5.traits [anonymous-functions]: http://php.net/functions.anonymous [closure-class]: http://php.net/class.closure +[closures-rfc]: https://wiki.php.net/rfc/closures [callables]: http://php.net/language.types.callable +[call-user-func-array]: http://php.net/function.call-user-func-array [magic-methods]: http://php.net/language.oop5.magic [reflection]: http://php.net/intro.reflection -[traits]: http://php.net/language.oop5.traits -[call-user-func-array]: http://php.net/function.call-user-func-array -[closures-rfc]: https://wiki.php.net/rfc/closures +[overloading]: http://php.net/language.oop5.overloading + diff --git a/_posts/03-05-01-Command-Line-Interface.md b/_posts/03-05-01-Command-Line-Interface.md index 7f700b9..a6836e6 100644 --- a/_posts/03-05-01-Command-Line-Interface.md +++ b/_posts/03-05-01-Command-Line-Interface.md @@ -58,6 +58,6 @@ Hello, world [cli-options]: http://php.net/features.commandline.options [argc]: http://php.net/reserved.variables.argc [argv]: http://php.net/reserved.variables.argv +[exit-codes]: http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits [php-cli]: http://php.net/features.commandline [php-cli-windows]: http://php.net/install.windows.commandline -[exit-codes]: http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits diff --git a/_posts/03-06-01-XDebug.md b/_posts/03-06-01-XDebug.md index 47489c9..964b504 100644 --- a/_posts/03-06-01-XDebug.md +++ b/_posts/03-06-01-XDebug.md @@ -40,6 +40,6 @@ stand-alone xdebug GUI for Mac. * [Learn more about XDebug][xdebug-docs] * [Learn more about MacGDBp][macgdbp-install] -[xdebug-docs]: http://xdebug.org/docs/ [xdebug-install]: http://xdebug.org/docs/install +[xdebug-docs]: http://xdebug.org/docs/ [macgdbp-install]: http://www.bluestatic.org/software/macgdbp/ diff --git a/_posts/06-05-01-Further-Reading.md b/_posts/06-05-01-Further-Reading.md index a2e512d..92df80f 100644 --- a/_posts/06-05-01-Further-Reading.md +++ b/_posts/06-05-01-Further-Reading.md @@ -5,8 +5,8 @@ anchor: further_reading ## Further Reading {#further_reading_title} -- [Learning about Dependency Injection and PHP](http://ralphschindler.com/2011/05/18/learning-about-dependency-injection-and-php) -- [What is Dependency Injection?](http://fabien.potencier.org/article/11/what-is-dependency-injection) -- [Dependency Injection: An analogy](http://mwop.net/blog/260-Dependency-Injection-An-analogy.html) -- [Dependency Injection: Huh?](http://net.tutsplus.com/tutorials/php/dependency-injection-huh/) -- [Dependency Injection as a tool for testing](http://philipobenito.github.io/dependency-injection-as-a-tool-for-testing/) +* [Learning about Dependency Injection and PHP](http://ralphschindler.com/2011/05/18/learning-about-dependency-injection-and-php) +* [What is Dependency Injection?](http://fabien.potencier.org/article/11/what-is-dependency-injection) +* [Dependency Injection: An analogy](http://mwop.net/blog/260-Dependency-Injection-An-analogy.html) +* [Dependency Injection: Huh?](http://net.tutsplus.com/tutorials/php/dependency-injection-huh/) +* [Dependency Injection as a tool for testing](http://philipobenito.github.io/dependency-injection-as-a-tool-for-testing/) diff --git a/_posts/07-01-01-Databases.md b/_posts/07-01-01-Databases.md index dfb780c..08ab290 100644 --- a/_posts/07-01-01-Databases.md +++ b/_posts/07-01-01-Databases.md @@ -15,18 +15,18 @@ same drivers. You'll need to learn a brand new API for each database — and ## MySQL Extension -The [mysql] extension for PHP is no longer in active development, and is [officially deprecated as of PHP 5.5.0], -meaning that it will be removed within the next few releases. If you are using any functions that start with `mysql_*` -such as `mysql_connect()` and `mysql_query()` in your applications then these will simply not be available in later -versions of PHP. This means you will be faced with a rewrite at some point down the line, so the best option is to -replace mysql usage with [mysqli] or [PDO] in your applications within your own development schedules so you won't be -rushed later on. +The [mysql] extension for PHP is no longer in active development, and is [officially deprecated as of PHP 5.5.0] +[mysql_deprecated], meaning that it will be removed within the next few releases. If you are using any functions that +start with `mysql_*` such as `mysql_connect()` and `mysql_query()` in your applications then these will simply not be +available in later versions of PHP. This means you will be faced with a rewrite at some point down the line, so the +best option is to replace mysql usage with [mysqli] or [PDO] in your applications within your own development schedules +so you won't be rushed later on. **If you are starting from scratch then absolutely do not use the [mysql] extension: use the [MySQLi extension][mysqli], or use [PDO].** -* [PHP: Choosing an API for MySQL](http://php.net/mysqlinfo.api.choosing) -* [PDO Tutorial for MySQL Developers](http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers) +* [PHP: Choosing an API for MySQL][mysql_api] +* [PDO Tutorial for MySQL Developers][pdo4mysql_devs] ## PDO Extension @@ -66,10 +66,9 @@ $pdo->query("SELECT name FROM users WHERE id = " . $_GET['id']); // <-- NO! {% endhighlight %} This is terrible code. You are inserting a raw query parameter into a SQL query. This will get you hacked in a -heartbeat, using a practice called [SQL Injection](http://wiki.hashphp.org/Validation). Just imagine if a hacker -passes in an inventive `id` parameter by calling a URL like `http://domain.com/?id=1%3BDELETE+FROM+users`. This will -set the `$_GET['id']` variable to `1;DELETE FROM users` which will delete all of your users! Instead, you should -sanitize the ID input using PDO bound parameters. +heartbeat, using a practice called [SQL Injection]. Just imagine if a hacker passes in an inventive `id` parameter by +calling a URL like `http://domain.com/?id=1%3BDELETE+FROM+users`. This will set the `$_GET['id']` variable to `1;DELETE +FROM users` which will delete all of your users! Instead, you should sanitize the ID input using PDO bound parameters. {% highlight php %}