docs: add "Things about PHP" slides
4
things-to-know-php/README.rst
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Building and presenting slide decks with rst2pdf
|
||||||
|
################################################
|
||||||
|
|
||||||
|
https://www.oliverdavies.uk/talks/building-presenting-slide-decks-rst2pdf
|
12
things-to-know-php/code/building.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
rst2pdf slides.rst
|
||||||
|
|
||||||
|
|
||||||
|
rst2pdf slides.rst --break-level 1 --stylesheets main
|
||||||
|
|
||||||
|
|
||||||
|
rst2pdf slides.rst \
|
||||||
|
--output slides.pdf \
|
||||||
|
--stylesheets main \
|
||||||
|
--break-level 1 \
|
||||||
|
--fit-background-mode scale \
|
||||||
|
--extension-module preprocess
|
4
things-to-know-php/code/includes-code.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.. code-block:: javascript
|
||||||
|
:include: code/additional-config-options.txt
|
||||||
|
:hl_lines: 2 3 4
|
||||||
|
:linenos:
|
1
things-to-know-php/code/includes-sections.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.. include:: sections/intro.rst
|
3
things-to-know-php/code/page-templates-rst.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
PageBreak standardPage
|
6
things-to-know-php/code/page-templates-style.txt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
pageTemplates:
|
||||||
|
standardPage:
|
||||||
|
frames: []
|
||||||
|
[3%, 3%, 92%, 92%]
|
||||||
|
showFooter: true
|
||||||
|
showHeader: false
|
29
things-to-know-php/code/styling.txt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
linkColor: #24608a
|
||||||
|
|
||||||
|
styles:
|
||||||
|
normal:
|
||||||
|
fontSize: 24
|
||||||
|
leading: 32
|
||||||
|
textColor: #383745
|
||||||
|
|
||||||
|
bodytext:
|
||||||
|
alignment: TA_LEFT
|
||||||
|
|
||||||
|
heading:
|
||||||
|
fontSize: 20
|
||||||
|
spaceAfter: 16
|
||||||
|
textColor: #24608a
|
||||||
|
|
||||||
|
title:
|
||||||
|
fontSize: 300%
|
||||||
|
parent: heading
|
||||||
|
textColor: white
|
||||||
|
|
||||||
|
bullet-list:
|
||||||
|
commands: []
|
||||||
|
[LEFTPADDING, [0, 0], [1, -1], 10]
|
||||||
|
[RIGHTPADDING, [0, 0], [1, -1], 0]
|
||||||
|
[VALIGN, [0, 0], [-1, -1], TOP]
|
||||||
|
colWidths: ["20", null]
|
||||||
|
textColor: #aaaaaa
|
||||||
|
|
14
things-to-know-php/code/useful-rst-1.txt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
Building and presenting slide decks with rst2pdf
|
||||||
|
################################################
|
||||||
|
|
||||||
|
.. class:: titleslideinfo
|
||||||
|
|
||||||
|
Oliver Davies (@opdavies)
|
||||||
|
|
||||||
|
|
||||||
|
What is rst2pdf?
|
||||||
|
================
|
||||||
|
|
||||||
|
* "Use a text editor. Make a PDF."
|
||||||
|
* reStructuredText to PDF
|
||||||
|
* Each slide is a page
|
14
things-to-know-php/code/useful-rst-2.txt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
.. image:: images/editing.png
|
||||||
|
:width: 20cm
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:startinline: true
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
echo 'Hello world!';
|
||||||
|
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "This is a speaker note."
|
8
things-to-know-php/code/watching.txt
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
nodemon --ext rst,style,txt --exec "
|
||||||
|
rst2pdf slides.rst \
|
||||||
|
--output slides.pdf \
|
||||||
|
--stylesheets main \
|
||||||
|
--break-level 1 \
|
||||||
|
--fit-background-mode scale \
|
||||||
|
--extension-module preprocess
|
||||||
|
"
|
BIN
things-to-know-php/images/29e90e7f46dbccc3df70c99268f445c9.png
Normal file
After Width: | Height: | Size: 511 KiB |
BIN
things-to-know-php/images/4db44a918090a900e5a1158002bff6c7.png
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
things-to-know-php/images/4f9647e7ae288eb76067e0649f3f854b.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
things-to-know-php/images/6c1a31effb1874282c0d7a207da4727b.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
things-to-know-php/images/9450b42e7f3ec88958cf625c2c10bd70.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
things-to-know-php/images/acquia-certification-website.png
Normal file
After Width: | Height: | Size: 1.8 MiB |
BIN
things-to-know-php/images/b36e0b5ee8c2f78c702ae77545bfa9d5.png
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
things-to-know-php/images/behat-website.png
Normal file
After Width: | Height: | Size: 574 KiB |
BIN
things-to-know-php/images/bg-blue.jpg
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
things-to-know-php/images/codecourse-website.png
Normal file
After Width: | Height: | Size: 840 KiB |
BIN
things-to-know-php/images/composer-logo.png
Normal file
After Width: | Height: | Size: 119 KiB |
BIN
things-to-know-php/images/content-management-systems.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
things-to-know-php/images/d0e6cb728881797d6db089a4960d8db8.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
things-to-know-php/images/drupal-website.png
Normal file
After Width: | Height: | Size: 389 KiB |
BIN
things-to-know-php/images/drupalise-me-website.png
Normal file
After Width: | Height: | Size: 371 KiB |
BIN
things-to-know-php/images/elephpants.jpg
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
things-to-know-php/images/hello-world.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
things-to-know-php/images/jigsaw-website.png
Normal file
After Width: | Height: | Size: 304 KiB |
BIN
things-to-know-php/images/joomla-website.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
things-to-know-php/images/laminas-website.png
Normal file
After Width: | Height: | Size: 731 KiB |
BIN
things-to-know-php/images/laracasts-website.png
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
things-to-know-php/images/laravel-website.png
Normal file
After Width: | Height: | Size: 244 KiB |
BIN
things-to-know-php/images/packagist-symfony-console.png
Normal file
After Width: | Height: | Size: 369 KiB |
BIN
things-to-know-php/images/packagist-website.png
Normal file
After Width: | Height: | Size: 632 KiB |
BIN
things-to-know-php/images/perch-website.png
Normal file
After Width: | Height: | Size: 530 KiB |
BIN
things-to-know-php/images/pest-website.png
Normal file
After Width: | Height: | Size: 637 KiB |
BIN
things-to-know-php/images/php-fig-website.png
Normal file
After Width: | Height: | Size: 1 MiB |
BIN
things-to-know-php/images/php-logo.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
things-to-know-php/images/php-south-wales-website.png
Normal file
After Width: | Height: | Size: 248 KiB |
BIN
things-to-know-php/images/php-south-west-website.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
things-to-know-php/images/php-uk-website.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
things-to-know-php/images/php-versions.png
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
things-to-know-php/images/phpstan-website.png
Normal file
After Width: | Height: | Size: 188 KiB |
BIN
things-to-know-php/images/phpug-website.png
Normal file
After Width: | Height: | Size: 953 KiB |
BIN
things-to-know-php/images/phpunit-website.png
Normal file
After Width: | Height: | Size: 298 KiB |
BIN
things-to-know-php/images/projects-using-symfony.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
things-to-know-php/images/sculpin-website.png
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
things-to-know-php/images/server-side-languages.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
things-to-know-php/images/symfony-certification-website.png
Normal file
After Width: | Height: | Size: 672 KiB |
BIN
things-to-know-php/images/symfony-components.png
Normal file
After Width: | Height: | Size: 582 KiB |
BIN
things-to-know-php/images/symfony-website.png
Normal file
After Width: | Height: | Size: 540 KiB |
BIN
things-to-know-php/images/symfonycasts-website.png
Normal file
After Width: | Height: | Size: 626 KiB |
BIN
things-to-know-php/images/typo3-website.png
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
things-to-know-php/images/wordpress-website.png
Normal file
After Width: | Height: | Size: 317 KiB |
BIN
things-to-know-php/images/xdebug-example.png
Normal file
After Width: | Height: | Size: 647 KiB |
BIN
things-to-know-php/images/xdebug-website.png
Normal file
After Width: | Height: | Size: 548 KiB |
BIN
things-to-know-php/images/zend-certification-website.png
Normal file
After Width: | Height: | Size: 991 KiB |
129
things-to-know-php/main.style
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
pageSetup:
|
||||||
|
firstTemplate: coverPage
|
||||||
|
height: 18cm
|
||||||
|
margin-bottom: 0cm
|
||||||
|
margin-gutter: 0cm
|
||||||
|
margin-left: 0cm
|
||||||
|
margin-right: 0cm
|
||||||
|
margin-top: 0cm
|
||||||
|
size: null
|
||||||
|
spacing-footer: 2mm
|
||||||
|
spacing-header: 2mm
|
||||||
|
width: 32cm
|
||||||
|
|
||||||
|
pageTemplates:
|
||||||
|
coverPage:
|
||||||
|
# background: images/title.png
|
||||||
|
frames: []
|
||||||
|
[12%, 10%, 76%, 75%]
|
||||||
|
showFooter: false
|
||||||
|
showHeader: false
|
||||||
|
|
||||||
|
titlePage:
|
||||||
|
alignment: TA_CENTER
|
||||||
|
frames: []
|
||||||
|
[8%, 8%, 85%, 65%]
|
||||||
|
showFooter: true
|
||||||
|
showHeader: false
|
||||||
|
|
||||||
|
standardPage:
|
||||||
|
frames: []
|
||||||
|
[3%, 3%, 92%, 92%]
|
||||||
|
showFooter: true
|
||||||
|
showHeader: false
|
||||||
|
|
||||||
|
imagePage:
|
||||||
|
alignment: TA_CENTER
|
||||||
|
frames: []
|
||||||
|
[12%, 10%, 76%, 80%]
|
||||||
|
showFooter: true
|
||||||
|
showHeader: false
|
||||||
|
|
||||||
|
outputPage:
|
||||||
|
frames: []
|
||||||
|
[8%, 10%, 82%, 65%]
|
||||||
|
showFooter: false
|
||||||
|
showHeader: false
|
||||||
|
|
||||||
|
linkColor: #24608a
|
||||||
|
|
||||||
|
fontsAlias:
|
||||||
|
stdMono: Inconsolata-Regular
|
||||||
|
stdMonoBold: Inconsolata-Regular
|
||||||
|
stdMonoBoldItalic: Inconsolata-Regular
|
||||||
|
stdMonoItalic: Inconsolata-Regular
|
||||||
|
|
||||||
|
styles:
|
||||||
|
normal:
|
||||||
|
fontSize: 24
|
||||||
|
leading: 32
|
||||||
|
textColor: #383745
|
||||||
|
|
||||||
|
bodytext:
|
||||||
|
alignment: TA_LEFT
|
||||||
|
|
||||||
|
heading:
|
||||||
|
fontSize: 20
|
||||||
|
spaceAfter: 16
|
||||||
|
textColor: #24608a
|
||||||
|
|
||||||
|
title:
|
||||||
|
fontSize: 300%
|
||||||
|
parent: heading
|
||||||
|
|
||||||
|
bullet-list:
|
||||||
|
commands: []
|
||||||
|
[LEFTPADDING, [0, 0], [1, -1], 10]
|
||||||
|
[RIGHTPADDING, [0, 0], [1, -1], 0]
|
||||||
|
[VALIGN, [0, 0], [-1, -1], TOP]
|
||||||
|
colWidths: ["20", null]
|
||||||
|
textColor: #aaaaaa
|
||||||
|
|
||||||
|
bullet-list-item:
|
||||||
|
spaceBefore: 14
|
||||||
|
spaceAfter: 0
|
||||||
|
|
||||||
|
titleslideinfo:
|
||||||
|
alignment: TA_CENTER
|
||||||
|
fontSize: 140%
|
||||||
|
parent: normal
|
||||||
|
|
||||||
|
footer:
|
||||||
|
alignment: TA_RIGHT
|
||||||
|
fontName: stdMono
|
||||||
|
fontSize: 20
|
||||||
|
textColor: #24608a
|
||||||
|
rightIndent: 16
|
||||||
|
spaceBefore: 0
|
||||||
|
|
||||||
|
literal:
|
||||||
|
backColor: white
|
||||||
|
fontName: stdMono
|
||||||
|
|
||||||
|
code:
|
||||||
|
backColor: white
|
||||||
|
borderWidth: 0
|
||||||
|
fontSize: 20
|
||||||
|
leading: 24
|
||||||
|
parent: literal
|
||||||
|
spaceBefore: 4
|
||||||
|
|
||||||
|
blockquote:
|
||||||
|
parent: normal
|
||||||
|
fontName: stdItalic
|
||||||
|
leading: 36
|
||||||
|
|
||||||
|
attribution:
|
||||||
|
parent: normal
|
||||||
|
textColor: #66666
|
||||||
|
|
||||||
|
centred:
|
||||||
|
alignment: TA_CENTER
|
||||||
|
parent: normal
|
||||||
|
|
||||||
|
centredtitle:
|
||||||
|
alignment: TA_CENTER
|
||||||
|
fontName: stdBold
|
||||||
|
fontSize: 48
|
||||||
|
leading: 64
|
||||||
|
parent: heading
|
49
things-to-know-php/sections/cms.rst
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
Levelling Up
|
||||||
|
============
|
||||||
|
|
||||||
|
Content Management Systems
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Move from simple pages or CLI apps, need to level up"
|
||||||
|
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredtitle
|
||||||
|
|
||||||
|
These lists are not exhaustive
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Other CMSes, frameworks and tools are available. These are the ones that came to mind for me."
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/drupal-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/wordpress-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/joomla-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "The big three PHP frameworks."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/typo3-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/perch-website.png
|
||||||
|
:width: 23cm
|
86
things-to-know-php/sections/code-reuse.rst
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
Code reuse and collaboration
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
.. image:: images/projects-using-symfony.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/composer-logo.png
|
||||||
|
:height: 10cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/packagist-website.png
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/packagist-symfony-console.png
|
||||||
|
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredtitle
|
||||||
|
|
||||||
|
``composer require
|
||||||
|
symfony/console``
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: json
|
||||||
|
|
||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"symfony/console": "^4.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
|
$app = new \Symfony\Component\Console\Application();
|
||||||
|
$app->run();
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Application;
|
||||||
|
|
||||||
|
$app = new Application();
|
||||||
|
$app->run();
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/symfony-components.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/php-fig-website.png
|
||||||
|
:width: 23cm
|
23
things-to-know-php/sections/community.rst
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
The Community
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/php-south-west-website.png
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/php-uk-website.png
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/phpug-website.png
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "These events are happening all over the world, for PHP and for it's sub-communities."
|
||||||
|
TextAnnotation "PHP World, php[tek] (organised by PHP Architect), DrupalCon, SymfonyCon, Laracon, PHP UK, PHP Benelux, Sunshine PHP"
|
||||||
|
|
21
things-to-know-php/sections/frameworks.rst
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
Levelling Up
|
||||||
|
============
|
||||||
|
|
||||||
|
Frameworks
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/symfony-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/laravel-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/laminas-website.png
|
||||||
|
:width: 23cm
|
257
things-to-know-php/sections/getting-started.rst
Normal file
|
@ -0,0 +1,257 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
How do I get started?
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
``php -v``
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
``PHP 8.1.0 (cli) (built: Nov 30 2021 07:15:23) (NTS)
|
||||||
|
Copyright (c) The PHP Group
|
||||||
|
Zend Engine v4.1.0, Copyright (c) Zend Technologies``
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
``vim index.php``
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Create a new file called 'index.php' in the text editor of your choice."
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
Your first PHP file
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// index.php
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Add an opening tag (closing tag is optional, and in some cases should not be used)."
|
||||||
|
|
||||||
|
Your first PHP file
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// index.php
|
||||||
|
|
||||||
|
echo 'Hello World';
|
||||||
|
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
``php index.php``
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
``php -S localhost:8000``
|
||||||
|
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
``/app # php -S localhost:8000``
|
||||||
|
|
||||||
|
``[Tue Mar 8 20:52:39 2022] PHP 8.1.0 Development Server
|
||||||
|
(http://localhost:8000) started``
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "PHP's local development web server. Fine for simple scripts or apps."
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/hello-world.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
``docker run --rm
|
||||||
|
-v $PWD:/app
|
||||||
|
-w /app
|
||||||
|
php:8.1-cli-alpine
|
||||||
|
php index.php``
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
``docker run --rm
|
||||||
|
-v $PWD:/app
|
||||||
|
-w /app
|
||||||
|
php:7.4-cli-alpine
|
||||||
|
php index.php``
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "7.4 instead of 8.1"
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
``docker run --rm
|
||||||
|
-v $PWD:/var/www/html
|
||||||
|
-p 80:80
|
||||||
|
php:8.1-apache``
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Apache rather than CLI"
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// index.php
|
||||||
|
|
||||||
|
function say()
|
||||||
|
{
|
||||||
|
echo 'Hello!';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Global function."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// index.php
|
||||||
|
|
||||||
|
function say($value)
|
||||||
|
{
|
||||||
|
echo $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// index.php
|
||||||
|
|
||||||
|
function say(string $value): void
|
||||||
|
{
|
||||||
|
echo $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "In PHP 7, we can declare type hints on scalar values (e.g. string). Arrays and classes were possible in previous versions."
|
||||||
|
TextAnnotation "We can also declare a return type. In this case, there is nothing returned, so the return type is `void`."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// index.php
|
||||||
|
|
||||||
|
function say(string $value): string
|
||||||
|
{
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Return a string rather than echoing a string."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// src/Person.php
|
||||||
|
|
||||||
|
class Person
|
||||||
|
{
|
||||||
|
public function say(string $value): void
|
||||||
|
{
|
||||||
|
echo $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Move it into a class called `Person`. Function now becomes a method, though behaves in exactly the same way."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Version 1.
|
||||||
|
say();
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Version 1.
|
||||||
|
say();
|
||||||
|
|
||||||
|
// Version 2.
|
||||||
|
say('something');
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "First version with no arguments."
|
||||||
|
TextAnnotation "Second version providing the text as an argument."
|
||||||
|
TextAnnotation "Third version using the Person class."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Version 1.
|
||||||
|
say();
|
||||||
|
|
||||||
|
// Version 2.
|
||||||
|
say('something');
|
||||||
|
|
||||||
|
// Version 3.
|
||||||
|
$person = new Person();
|
||||||
|
$person->say('something');
|
69
things-to-know-php/sections/introduction.rst
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/php-logo.png
|
||||||
|
:width: 15cm
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Working with PHP and Drupal since 2007 as a hobbyist and Freelancer, full-time since 2010."
|
||||||
|
TextAnnotation "Currently working as a Lead Developer at Transport for Wales."
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
elePHPants!
|
||||||
|
===========
|
||||||
|
|
||||||
|
.. image:: images/elephpants.jpg
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
What is PHP?
|
||||||
|
============
|
||||||
|
|
||||||
|
PHP is a popular general-purpose scripting language that is especially suited to web development.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
||||||
|
Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
||||||
|
http://php.net
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "First released in 2005, most recent release (8.1.3) on 17th February 2022."
|
||||||
|
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
Personal Home Page
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
PHP: Hypertext Preprocessor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
||||||
|
.. class:: centred
|
||||||
|
|
||||||
|
(recursive acronym)
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/php-versions.png
|
||||||
|
:width: 25cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/server-side-languages.png
|
||||||
|
:width: 25cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/content-management-systems.png
|
||||||
|
:width: 25cm
|
49
things-to-know-php/sections/learning.rst
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
Learning
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/drupalise-me-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/symfonycasts-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/laracasts-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/codecourse-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/zend-certification-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "This leads to achieving certifications which help with personal development and career progression."
|
||||||
|
TextAnnotation "Zend offer certification on the PHP language and formerly on Zend framework (now Laminas)."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/acquia-certification-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/symfony-certification-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Symfony and Twig"
|
22
things-to-know-php/sections/static-site-generators.rst
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
But I only need a static site
|
||||||
|
=============================
|
||||||
|
|
||||||
|
Static site generators
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "My personal website falls into this category."
|
||||||
|
TextAnnotation "Write HTML or markdown."
|
||||||
|
TextAnnotation "Use a familiar templating engine like Twig or Laravel's Blade."
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/sculpin-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/jigsaw-website.png
|
||||||
|
:width: 23cm
|
111
things-to-know-php/sections/tools.rst
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
.. page:: titlePage
|
||||||
|
|
||||||
|
.. class:: centredTitle
|
||||||
|
|
||||||
|
Tools
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/composer-logo.png
|
||||||
|
:height: 10cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/xdebug-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Xdebug is a PHP extension that provides debugging and profiling capabilities."
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/xdebug-example.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Add a breakpoint, halts execution"
|
||||||
|
TextAnnotation "Shows a stack trace and variables within scope"
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/phpunit-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. image:: images/pest-website.png
|
||||||
|
:width: 22cm
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// PHPUnit.
|
||||||
|
|
||||||
|
use App\Email;
|
||||||
|
|
||||||
|
final class EmailTest extends TestCase
|
||||||
|
{
|
||||||
|
public function testCanBeCreatedFromValidEmailAddress(): void
|
||||||
|
{
|
||||||
|
$this->assertInstanceOf(
|
||||||
|
Email::class,
|
||||||
|
Email::fromString('user@example.com')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.. page::
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Pest.
|
||||||
|
|
||||||
|
use App\Email;
|
||||||
|
|
||||||
|
it('can be created from a valid email address', function () {
|
||||||
|
expect(Email::fromString('user@example.com'))
|
||||||
|
->toBeInstanceOf(Email::class);
|
||||||
|
});
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/behat-website.png
|
||||||
|
:width: 23cm
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "Behavior Driven Development (BDD), business-focussed, user story style"
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
.. code-block:: gherkin
|
||||||
|
|
||||||
|
Feature: ls
|
||||||
|
In order to see the directory structure
|
||||||
|
As a UNIX user
|
||||||
|
I need to be able to list the current directory's contents
|
||||||
|
|
||||||
|
Scenario: List 2 files in a directory
|
||||||
|
Given I am in a directory "test"
|
||||||
|
And I have a file named "foo"
|
||||||
|
And I have a file named "bar"
|
||||||
|
When I run "ls"
|
||||||
|
Then I should get:
|
||||||
|
"""
|
||||||
|
bar
|
||||||
|
foo
|
||||||
|
"""
|
||||||
|
|
||||||
|
.. page:: imagePage
|
||||||
|
|
||||||
|
.. image:: images/phpstan-website.png
|
||||||
|
:width: 23cm
|
58
things-to-know-php/slides.rst
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
.. footer:: @opdavies
|
||||||
|
|
||||||
|
Things to know about PHP
|
||||||
|
########################
|
||||||
|
|
||||||
|
|
|
||||||
|
|
||||||
|
.. class:: titleslideinfo text-white
|
||||||
|
|
||||||
|
Oliver Davies (@opdavies)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
||||||
|
.. class:: centred
|
||||||
|
|
||||||
|
https://oliverdavies.uk/things-about-php
|
||||||
|
|
||||||
|
.. include:: sections/introduction.rst
|
||||||
|
.. include:: sections/getting-started.rst
|
||||||
|
.. include:: sections/cms.rst
|
||||||
|
.. include:: sections/frameworks.rst
|
||||||
|
.. include:: sections/static-site-generators.rst
|
||||||
|
.. include:: sections/code-reuse.rst
|
||||||
|
.. include:: sections/tools.rst
|
||||||
|
.. include:: sections/learning.rst
|
||||||
|
.. include:: sections/community.rst
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
Things you should know about PHP
|
||||||
|
================================
|
||||||
|
|
||||||
|
* Very easy to get started
|
||||||
|
* A large choice of tools and frameworks
|
||||||
|
* A great worldwide community
|
||||||
|
* Great learning resources
|
||||||
|
* Gain experience by contributing to open source projects
|
||||||
|
|
||||||
|
.. raw:: pdf
|
||||||
|
|
||||||
|
TextAnnotation "CMSes, frameworks, eCommerce, APIs, static sites"
|
||||||
|
TextAnnotation "Gain experience and kudos by contributing to open source projects."
|
||||||
|
TextAnnotation "Most of these have their source code posted online with an appropriate license, hosted on GitHub or elsewhere. If you find a bug or want a feature added, you have the ability to create or fix it yourself and contribute it back to the project."
|
||||||
|
|
||||||
|
.. page:: standardPage
|
||||||
|
|
||||||
|
Thanks!
|
||||||
|
=======
|
||||||
|
|
||||||
|
References:
|
||||||
|
|
||||||
|
* https://www.oliverdavies.uk/things-about-php
|
||||||
|
|
||||||
|
|
|
||||||
|
|
||||||
|
Me:
|
||||||
|
|
||||||
|
* https://www.oliverdavies.uk
|