In this presentation, we walk take a flat PHP4-style application and gently migrate it into our own "framework", that uses components from Symfony2, Lithium, Zend Framework and a library called Pimple. By the end, you'll see how any ugly application can take advantage of the many wonderful tools available to PHP developers.
Symfony: Your Next Microframework (SymfonyCon 2015)Ryan Weaver
Microservices are a huge trend, and microframeworks are perfect for them: put together just a few files, write some code, and your done!
But Symfony is a big framework, right? Wrong! Symfony can be as small as a single file!
In this talk, we'll learn how to use Symfony as a micro-framework for your next project. Your app will stay small and clear, but without needing to give up the features or third-party bundles that you love. And if the project grows, it can evolve naturally into a full Symfony project.
So yes, Symfony can also be a microframework. Tell the world!
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Ryan Weaver
If you're like me, you know that being a great backend developer isn't enough. To make *truly* great applications, we need to spend significant time in an area that's moving at a lightning pace: frontend development.
This talk is for you: the backend developer that wants to hook their API's up to rich, interactive JavaScript frontends. To do that, first, we need to demystify a lot of new terms, like ES6/ES2015, ECMAScript, JSX, Babel and the idea that modern JavaScript (surprise) *requires* a build step.
With this in mind, I'll give you a brief introduction into Webpack & the modular development it finally allows.
But the real star is ReactJS. In the frontend world, you never know what new tech will *win*, but React is a star. I'll give you enough of an intro to get you rolling on your project.
The new frontend dev world is huge! Consider the starting line down an exciting new journey.
Symfony: Your Next Microframework (SymfonyCon 2015)Ryan Weaver
Microservices are a huge trend, and microframeworks are perfect for them: put together just a few files, write some code, and your done!
But Symfony is a big framework, right? Wrong! Symfony can be as small as a single file!
In this talk, we'll learn how to use Symfony as a micro-framework for your next project. Your app will stay small and clear, but without needing to give up the features or third-party bundles that you love. And if the project grows, it can evolve naturally into a full Symfony project.
So yes, Symfony can also be a microframework. Tell the world!
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Ryan Weaver
If you're like me, you know that being a great backend developer isn't enough. To make *truly* great applications, we need to spend significant time in an area that's moving at a lightning pace: frontend development.
This talk is for you: the backend developer that wants to hook their API's up to rich, interactive JavaScript frontends. To do that, first, we need to demystify a lot of new terms, like ES6/ES2015, ECMAScript, JSX, Babel and the idea that modern JavaScript (surprise) *requires* a build step.
With this in mind, I'll give you a brief introduction into Webpack & the modular development it finally allows.
But the real star is ReactJS. In the frontend world, you never know what new tech will *win*, but React is a star. I'll give you enough of an intro to get you rolling on your project.
The new frontend dev world is huge! Consider the starting line down an exciting new journey.
Rails ORM De-mystifying Active Record has_manyBlazing Cloud
Rails' ORM layer, ActiveRecord, is an elegant solution for keeping model code simple and modular (aka DRY). Demystifying the way Ruby-on-Rails uses runtime method generation opens a doorway for understanding and provides a foundation for the other ways Rails uses simple conventions to allow sophisticated, concise functionality in a declarative style.
Here is big mystery that you'll be equipped to understand better after playing with the slides
-> If honeys is an array - and honeys has a method create! - then why does an array object [] not have create!
Hive.first.honeys.class
=> Array
[].create!
=> NoMethodError
Hive.first.honeys.create!
What's new in HTML5, CSS3 and JavaScript, James PearceSencha
A review of the state of the fast-moving HTML5, CSS3, and JavaScript landscape, how these exciting new technologies are being implemented in browsers today, and a glimpse of some of the things we can look forward to in coming years.
James Pearce heads developer relations at Sencha. He is a technologist, writer, developer and practitioner, who has been working with the mobile web for over a decade. Previously he was the CTO at dotMobi and has a background in mobile startups, telecoms infrastructure and management consultancy. James is the creator of tinySrc, the WordPress Mobile Pack, WhitherApps, modernizr-server and confess.js, and has written books on mobile web development for both Wiley and Wrox.
Over the past year, more and more Java applications have benefited from gaining access to elastic, cloud-ready, data grids thanks to Infinispan, and from now on, Ruby apps running within TorqueBox get the same benefit as well thanks to the ability of TorqueBox to talk to Infinispan Hot Rod servers. In this talk, Galder will demo the integrations between TorqueBox, which is a Ruby application plattform, and Infinispan, which is a Java based data grid plattform, highlighting the benefits for TorqueBox administrators and Ruby developers, which include, amongst others, access to highly-scalable, low-latency data store that avoids single point of failure.
Being Mobile: Mobile Web Development with WordPressBraveNewCode Inc.
In “Being Mobile”, Martin explores a variety of strategies for mobile web development including responsive design, dedicated mobile sites, and server-side adaptive sites.
Sharing anecdotes from his experience on both the client and agency sides, he will help bridge the gap between developers and stakeholders, preparing participants for critical conversations about the mobile web.
Talk given to BCN sudoers on 2013-11-05. Introduction to the ansible configuration management tool. Great to automate reproducible installations and setup.
Non Relational Databases And World DominationJason Davies
Apparently NoSQL is all the rage these days, but what does it really mean and what technologies are out there? When to use a non-relational database? How to decide which one to use to achieve world domination? How do I use CouchDB with Ruby on Rails?
Webpack Encore Symfony Live 2017 San FranciscoRyan Weaver
Ready to write an amazing front-end for your app? There are *so* many great tools, like React, Vue.js, module loaders, Sass, LESS, PostCSS and more. But, they all have one thing in common: you need to configure a *build* system before you write a single line of code! Thankfully, there's Webpack: the leading tool for processing & bundling your JavaScript and CSS. There's just one problem: configuring Webpack is tough and requires a lot of Webpack-specific knowledge. Say hello to Webpack Encore: a library built by Symfony to quickly bootstrap a sophisticated asset setup, complete with minification, SASS processing, automatic versioning, Babel support and *everything* you need to start writing great JavaScript quickly. In this talk, we'll also learn about using JavaScript modules, how to bootstrap a framework (like React) and other important modern practices. Give your assets a huge boost with Webpack Encore!
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017Ryan Weaver
What is Symfony *really*? It's a collection of *35* independent libraries, and
Drupal uses less than *half* of them! That means that there's a *ton* of other
good stuff that you can bring into your project to solve common problems... as
long as you know how, and what those components do!
In this talk, we'll have some fun: taking a tour of the Symfony components, how
to install them (into Drupal, or anywhere) and how to use some of my *favorite*,
lesser-known components. By the end, you'll have a better appreciation of what
Symfony *really* is, and some new tools to use immediately.
More Related Content
Similar to A PHP Christmas Miracle - 3 Frameworks, 1 app
Rails ORM De-mystifying Active Record has_manyBlazing Cloud
Rails' ORM layer, ActiveRecord, is an elegant solution for keeping model code simple and modular (aka DRY). Demystifying the way Ruby-on-Rails uses runtime method generation opens a doorway for understanding and provides a foundation for the other ways Rails uses simple conventions to allow sophisticated, concise functionality in a declarative style.
Here is big mystery that you'll be equipped to understand better after playing with the slides
-> If honeys is an array - and honeys has a method create! - then why does an array object [] not have create!
Hive.first.honeys.class
=> Array
[].create!
=> NoMethodError
Hive.first.honeys.create!
What's new in HTML5, CSS3 and JavaScript, James PearceSencha
A review of the state of the fast-moving HTML5, CSS3, and JavaScript landscape, how these exciting new technologies are being implemented in browsers today, and a glimpse of some of the things we can look forward to in coming years.
James Pearce heads developer relations at Sencha. He is a technologist, writer, developer and practitioner, who has been working with the mobile web for over a decade. Previously he was the CTO at dotMobi and has a background in mobile startups, telecoms infrastructure and management consultancy. James is the creator of tinySrc, the WordPress Mobile Pack, WhitherApps, modernizr-server and confess.js, and has written books on mobile web development for both Wiley and Wrox.
Over the past year, more and more Java applications have benefited from gaining access to elastic, cloud-ready, data grids thanks to Infinispan, and from now on, Ruby apps running within TorqueBox get the same benefit as well thanks to the ability of TorqueBox to talk to Infinispan Hot Rod servers. In this talk, Galder will demo the integrations between TorqueBox, which is a Ruby application plattform, and Infinispan, which is a Java based data grid plattform, highlighting the benefits for TorqueBox administrators and Ruby developers, which include, amongst others, access to highly-scalable, low-latency data store that avoids single point of failure.
Being Mobile: Mobile Web Development with WordPressBraveNewCode Inc.
In “Being Mobile”, Martin explores a variety of strategies for mobile web development including responsive design, dedicated mobile sites, and server-side adaptive sites.
Sharing anecdotes from his experience on both the client and agency sides, he will help bridge the gap between developers and stakeholders, preparing participants for critical conversations about the mobile web.
Talk given to BCN sudoers on 2013-11-05. Introduction to the ansible configuration management tool. Great to automate reproducible installations and setup.
Non Relational Databases And World DominationJason Davies
Apparently NoSQL is all the rage these days, but what does it really mean and what technologies are out there? When to use a non-relational database? How to decide which one to use to achieve world domination? How do I use CouchDB with Ruby on Rails?
Webpack Encore Symfony Live 2017 San FranciscoRyan Weaver
Ready to write an amazing front-end for your app? There are *so* many great tools, like React, Vue.js, module loaders, Sass, LESS, PostCSS and more. But, they all have one thing in common: you need to configure a *build* system before you write a single line of code! Thankfully, there's Webpack: the leading tool for processing & bundling your JavaScript and CSS. There's just one problem: configuring Webpack is tough and requires a lot of Webpack-specific knowledge. Say hello to Webpack Encore: a library built by Symfony to quickly bootstrap a sophisticated asset setup, complete with minification, SASS processing, automatic versioning, Babel support and *everything* you need to start writing great JavaScript quickly. In this talk, we'll also learn about using JavaScript modules, how to bootstrap a framework (like React) and other important modern practices. Give your assets a huge boost with Webpack Encore!
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017Ryan Weaver
What is Symfony *really*? It's a collection of *35* independent libraries, and
Drupal uses less than *half* of them! That means that there's a *ton* of other
good stuff that you can bring into your project to solve common problems... as
long as you know how, and what those components do!
In this talk, we'll have some fun: taking a tour of the Symfony components, how
to install them (into Drupal, or anywhere) and how to use some of my *favorite*,
lesser-known components. By the end, you'll have a better appreciation of what
Symfony *really* is, and some new tools to use immediately.
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and moreRyan Weaver
There are so many interesting ways to authenticate a user: via an API token, social login, a traditional HTML form or anything else you can dream up.
But until now, creating a custom authentication system in Symfony has meant a lot of files and a lot of complexity.
Introducing Guard: a simple, but expandable authentication system built on top of Symfony's security component. Want to authenticate via an API token? Great - that's just one class. Social login? Easy! Have some crazy legacy central authentication system? In this talk, we'll show you how you'd implement any of these in your application today.
Don't get me wrong - you'll still need to do some work. But finally, the path will be clear and joyful.
There are so many interesting ways to authenticate a user: via an API token, social login, a traditional HTML form or anything else you can dream up. But until now, creating a custom authentication system in Symfony has meant a lot of files and a lot of complexity. Introducing Guard: a simple, but expandable authentication system built on top of the security component and introduced in Symfony 2.8. Want to authenticate via an API token? Great - that's just one class. Social login? Easy! Have some crazy legacy central authentication system? In this talk, we'll show you how you'd implement any of these in your application today. Don't get me wrong - you'll still need to do some work. But finally, the path will be clear and joyful.
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatRyan Weaver
Testing our applications is something we all do. Ahem, rather, it's something we all *wish* we did. In this chat, I'll introduce you to Behat (behat.org) (version 3!!!!): a behavior-driven-development (BDD) library that allows you to write functional tests against your application just by writing human-readable sentences/scenarios. To sweeten the deal these tests can be run in a real browser (via Selenium2) with just the flip of a switch. If you asked me to develop without Behat, I'd just retire. It's that sweet. By the end, you'll have everything you need to start functionally-testing with Behat in your new, or very old and ugly project.
Twig: Friendly Curly Braces Invade Your Templates!Ryan Weaver
Video: http://youtu.be/Jikkiqt-nBo
Twig! Yep, it's that fancy magic that's supposed to make theming in Drupal 8 as much fun as eating beef brisket at Rudy's Country Store in Austin (apologies to my veggie friends!). And in fact, Twig was *born* for this: a language that was created with one job in mind: making writing templates awesome and powerful. Oh, and to make you love using it.
In this talk, we'll learn about Twig from the ground-up: syntax, filters, inheritance and other tricks you can learn now to be ready for Drupal 8. We'll also look at how Twig looks inside Drupal, and how it compares to what you're used to in Drupal 7.
By the end, you'll know everything to start getting your Drupal 8 theme on and be shouting its praises from the hills! Ok, maybe not that last part (but I do love how excited Drupalers get), but you'll definitely have a new friend in your world: Twig.
Master the New Core of Drupal 8 Now: with Symfony and SilexRyan Weaver
I'm not a Drupal developer, but I do already know *a lot* about Drupal 8, like how the event system works, what a service is, how it relates to a dependency injection container and how the deepest and darkest of Drupal’s request-response workflow looks.
How? Because I use Symfony. And if you want to get a jumpstart on Drupal 8, you should to. In this talk, we'll double the number of tools you have to solve problems (Drupal + Symfony) and start to unlock all the new important concepts. We'll start with Silex (a microframework based on Symfony), graduate to Symfony, and focus on the pieces that are most interesting to a Drupal 8 developer.
Silex: Microframework y camino fácil de aprender SymfonyRyan Weaver
Ya quieres aprender Symfony? Bueno! Si eres en usuario de Drupal o si quieres aumentar sus habilidades, aprender Symfony puede ayudarte. Sin embargo, aprender Symfony puede ser difícil - y muchas ideas nuevas (pero buenas) como PHP namespaces, Composer, y código "object-oriented". Te presento a Silex: el Microframework que se construye por las mismos pedazos (HttpFoundation, HttpKernel, Composer, etc) como el Symfony Framework y Drupal 8. En esta charla, vamos a crear un mini-app con Silex para mostrarte como fácil puede ser y cuales partes son los mismos como Symfony y Drupal. Al fin, vas a estar listo entender Drupal 8 o crear su primer proyecto con Symfony.
Y porque esta charla sería mi primera en español, puedas disfrutar esta aventura conmigo :).
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itRyan Weaver
It's true: Drupal 8 includes big and exciting changes to its core and how Drupal code is written. These include using outside PHP libraries (Guzzle, Symfony, etc) as well as embracing PHP 5.4 and object-oriented code.
Scary, right? Definitely not! These changes give Drupal 8 so many "wins" and new possibilities that you're going to absolutely love it.
In this keynote, we'll explore the changes together and start to realize all of the wonderful things that each will bring. These include a (much) larger community, many more libraries you can use, higher quality tools, easier future upgrades, and some fantastic new features.
And because Drupal uses Symfony, you'll easily be able to use Symfony (or its little brother Silex) for any non-CMS projects. Being a great Drupal 8 developer means being a great PHP developer.
Of course, Drupal 8 has its criticisms: it will be too hard for new developers to learn, or it will not be useable for smaller sites. We'll take on these concerns directly and see why they are valid, but exaggerated.
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other ToolsRyan Weaver
Bower, Grunt, and RequireJS are just a few tools that have been re-shaping the frontend development world, replacing cluttered script tags and server-side build solutions with a sophisticated, but sometimes complex approach to dependency management and module loading. In this talk, we'll put on our trendy frontend developer hat and find out how these tools work and how they differ from what we might be used to. Most important, we'll see how using tools like this might look in Symfony2 and how our application can be a friendly place for a frontend guy/gal.
The Wonderful World of Symfony ComponentsRyan Weaver
Wow, Symfony Components!
In this talk, we'll look at the history of PHP, and the struggles as a community to create shared libraries between our large community. Find out the significance of PSR-0 and Composer in *your* life and how you can leverage libraries from all of PHP in your projects.
We'll also look at the most fundamental Symfony2 components - HttpFoundation, HttpKernel, EventDispatcher, & Routing - including those that have been adopted by Drupal 8. We'll also check out a bunch of the other interesting Symfony2 components that can be used as tools in any PHP project.
The goal of this talk is to show you just how easy finding and using high quality libraries has become in PHP. By the end, you'll be excited and ready to high-five all of your PHP friends.
Symony2 A Next Generation PHP FrameworkRyan Weaver
A mixture of architecture and hands-on examples, this presentation takes you through the killer features of Symfony2, how it's so decoupled, and how you can get started developing in it.
As an added bonus, a number of new standalone PHP libraries and tools are mentioned at the end.
Symfony2: What's all the buzz about?
Follow along as we download, install and get a hands-on experience using Symfony2. This presentation shows you how to get started with Symfony and introduces you to the large group of new PHP libraries coming from the Symfony2 community. You'll see examples of how to create pages, use template inheritance, and create a simple JSON API.
Being Dangerous with Twig (Symfony Live Paris)Ryan Weaver
Twig - the PHP templating engine - is easy to use, friendly and extensible. This presentation will introduce you to Twig and show you how to extend it to your bidding.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
1. A PHP Christmas Miracle
A story of deception, wisdom, and finding our
common interface
Ryan Weaver
@weaverryan
Saturday, December 3, 11
2. Who is this dude?
• Co-author of the Symfony2 Docs
• Core Symfony2 contributor
• Co-owner of KnpLabs US
• Fiancee of the much more
talented @leannapelham
http://www.knplabs.com/en
http://www.github.com/weaverryan
@weaverryan
Saturday, December 3, 11
3. Act 1:
A History of modern PHP
@weaverryan
Saturday, December 3, 11
14. PSR-0
• The PHP community came together, sang
Kumbaya and wrote up some class-naming
standards
• PSR-0 isn’t a library, it’s just an agreement to
name your classes in one of two ways
@weaverryan
Saturday, December 3, 11
15. PSR-0 with namespaces
Namespace your classes and have the namespaces
follow the directory structure
class: SymfonyComponentHttpFoundationRequest
path: vendor/src/Symfony/Component/HttpFoundation/Request.php
Saturday, December 3, 11
16. PSR-0 with underscores
Use underscores in your classes and follow the
directory structure
class: Twig_Extension_Core
path: vendor/twig/lib/Twig/Extension/Core.php
Saturday, December 3, 11
17. But what does this mean?
• An "autoloader" is a tool you can use so that
you don't have to worry about “including”
classes before you use them
• Use anyone’s autoloader
• We're all still duplicating each other's work,
but at least everyone’s autoloader does the
same thing
@weaverryan
Saturday, December 3, 11
27. ... build a framework from
“scratch” ...
Saturday, December 3, 11
28. ... and see why that’s no
longer necessarily a bad
thing.
Saturday, December 3, 11
29. Today’s 2 goals:
• Refactor a crappy flat PHP application into a
framework that makes sense
• Use as many libraries from as many quarreling
PHP tribes as possible
‣ Symfony
‣ Zend Framework
‣ Lithium
‣ ... only lack of time prevents more...
@weaverryan
Saturday, December 3, 11
30. Our starting point
• Following along with the code of our app at:
http://bit.ly/php-xmas
• Our app is a single file that fuels two pages
Saturday, December 3, 11
32. • Shucks, we even have a database connection
Saturday, December 3, 11
33. Open our Database connection
// index.php
try {
$dbPath = __DIR__.'/data/database.sqlite';
$dbh = new PDO('sqlite:'.$dbPath);
} catch(PDOException $e) {
die('Panic! '.$e->getMessage());
}
Saturday, December 3, 11
34. Try to get a clean URI
// index.php
$uri = $_SERVER['REQUEST_URI'];
if ($pos = strpos($uri, '?')) {
$uri = substr($uri, 0, $pos);
}
Saturday, December 3, 11
35. Render the homepage
// index.php
if ($uri == '/' || $uri == '') {
echo '<h1>Welcome to PHP Santa</h1>';
echo '<a href="/letters">Readletters</a>';
if (isset($_GET['name'])) {
echo sprintf(
'<p>Oh, and hello %s!</p>',
$_GET['name']
);
}
}
Saturday, December 3, 11
36. Print out some letters
// index.php
if ($uri == '/letters') {
$sql = 'SELECT * FROM php_santa_letters';
echo '<h1>Read the letters to PHP Santa</h1>';
echo '<ul>';
foreach ($dbh->query($sql) as $row) {
echo sprintf(
'<li>%s - dated %s</li>',
$row['content'],
$row['received_at']
);
}
echo '</ul>';
}
Saturday, December 3, 11
39. Act 3:
Symfony's HTTP Foundation
@weaverryan
Saturday, December 3, 11
40. Problems
• Our code for trying to get a clean URL is a bit
archaic and probably error prone
• We're echoing content from our controllers,
maybe we can evolve
@weaverryan
Saturday, December 3, 11
41. Solution
• Symfony’s HttpFoundation Component
• Gives us (among other things) a solid Request
and Response class
@weaverryan
Saturday, December 3, 11
44. Autoloading
• No matter what framework or libraries you use,
you’ll need an autoloader
• We’ll use Symfony’s “ClassLoader”
• Each PSR-0 autoloader is very similar
@weaverryan
Saturday, December 3, 11
45. Create a bootstrap file
<?php
// bootstrap.php
require __DIR__.'/vendors/Symfony/Component/
ClassLoader/UniversalClassLoader.php';
use SymfonyComponentClassLoaderUniversalClassLoader;
// setup the autoloader
$loader = new UniversalClassLoader();
$loader->registerNamespace(
'Symfony', __DIR__.'/vendors'
);
$loader->register();
Saturday, December 3, 11
46. ... and include it
<?php
// index.php
require 'bootstrap.php';
// ...
Saturday, December 3, 11
47. So how does this help?
Saturday, December 3, 11
48. $uri = $_SERVER['REQUEST_URI'];
if ($pos = strpos($uri, '?')) {
$uri = substr($uri, 0, $pos);
}
... becomes ...
use SymfonyComponentHttpFoundationRequest;
$request = Request::createFromGlobals();
// the clean URI - a lot of logic behind it!!!
$uri = $request->getPathInfo();
Saturday, December 3, 11
49. if (isset($_GET['name'])) {
echo sprintf(
'<p>Oh, and hello %s!</p>',
$_GET['name']
);
}
... becomes ...
if ($name = $request->query->get('name')) {
echo sprintf(
'<p>Oh, and hello %s!</p>',
$name
);
}
Saturday, December 3, 11
50. The “Request” object
• Normalizes server variables across systems
• Shortcut methods to common things like
getClientIp(), getHost(), getContent(), etc
• Nice object-oriented interface
@weaverryan
Saturday, December 3, 11
51. The “Response” object
• We also have a Response object
• Instead of echoing out content, we populate
this fluid object
@weaverryan
Saturday, December 3, 11
52. header("HTTP/1.1 404 Not Found");
echo '<h1>404 Page not Found</h1>';
echo '<p>This is most certainly *not* an xmas
miracle</p>';
... becomes ...
$content = '<h1>404 Page not Found</h1>';
$content .= '<p>This is most certainly *not*
an xmas miracle</p>';
$response = new Response($content);
$response->setStatusCode(404);
$response->send();
Saturday, December 3, 11
53. Act 4:
Routing
@weaverryan
Saturday, December 3, 11
54. Problems
• Our app is a giant gross “if” statement
if ($uri == '/' || $uri == '') {
// ...
} elseif ($uri == '/letters') {
// ...
} else {
// ...
}
• Grabbing a piece from the URL like
/blog/my-blog-post will take some work
@weaverryan
Saturday, December 3, 11
55. Solution
• Lithium’s Routing library
• Routing matches URIs (e.g. /foo) and returns
information we attached to that URI pattern
• All the nasty regex matching is out-of-sight
@weaverryan
Saturday, December 3, 11
56. 3 Steps to Bringing in an
external tool
Saturday, December 3, 11
57. #1 Download the library
git submodule add git://github.com/UnionOfRAD/
lithium.git vendors/lithium
Saturday, December 3, 11
58. #2 Configure the autoloader
// bootstrap.php
// ...
$loader = new UniversalClassLoader();
$loader->registerNamespace('Symfony', __DIR__.'/vendors');
$loader->registerNamespace('lithium', __DIR__.'/vendors');
$loader->register();
Saturday, December 3, 11
59. #3 Celebrate!
use lithiumnethttpRouter;
$router = new Router();
// ...
Saturday, December 3, 11
61. So how do we use the router?
Saturday, December 3, 11
62. Full disclosure: “use”
statements I’m hiding from the
next page
use SymfonyComponentHttpFoundationRequest;
use lithiumnethttpRouter;
use lithiumactionRequest as Li3Request;
Saturday, December 3, 11
63. a) Map URI to “controller”
$request = Request::createFromGlobals();
$li3Request = new Li3Request();
// get the URL from Symfony's request, give it to lithium
$li3Request->url = $request->getPathInfo();
// create a router, build the routes, and then execute it
$router = new Router();
$router->connect('/letters', array('controller' => 'letters'));
$router->connect('/', array('controller' => 'homepage'));
$router->parse($li3Request);
if (isset($li3Request->params['controller'])) {
$controller = $li3Request->params['controller'];
} else {
$controller = 'error404';
}
Saturday, December 3, 11
64. b) Execute the controller*
// execute the controller, send the request, get the response
$response = call_user_func_array($controller, array($request));
if (!$response instanceof Response) {
throw new Exception(sprintf(
'WTF! Your controller "%s" didn't return a response!!',
$controller
));
}
$response->send();
* each controller is a flat function
Saturday, December 3, 11
65. The Controllers
function homepage(Request $request) {
$content = '<h1>Welcome to PHP Santa</h1>';
$content .= '<a href="/letters">Read the letters</a>';
if ($name = $request->query->get('name')) {
$content .= sprintf(
'<p>Oh, and hello %s!</p>',
$name
);
}
return new Response($content);
}
Saturday, December 3, 11
66. The Controllers
function letters(Request $request)
{
global $dbh; $kitten--
$sql = 'SELECT * FROM php_santa_letters';
$content = '<h1>Read the letters to PHP Santa</h1>';
$content .= '<ul>';
foreach ($dbh->query($sql) as $row) {
$content .= sprintf(
'<li>%s - dated %s</li>',
$row['content'],
$row['received_at']
);
}
$content .= '</ul>';
return new Response($content);
}
Saturday, December 3, 11
67. The Controllers
function error404(Request $request)
{
$content = '<h1>404 Page not Found</h1>';
$content .= 'This is most certainly *not* an xmas miracle';
$response = new Response($content);
$response->setStatusCode(404);
return $response;
}
Saturday, December 3, 11
68. The Big Picture
1. Request cleans the URI
2. Router matches the URI to a route, returns a
“controller” string
3. We execute the controller function
4. The controller creates a Response object
5. We send the Response headers and content
@weaverryan
Saturday, December 3, 11
70. Act 5:
Pimple!
@weaverryan
Saturday, December 3, 11
71. Problems
• We’ve got lots of random, disorganized
objects floating around
• And we can’t easily access them from within
our controllers
function letters(Request $request)
{
global $dbh;
// ....
}
@weaverryan
Saturday, December 3, 11
72. Solution
• Pimple! - a Dependency Injection Container
• Dependency Injection Container:
the scariest word we could think of to
describe an array of objects on steroids
@weaverryan
Saturday, December 3, 11
73. Remember: 3 Steps to
bringing in an external tool
Saturday, December 3, 11
74. #1 Download the library
git submodule add git://github.com/fabpot/
Pimple.git vendors/Pimple
Saturday, December 3, 11
75. #2 Configure the autoloader
// bootstrap.php
// ...
require __DIR__.'/vendors/Pimple/lib/Pimple.php';
actually, it’s only one file - so just require it!
Saturday, December 3, 11
76. #3 Celebrate!
$c = new Pimple();
Saturday, December 3, 11
77. Pimple Creates Objects
• Use Pimple to create and store your objects in
a central place
• If you have the Pimple container object, then
you have access to every other object in your
application
@weaverryan
Saturday, December 3, 11
78. Centralize the db connection
$c = new Pimple();
$c['connection'] = $c->share(function() {
$dsn = 'sqlite:'.__DIR__.'/data/database.sqlite';
return new PDO($dsn);
});
Saturday, December 3, 11
79. Centralize the db connection
$c1 = $c['connection'];
$c2 = $c['connection'];
// they are the same - only one object is created!
$c1 === $c2
Saturday, December 3, 11
80. Centralize the db connection
$c1 = $c['connection'];
$c2 = $c['connection'];
// they are the same - only one object is created!
$c1 === $c2
Saturday, December 3, 11
81. Access to what we need
• So far, we’re using a “global” keyword to
access our database connection
• But if we pass around our Pimple container,
we always have access to anything we need -
including the database connection
@weaverryan
Saturday, December 3, 11
82. Pass the container to the
controller
$c = new Pimple();
// ...
$response = call_user_func_array(
$controller,
array($request, $c)
);
Saturday, December 3, 11
83. function letters(Request $request, Pimple $c)
{
$dbh = $c['connection']; $kitten++
$sql = 'SELECT * FROM php_santa_letters';
$content = '<h1>Read the letters to PHP Santa</h1>';
$content .= '<ul>';
foreach ($dbh->query($sql) as $row) {
// ...
}
// ...
}
Saturday, December 3, 11
84. What else?
How about configuration?
Saturday, December 3, 11
85. $c = new Pimple();
// configuration
$c['connection_string'] = 'sqlite:'.__DIR__
.'/data/database.sqlite';
$c['connection'] = $c->share(function(Pimple $c) {
return new PDO($c['connection_string']);
});
Saturday, December 3, 11
86. Further?
What about dependencies?
Saturday, December 3, 11
91. Problems
• I don’t have enough frameworks in my
framework
• Oh yeah, and we need logging...
@weaverryan
Saturday, December 3, 11
92. Solution
• Zend Framework2
• ZF2 has a ton of components, including a
logger
@weaverryan
Saturday, December 3, 11
93. 3 Steps to bringing in an
external tool
Saturday, December 3, 11
94. #1 Download the library
git submodule add git://github.com/
zendframework/zf2.git vendors/zf2
Saturday, December 3, 11
95. #2 Configure the autoloader
// bootstrap.php
// ...
$loader = new UniversalClassLoader();
$loader->registerNamespace('Symfony', __DIR__.'/vendors');
$loader->registerNamespace('lithium', __DIR__.'/vendors');
$loader->registerNamespace(
'Zend',
__DIR__.'/vendors/zf2/library'
);
$loader->register();
Saturday, December 3, 11
96. #3 Celebrate!
use ZendLogLogger;
use ZendLogWriterStream;
$logger = Logger($pimple['logger_writer']);
Yes we did just bring in a 100k+ lines of
code for a simple logger :)
Saturday, December 3, 11
98. Create the Logger in our
Fancy Container
use ZendLogLogger;
use ZendLogWriterStream;
$c['log_path'] = __DIR__.'/data/web.log';
$c['logger_writer'] = $c->share(function($pimple) {
return new Stream($pimple['log_path']);
});
$c['logger'] = $c->share(function($pimple) {
return new Logger($pimple['logger_writer']);
});
Saturday, December 3, 11
99. And use it anywhere
function error404(Request $request, Pimple $c)
{
$c['logger']->log(
'Crap, 404 for '.$request->getPathInfo(),
Logger::ERR
);
$content = '<h1>404 Page not Found</h1>';
// ...
}
Saturday, December 3, 11
103. Problems
• Our application has 4 major parts:
1) autoloading setup
2) Creation of container
3) Definition of routes
4) Definition of controllers
5) The code that executes everything
• For our business, only #3 and #4 are important
• ... but it’s all jammed together
@weaverryan
Saturday, December 3, 11
104. Solution
• Some definitions
“Application” - the code that makes you money
“Framework” - under-the-hood code that
impresses your geek friends
• To be productive, let’s “hide” the framework
@weaverryan
Saturday, December 3, 11
105. Starting point
• Our app basically has 2 files
‣ bootstrap.php: holds autoloading
‣ index.php: holds
- container setup
- definition of routes
- definition of controllers
- the code that executes it all
@weaverryan
Saturday, December 3, 11
106. Ending point
‣ bootstrap.php: holds
- autoloading
- container setup
- the code that executes it all
(as a function called _run_application())
‣ controllers.php: holds controllers
‣ routes.php: holds routes
‣ index.php: pulls it all together
@weaverryan
Saturday, December 3, 11
107. Nothing to see here...
<?php
// index.php
$c = require 'bootstrap.php';
require 'routing.php';
require 'controllers.php';
$response = _run_application($c);
$response->send();
Saturday, December 3, 11
109. Routes have a home
// routing.php
$c['router']->connect(
'/letters',
array('controller' => 'letters')
);
$c['router']->connect(
'/{:name}',
array(
'controller' => 'homepage',
'name' => null
)
);
Saturday, December 3, 11
110. Controllers have a home
// controllers.php
use SymfonyComponentHttpFoundationRequest;
use SymfonyComponentHttpFoundationResponse;
function homepage(Request $request) {
// ...
}
function letters(Request $request, $c)
{
// ...
}
function error404(Request $request)
{
// ...
}
Saturday, December 3, 11
111. To make $$$, work in
routes.php and controllers.php
Saturday, December 3, 11