SymfonyLive London 2015

Puli, la próxima revolución en la gestión de paquetes PHP

Bernhard Schussek  · 
PHP

Presentación

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

thank you very much hello everybody um thank you to in Rica for inviting me to the symphony life London conference it's the first time I'm in London and I'm very excited about it bits because it's a great city it's really i just spent one

day walking around and I love it I mean really so welcome and thanks for joining my talk as Tony said I'm talking about pulley latest project of mine for those that yeah I had some added some introduction to my slides as well since I wasn't aware that

Tony would introduce me so well so i'm bernard shaw sec or ban ha cha sik that's the way you pronounce it in german it's a great international name it's very easy to remember very easy to spell really people almost never get it wrong anyway

I'm Symphony core developer since 2009's things that sick representative for two years now and my latest project is pulley which I started about one and a half years ago you can you know me by the nickname of wet mode sort so you can follow web martes

and Twitter a PHP trainer and coach yeah if you have any like requirements and that regard visit my website which is pretty new right now and again in touch with me so follow web monster on twitter if you don't already and you can see all the latest all

the updates about symphony and add pouliot that i'm doing so what is fully how many of you have heard about pulley before not so many alright i prepared a little video about pulley so that you can let's see if i get some sound max chillin hey everybody

Johnny hema see Charlie days I've been true everybody get a fun night night for the great tastes that will fill you up and never let you down make it a Bud Light you might be wondering how the hell this is related to fully right I'll tell you so pleased

to start I designed the video it's a Hungarian dog breed which is pretty awesome because it looks kind of funky what it runs you hardly ever seed size it's I find it incredible that it's actually able to see and it's very important in Nigeria

used to be used for herding sheep and it's like the national animal of time so that's actually the where the name comes from like Puli was my sister had a coolie which was a dog and it was such an amazing animal that I thought if I create a project

that I'm named after an animal I'm always thinking about that dog when I'm working on the project which kind of motivates me a lot right it's kind of a nice thought about thinking about that project and thinking about this like cute dog but

of course i'm not talking about dogs today i'm talking about PHP development so old school PHP development like early 2000s used to be something like this you had an application and basically you wrote everything yourself you knew all the code that

you wrote perfectly because it was you today we're not doing that anymore fortunately since we had composer we're using more and more third-party libraries and third-party code in our applications and the benefit of that is the more third particle

we use the easier it is for us to write applications right the mobile can you reuse the quicker we can set an application up the last code we have to maintain the less bugs we have 26 right so that is essential for writing applications nowadays so i'll

say reuse the existing high quality packages is key to success so composer basically is a dependency manager composer installs the packages it checks all the dependencies of the package stuff that you want to install install Sam as well and it builds an autoloader

so they can auto load all the classes that you have in all these packages in your PHP code that's all it does let's see how it looks more or less the composer packages like I directory on your file system that contains some PHP code and a composer

chaser file the tells composer how to install the package and how to resolve the dependencies of that package pretty simple in your application if you lay it down it looks something like this you have composer packages at the bottom that you install using

composer like your translator package or twig or some block module or whatever and then you have your domain logic of your application on top of that and in between you need some kind of layer to integrate the packages so when I'm talking about integration

of packages I'm talking about something like this you have a translator from a translator package and now you need to tell the translator how to find for example message catalogs in your project and in any package that you have installed so making sure

that one package the translator works with your application and any other package that you use that example is twig if you use twig in your application and now I'm assuming that you're not using symphony or some ready-made framework that already supports

all that integration stuff for you but if you use for example Silex and you don't use the service providers or before you built an application from scratch then you would be doing that right so if you use twig then you create like all the classes that

you need from twink you configure them and then it's helped wake where to find all the twig templates that you're using your application again in your application in any package that you use same thing for dependency injection you have a dependence

injection container that's just like that's not the symphony dependency injection container but just an example and you need to tell the dependency injection container how to roll your services and how to load the services of all the packages that

you have installed and all of these things are what I call package integration right so if you do that manually that's a lot of work it's a lot of things a lot of lines of code that you need to write in order to integrate packages in the worst case

every time you install the package you have to integrate the package with all the other packages that you have already installed that's just a theoretical number but it can get pretty complex if you build bigger applications that reuse many packages so

you don't want to do a lot of works developers usually a lazy he was lazy in here I am definitely I bright code because i'm lazy because i want to make things quicker tomorrow so i spent an insane amount of time today to make things easier tomorrow

which doesn't make sense so much but we're lazy we wants us to have something that simply works we want plug-and-play packages that we can install in our application and that work without doing a lot of extra work right so i'd say like minimum

effort like one click to install like a wordpress plugin you install it and blow it up and it just works that's something that i would like to achieve so frameworks solves that problem using framework specific packages since symphony you have bundles for

example in Sanford murky of modules in type 3 that's called extensions Drupal it's called modules as well so every system has its own package concept that basically tries to solve these problems framework packages look very much like the composer packages

that for except that they usually contain PHP code and maybe resource files that would be CSS or JavaScript from twig templates or anything that is not PHP and usually these this PHP code and the resource file files need to follow some conventions that are

specified by the project by the framework so for example in symphony a symphony bundle usually has some kind of expansion class for the dependency injection container then you have this Resources directory which must be exactly in the root directory of the

package of the bundle and which may contain specific sub directories for specific types of files and they must be named this way by default you also have this bundle class which is used to initialize the bundle basically so these are some conventions that

we use the symphony and that you need to follow in order to to write a bundle that can be used in a symphony application but it can't be used in any other application at least not easily like if you have a Drupal application you can't simply install

a symphony bundle without doing extra work if we layin down the application it looks very similar to before we still have all these composer packages on the bottom we still have our main logic at the top but now we also have the framework in the middle the

framework basically is a standard tool kit a selection of tools that we can use and the set of conventions so if you use a framework you use a framework because you want to make easy for everyone on your project to work on your code following the same conventions

[ ... ]

Nota: se han omitido las otras 4.331 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.