PHPSummerCamp评论
The PHPSummerCamp of 2014 is over. Three days of hands-on workshops with experts from their fields provided us all with new insights, perspectives and tricks. While I wish I could have participated in all the workshops, that was simply not an option. Hence, I’ll talk about the ones I did join.
2014年的PHPSummerCamp已经结束。 为期三天的实践研讨会与来自各个领域的专家共同为我们提供了新的见解,观点和技巧。 我希望我可以参加所有的研讨会,但这根本不是一种选择。 因此,我将谈论我加入的人。
器具 (Appliance)
Before the conference, we were given a Virtualbox appliance. For the uninitiated, an appliance is a pre-configured virtual box, something like a base box when using Vagrant, with pre-installed pre-configured software inside it. In theory, just booting it up should let you have the same environment as everyone else. In practice, this is rarely so – a huge chunk of the first workshop’s time was eaten away by configuration problems and folder sharing issues.
会议之前,我们得到了Virtualbox设备。 对于初学者来说,设备是一个预先配置的虚拟盒,类似于使用Vagrant时的基本盒,其中内置了预先安装的预配置软件。 从理论上讲,只需启动它即可让您拥有与其他所有人相同的环境。 实际上,情况并非如此-第一次研讨会的大部分时间都被配置问题和文件夹共享问题吞噬了。
While it was disappointing that Vagrant wasn’t used to set up a unified development environment for everyone, the appliance actually worked amazingly well. Setting up a samba share AND maintaining a symlink consistency was less than a couple of minutes of work on my Windows machine, and while I can only imagine the hell they went through while setting it up, I wholly appreciate the ease of use it created for us, the audience. Well done to all, both speakers and organizers!
令人失望的是,Vagrant并未习惯于为每个人建立统一的开发环境,但该设备实际上表现出色。 在我的Windows机器上,设置samba共享并保持符号链接一致性不到两分钟的工作,虽然我只能想象他们在设置它时遇到了麻烦,但我完全赞赏它为我们,观众。 演讲者和组织者都做得很好!
第一天 (Day 1)
Symfony基础 (Symfony Basics)
On day one, I joined a Symfony basics workshop by Ryan Weaver. An absolutely excellent veteran speaker from KNP Labs, Ryan conquered the room with his enthusiasm, energy and positive reinforcement constantly thrown at all audience members with enough audacity to ask a question.
在第一天,我参加了Ryan Weaver的Symfony基础知识研讨会。 瑞恩(Ryan)是KNP Labs的一位绝对出色的资深演讲者,他的热情,活力和积极的力量不断征服了所有听众,他们大胆地向所有听众提问。
This workshop introduced Symfony in a very friendly manner, presenting it as much simpler than I actually believe it to be with all the bundle, kernel, app vs app_dev chaos and the half dozen config files.
这次研讨会以非常友好的方式介绍了Symfony,比我实际认为的所有捆绑包,内核,app vs app_dev混乱以及半打的配置文件要简单得多。
It was a bit confusing to see a new recommended practice emerge which advises the moving of templates into the Resources of the app folder instead of having them in a bundle, but when dealing with the main application’s bundle, it’s questionable whether it’s even good practice to have a bundle at all. One must be main, no matter how the app is configured in the end. I’ve discussed this bundle breaking at length with Ryan, and he’s had some interesting things to say about it – we’ll deal with this in depth in a future post. One thing that does rub me the wrong way here is having to alter two core files just to install a bundle – one to tell the main routing file to read the bundle’s routes from the bundle, and another to activate the bundle in the AppKernel file. Sometimes, you even need to tweak additional config files. This seems like too much editing over too many files just to make a bundle work. Seeing as Symfony console commands (see day 3) are automatically registered, adopting a similar approach to auto-loading routes and auto-activating a bundle by reading its own files (thus keeping everything encapsulated) makes sense to me – though perhaps I’m seeing things with a too simplistic eye and this warrants more discussion.
看到一种新的推荐做法有点令人困惑,该做法建议将模板移到app文件夹的Resources中,而不是将它们打包在一起,但是当处理主应用程序的bundle时,是否甚至是好的做法值得怀疑。有一个捆绑包。 无论最终如何配置应用程序,一个都必须是主要的。 我已经与Ryan讨论了这个捆绑包的详细内容,他对此有一些有趣的事情要说-我们将在以后的文章中深入探讨。 在这里确实使我误解的一件事是不得不更改两个核心文件,仅是为了安装捆绑软件–一种是告诉主路由文件从捆绑软件中读取捆绑软件的路由,另一种是在AppKernel文件中**捆绑软件。 有时,您甚至需要调整其他配置文件。 似乎为了使捆绑包工作而对太多文件进行了太多编辑。 就像Symfony控制台命令(请参阅第3天)被自动注册一样,采用类似的方法来自动加载路由并通过读取其自己的文件(从而将所有内容封装起来)来自动**捆绑包-尽管这对我来说很有意义用过于简单的眼光看待事物,这值得进行更多的讨论。
What got my hopes up was seeing Symfony steer away from highly specific and somewhat cryptic syntax. For example, in Twig templates, {% extends '::base.html.twig' %}
can now be written as {% extends 'base.html.twig' %}
, thus no longer needing the ::
. This is beneficial to the community at large, less confusion all around. Ryan said Symfony is trying to remove the cryptics from other places too (having the @ symbol on arguments for services in the DI, for example, is somewhat confusing and could use a better syntax – @ is not something people associate with good practice), which will only help in new user adoption.
使我寄予希望的是,看到Symfony避开了高度具体且有些含糊的语法。 例如,在Twig模板中, {% extends '::base.html.twig' %}
现在可以写成{% extends 'base.html.twig' %}
,因此不再需要::
。 这有益于整个社区,减少了周围的混乱。 赖安说,Symfony也在尝试从其他地方删除密码(例如,在DI中用于服务的参数上带有@符号有些令人困惑,并且可以使用更好的语法– @不是人们与良好实践相关联的东西),这只会有助于新用户的采用。
All in all, this talk was an excellent starter of the whole camp, and so much more than simple “basics” tutorials you can find online.
总而言之,这次演讲是整个阵营的一个很好的起点,它比您可以在网上找到的简单“基础”教程要多得多。
使用Symfony 2构建REST API (Building a REST API with Symfony 2)
This talk by Antonio Peric was rather underwhelming. An application was presented, though how exactly it differed from this one was not made clear, and there wasn’t nearly as much coding as expected or promised.
安东尼奥·佩里奇的讲话颇为令人气under。 提出了一个应用程序 ,但是尚不清楚它与该 应用程序有何不同,并且没有像预期或承诺的那样多的编码。
The underlying philosophy was interesting, and the code seemed compelling, albeit slightly too complex for something as simple as a REST app, but this was not followed by good explanations and the whole thing felt rushed, further complicated by a wrong repo included in the provided virtual appliance. Granted, the original timeframe seemed rather short anyway, so considering how much was done, it was done well.
基本原理很有趣,并且代码看起来引人注目,尽管对于像REST应用程序这样的简单应用来说太复杂了,但是随后并没有很好的解释,整个事情变得仓促起来,并由于提供的错误回购而变得更加复杂。虚拟设备。 当然,无论如何,最初的时间框架似乎都很短,因此考虑到做了多少,它做得很好。
The general impression I got from the talk was that a REST app was simple to build with Symfony with the addition of 4-5 bundles, but those bundles seemed far too large and complex for something like this.
我从这次演讲中获得的总体印象是,使用Symfony并添加4-5个捆绑软件即可轻松构建REST应用程序,但是对于这样的东西,这些捆绑软件看起来太大而又复杂。
使用CMF和RoutingAutoBundle创建基本CMS (Creating a Basic CMS with the CMF and the RoutingAutoBundle)
Daniel Leech, who impressively cycled for hundreds of miles to get to the conference, and Willem-Jan Zijderveld presented the creation of a basic CMS with Symfony’s CMF and the RoutingAutoBundle.
丹尼尔·里奇 ( Daniel Leech )令人印象深刻的是,他骑车数百英里参加了会议, 威廉姆·简·齐德维尔德 ( Willem-Jan Zijderveld)介绍了使用Symfony的CMF和RoutingAutoBundle创建基本CMS的过程。
The workshop consisted of following them through a set of steps to get from a base project to a fully functioning one, though given the short timeframe they were allowed, it felt slightly rushed. Luckily, they prepared well and had the repo branched into these steps, so someone who didn’t manage to keep up could catch up easily by simply checking out another branch.
讲习班包括按照一系列步骤从基础项目过渡到功能全面的项目,尽管考虑到允许的时间很短,但还是有些仓促。 幸运的是,他们做好了充分的准备,并将回购转移到了这些步骤中,因此,那些没有设法跟上的人可以通过简单地签出另一个分支来轻松赶上。
As a non-user of Symfony, the general impression I got from this workshop was, again, that it was vastly overcomplicated for something as simple as a CMS, especially one that is basic (so no detailed user roles, no CDN, no Markdown…). We downloaded many bundles, edited many files, and ended up with a simple form that saves content in a blog-titled shape into the database. For that much code and manual labor, one could use something as bad as WordPress and end up with less bloat – it seemed like we wrote too much code for too little upgradeability and maintainability in the long run. The most impressive part of the app was the RoutingAutoBundle which, as its name suggests, automatically determines routes of the content of the CMS and produces output according to that, unless no adequate output is found when it falls back on the default Symfony router.
作为Symfony的非用户,我再次从本次研讨会上获得的总体印象是,它对于诸如CMS这样简单的事情非常复杂,尤其是基本的CMS(因此没有详细的用户角色,没有CDN,没有Markdown …)。 我们下载了许多捆绑软件,编辑了许多文件,最后得到了一个简单的表单,该表单以博客标题的形式将内容保存到数据库中。 对于这么多的代码和体力劳动,人们可能会使用与WordPress一样糟糕的东西,而最终却没有那么–肿–似乎我们编写了太多代码,从长远来看却缺乏可升级性和可维护性。 该应用程序最令人印象深刻的部分是RoutingAutoBundle,正如其名称所暗示的那样,它会自动确定CMS内容的路由并根据该内容生成输出,除非当它退回到默认的Symfony路由器时找不到足够的输出时。
While this routing technique was far from science fiction (even WordPress uses it), it was interesting to learn it exists in a bundle and can easily be tacked onto the default routing queue in Symfony. One gripe I do have with this workshop, though, is that it seemed like little more than direct reading from the CMF tutorial. It also used PHPCR extensively, which, in my opinion, wasn’t explained enough, along with terms like CMF, JCR, Content Store, and other meta terms that I believe should have been prerequisite theory.
尽管这种路由技术远非科幻小说(甚至WordPress都使用它),但有趣的是它以捆绑形式存在,并且可以轻松地添加到Symfony的默认路由队列中。 不过,我对本次研讨会的确有一个困扰,那就是,它似乎只不过是直接阅读CMF教程而已。 它还广泛使用了PHPCR ,在我看来,它还没有得到足够的解释,以及诸如CMF,JCR,Content Store以及我认为应该是前提理论的其他元术语之类的术语。
第二天 (Day 2)
Behat基础知识 (Behat Basics)
Another workshop by Ryan Weaver – an introduction to the magical world of feature testing with Behat. We ran through a practical example and built up to a decent project. The first example was neatly decoupled from the rest, introducing us to the terminology of features, and to step by step testing until a pass is shown. Next, we implemented BDD on a web app with Mink, which opened our eyes to the beauty of browser automation. Needless to say, Behat immediately became a tool in my arsenal – I had been aware of it before, but never so concretely.
瑞安·韦弗 ( Ryan Weaver)举办的另一场研讨会–介绍使用Behat进行功能测试的神奇世界。 我们通过一个实际的例子,并建立了一个不错的项目。 第一个示例与其余示例完全脱钩,向我们介绍了功能术语,并逐步进行了测试,直到显示通过为止。 接下来,我们使用Mink在Web应用程序上实现了BDD,这使我们看到了浏览器自动化的美丽。 毋庸置疑,Behat立即成为我军械库中的工具-我以前已经知道过,但从未如此具体。
Ryan was his usual self – energetic and positive, and included readable and simple, down to earth slides – all of which were also in the project we were given via the Virtual Machine appliance so we could rewind at will, catch up, do the extra credit tasks, and more. Some magic was demonstrated, too, like taking a screenshot of the web app when a test fails (see here) or waiting for JS popups to render before testing for their existence. Finally, as a true “from scratch with Behat” project, we were introduced to Sylius. If you’re in any way interested in what an application that’s built from the ground up with Behavioral testing in mind looks like, check it out. The features included are staggering.
瑞安(Ryan)是他一贯的自我–精力充沛且积极向上,包括可读性强,简单易懂的幻灯片–所有这些也在我们通过虚拟机设备提供的项目中,因此我们可以随意倒带,赶上并做额外的工作信用任务等。 还演示了一些魔术,例如在测试失败时为Web应用程序截图(请参阅此处 ),或者等待JS弹出窗口呈现后再测试它们的存在。 最后,作为一个真正的“从零开始与Behat”项目,我们被介绍给Sylius 。 如果您对以行为测试为基础完全构建的应用程序的外观感兴趣,请查看。 包含的功能令人st舌。
PHPSpec基础 (PHPSpec Basics)
After Ryan, Saša took the stage. Also from KNP, Saša’s first ever talk was better than expected for a rookie, and he covered PHPSpec well. His workshop introduced the audience to the mystical world of auto-mocking and code generation with PHPSpec – a specification testing tool that can either be used as a replacement for, or complement to PHPUnit. An optimal setup seems to be a combination of Behat and PHPSpec, leaving PHPUnit as optional.
在Ryan之后, Saša上台了。 同样来自KNP的Saša的首次演讲比一名新秀还好,他对PHPSpec的了解也不错。 他的研讨会向观众介绍了使用PHPSpec进行自动模拟和代码生成的神秘世界,PHPSpec是一种规范测试工具,可以替代PHPUnit或对其进行补充。 最佳设置似乎是Behat和PHPSpec的组合,而PHPUnit仍是可选的。
His slides were less independent (i.e. you couldn’t go through them without guidance), and we ran out of time in the end, which was unfortunate, but all in all this workshop introduced an otherwise highly esoteric concept in a very approachable manner and converted many an audience member to the ease of testing with PHPSpec. If you’re interested, here’s a pretty good cheatsheet, too.
他的幻灯片不太独立(例如,没有指导您就无法浏览它们),最后我们没时间了,这是不幸的,但是所有这些研讨会都以非常平易近人的方式引入了一个极深奥的概念,使许多受众群体成员可以轻松地使用PHPSpec进行测试。 如果您有兴趣,这也是一个很好的备忘单 。
第三天 (Day 3)
使用PHP的MongoDB (MongoDB with PHP)
Held by Derick Rethans, the maker of Xdebug, maintainer of the MongoDB driver for PHP and fellow Doctor Who fan, this workshop dove deep into the intricacies of using MongoDB with PHP, chaining queries, approaching common problems with filtering results, and more. We built sample scripts, faked import procedures, and ordered and grouped beer types by rating and preference of the author (Derick has tried a whopping 999 beers by the end of his Croatian trip! – I was personally responsible for at least a couple).
该研讨会由Xdebug的开发者Derick Rethans主持 ,Xdebug的开发者是PHP的MongoDB驱动程序的维护者,也是Doctor Who粉丝。他深入探讨了将MongoDB与PHP结合使用,链接查询,通过过滤结果解决常见问题等复杂问题。 我们构建了示例脚本,伪造的进口程序,并根据作者的评分和偏好对啤酒类型进行了分类和分组(Derick在克罗地亚旅行结束前尝试了多达999杯啤酒!–我个人至少负责了几对啤酒)。
Initially, we ran out of time for the advanced part, but we continued later with a slightly smaller audience. In part two, we went deep into piping and aggregation, and even tried to set up replication (it’s really simple!) but ultimately failed, due to all of us being hosted each on a virtual machine. We learned about arbiters, primary election, replication procedures, the oplog which turns all database entry history into sets, even if the original queries were calculation, and much, much more.
最初,我们在高级部分上没有时间了,但是后来我们的观众人数略有减少。 在第二部分中,我们深入研究了管道和聚合,甚至尝试设置复制(这非常简单!),但最终失败了,因为我们每个人都托管在虚拟机上。 我们了解了仲裁程序,主要选举,复制过程以及将所有数据库条目历史都转换为集合的oplog,即使原始查询是经过计算的也是如此。
It’s not every day you meet a guy who’s so responsible for changing the landscape of PHP he’s being taken for granted, so I hope to have Derick’s ear on several other occurrences yet to come.
并不是每天都遇到一个如此重要的人,他负责改变他被视为理所当然PHP的局面,所以我希望Derick能够留意其他事件。
Symfony Extra (Symfony Extra)
Finally, we had an additional Symfony playground held, again, by Ryan. This part focused on the console – we toyed around with progress bars, console loops, colors, bundle installations via Composer and more. While not very advanced, the workshop was fun and interesting, and reminded me of my ancient Autofight project. Playing with the PHP CLI is always fun, and Autofight is due for a revival. Stay tuned, something fresh might be appearing on the PHP channel soon :)
最后,我们又由瑞安(Ryan)举办了另外一个Symfony游乐场。 这一部分的重点是控制台–我们玩弄了进度条,控制台循环,颜色,通过Composer进行的捆绑安装等等。 这次研讨会虽然不是很先进,但是却很有趣,也很有趣,使我想起了我古老的自动战斗项目 。 使用PHP CLI总是很有趣,而Autofight 是复兴之举。 请继续关注,PHP频道很快就会出现一些新鲜的东西:)
结论 (Conclusion)
PHPSummerCamp was a treasure trove of new knowledge. Not even taking into account the amazing hospitality of the speakers even though they had every right to stone me on the spot, or the fantastic leisure activities Netgen had planned for the event (from fancy fish dinners to boat rides, StarWars geek-out debates and Mexican cantina raffles), the entire conference was one of the better ones I’ve been to, if not the best.
PHPSummerCamp是新知识的宝库。 甚至没有考虑到音箱的惊人的热情好客,即使他们有充分的权利 ,以石头我就在现场,或梦幻般的休闲活动Netgen曾预计该事件(从观赏鱼晚餐和乘船,星球大战怪胎出来辩论和墨西哥小酒馆抽奖活动),整个会议是我去过的最好的会议之一,即使不是最好的会议。
I’ve met interesting people, talked to some of the folk in charge of eZ Publish about their roadmap and maintained contact afterwards to help out with developer experience matters to some degree, and, hopefully, gotten some people interested in checking our channel out – we’re all trying to forward the influence of PHP, and by helping each other we can do amazing things.
我遇到了一些有趣的人,与eZ Publish的一些负责人讨论了他们的路线图,并在之后保持了联系,以在一定程度上帮助开发人员体验事务,希望,有一些人有兴趣检查我们的频道-我们都在尝试转发PHP的影响力,并且通过互相帮助,我们可以做得很棒。
On the technical side, the realization was out of this world – not only was there a pro camera in each room for each talk, following the speaker with a dedicated cameraman and feeding the mic input directly into the recording, there were also professional photographers hired to capture the essence of every room at all times. The sound was amazing, and the facemics the speakers had produced zero crackling and noise – everything was crystal clear. The venue was fantastic, the rooms were high tech, and – something you don’t see often in conferences – the WiFi was absolutely awesome. At one point, an entire room of 30-odd people had to perform a Composer Install command on a Symfony project, and while I could see Ryan silently praying it would work, there was no need for divine intervention – we all successfully installed everything. Not a single hiccup.
在技术方面,实现是脱离这个世界的:不仅在每个房间的每个谈话中都有一个专业摄像机,在演讲者配备了专门的摄像师并将麦克风输入直接馈入录音之后,还聘用了专业摄影师随时随地捕捉每个房间的精髓。 声音令人惊叹,扬声器的面部声音产生了零*****啪声和噪音-一切都很清晰。 场地很棒,房间是高科技的,而且-在会议上您很少见到-WiFi绝对很棒。 某个时候,整个房间有30多个人必须在Symfony项目上执行Composer Install命令,虽然我可以看到Ryan默默祈祷它会起作用,但无需进行神圣干预–我们都成功安装了所有东西。 没有一个打ic。
Next year, I’m first in line for an early bird ticket, and you should be standing right behind me – you won’t regret it. Just have a look at some of the photos. In the meanwhile, let me see if I can get hold of some of the talk recordings and slides and share them with you. I’ll update this post accordingly!
明年,我将抢先购票,您应该站在我身后–您不会后悔。 请看一些照片 。 同时,让我看看我是否可以掌握一些谈话录音和幻灯片并与您分享。 我将相应地更新此帖子!
Note: all photos included above are taken from eZSummerCamp’s Facebook Page and copyrighted to them
注意:以上所有照片均来自eZSummerCamp的Facebook页面,并已拥有版权