automazione quotidiana in php
TRANSCRIPT
![Page 1: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/1.jpg)
Automazione quotidiana in PHP
Il centro benessere del programmatore
![Page 2: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/2.jpg)
http://phpday.it #phpday @k3aAutomazione
![Page 3: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/3.jpg)
Qualità predicibile
![Page 4: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/4.jpg)
Risparmio di tempo
![Page 5: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/5.jpg)
Pace interiore
![Page 6: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/6.jpg)
Deploy Backup Lavare la macchina Trasformare immagini Test del codice
Creazione documentazione Aggiornamento librerie Verifica
perfomance Alalisi dei log Lavare i denti Minimizzare JS e CSS Pulire cache
Inizializzare progetti Creare macchine virtuali Lanciare servizi Applicare patch ...
![Page 7: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/7.jpg)
http://phpday.it #phpday @k3aGNU make
![Page 8: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/8.jpg)
bmakebuildcake
Clearmakedistcc
distmakeDmakeJMakeJMK
kbuildmake
makeLibmakeme
MakeModulesMake:NGmakeplusmakepp
make utilitiesmk
mk-configuremmm
Mosmake
MPW MakenmakeOMake
Opus MakeParadigm
Visual Make
Prime MoverPrototype Makefiles
PVM Gmake
qmakeRakeSire
smakeSupermake
SMKtmkYabu
![Page 9: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/9.jpg)
Apache AntApache Buildr
Apache IvyApache Maven
A-A-PBoost.Build
brasbuilditis
BuildtoolCabalCakecakecook
dev-envFlowtracer
GantGconfigure
Gradlehmake
Hyper BuildInvmakeIstrice
leiningenMeique
microbuildMSBuild
mxx-ruNAntninja
ocamlbuildOdinOSEpake
Perforce JamPerlBuildSystem
PhingProjectBuilder
pyntRant
SchmantSimple Build Tool
SConsShake
Source 2 BinarySweet Build
tupTweaker
Visual BuildWaf
XMakeXMAKEYruba
![Page 10: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/10.jpg)
• immagine di GITHUB
![Page 11: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/11.jpg)
phing
pake[la versione php non python]
idephix
![Page 12: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/12.jpg)
Defining task [phing]<?xml version="1.0" encoding="UTF-8"?>
<project name="Foo" default="foo">
<target name="foo"
description="Description of foo task">
<echo msg="I am the ‘foo’ task" />
</target>
</project>
![Page 13: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/13.jpg)
Run task [phing]$ phing -l
Buildfile: /Users/kea/build.xml
Default target:---------------------------------------------- foo Description of foo task
Subtargets:---------------------------------------------- foo Description of foo task
![Page 14: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/14.jpg)
Run task [phing]$ phing foo
Buildfile: /Users/kea/build.xml
Foo > foo:
[echo] I am the ‘foo’ task
BUILD FINISHED
Total time: 0,0563 seconds
![Page 15: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/15.jpg)
Defining task [pake]<?php
pake_desc('Description of foo task');
pake_task('foo');
function run_foo()
{
pake_echo('I am the "foo" task');
}
![Page 16: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/16.jpg)
Run task [pake]$ pake -T
available pake tasks:
foo > Description of foo task
$ pake foo
I am the "foo" task
![Page 17: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/17.jpg)
Defining task [idephix]<?php$idx = new Idephix();/** @Description Description of foo task */$idx->add('foo', function () {
echo "'I am the \"foo\" task'”;}$idx->run();
![Page 18: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/18.jpg)
Defining task [idephix]<?php$idx = new Idephix();/** @Description Description of foo task */$idx->add('foo', function () use ($idx) {
$idx->output->writeln( "'I am the \"foo\" task'");
}$idx->run();
![Page 19: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/19.jpg)
Run task [idephix]$ idx ___ _ _ _ |_ _|__| | ___ _ __ | |__ (_)_ __ | |/ _` |/ _ \ '_ \| '_ \| \ \/ / | | (_| | __/ |_) | | | | |> < |___\__,_|\___| .__/|_| |_|_/_/\_\ |_|Usage: [options] command [arguments]
Options: --help -h Display this help message.... --env Set remote environment.
Available commands: foo Description of foo task help Displays help for a command list Lists commands
![Page 20: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/20.jpg)
Run task [idephix]
$ idx foo
I am the "foo" task
![Page 21: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/21.jpg)
local - remote [idephix]$targets = array( 'test' => array( 'hosts' => array('server1.com', 'server2.com'), 'ssh_params' => array('user' => 'kea') ),);
$idx = new Idephix($targets);
$idx-> add('myTask:touchMe', function ($name, $go = false) use ($idx) { $idx->local('touch /tmp/'.$name); $idx->remote('touch /tmp/'.$name.'_remote'); });
![Page 22: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/22.jpg)
Quali sono le differenze?
![Page 23: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/23.jpg)
Pro
Phing
general purpose# task built-in
documentazionelarga diffusione
php in-task
Pake
general purpose# task built-inscrittura conf.file conf. PHP
Idephix
general purposemulti server
scrittura conf.file conf. PHP
![Page 24: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/24.jpg)
Contro
Phing
grandi file conf. poco leggibili e
mantenibiliphp in-task
Pake
documentazionescarsamente
diffuso
Idephix
alphascarsamente
diffuso (per ora)
![Page 25: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/25.jpg)
... altro?
![Page 26: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/26.jpg)
PhpUnit
SSH
rsync
...
Perchè ho bisogno di un tool che “wrappa” X?
{X =
![Page 27: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/27.jpg)
Ego slide
• Manuel “Kea” Baldassarri
• COO in
• Webdev dal 1992 e PHP dev dal 1998
• Coautore di “Pro PHP: best practices”
• Marito e bi-padre
• [email protected] twitter: k3a
• flickr: kea42 slideshare: kea42
![Page 28: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/28.jpg)
Grazie!
![Page 29: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/29.jpg)
?twitter: k3a slideshare: kea42
![Page 30: Automazione quotidiana in php](https://reader034.vdocumenti.com/reader034/viewer/2022042607/554de1a1b4c905c70e8b5533/html5/thumbnails/30.jpg)
Copyright
• Tempi moderni [Charles Chaplin 1936]
• Harry Potter e il prigioniero di Azkaban [Warner Bros. Pictures 2004]
• In time [20th Century Fox 2011]
• Kung fu panda 2 [DreamWorks Animation 2011]