The document discusses several updates to the Doctrine ORM:
- Doctrine 1.1 focuses on stability, performance improvements, and documentation updates.
- New features in Doctrine 1.1 include improved configuration options, custom accessor/mutator support, and PHPDoc generation.
- Database migrations allow schema changes to be deployed reliably across environments. The diff tool can generate migration classes from schema changes.
- Doctrine 2.0 provides major performance and architectural improvements by simplifying the API, removing limitations, and decoupling code into common, DBAL, and ORM packages. It also supports new hydration types like scalar and single scalar hydration.
در این جلسه به بررسی بحث برنامه نویسی شی گرا و کلاس ها در پایتون پرداختیم
PySec101 Fall 2013 J7E1 By Mohammad Reza Kamalifard
Talk About:
Object oriented programming and Classes in Python
Modular programming Using Object in ScalaKnoldus Inc.
Scala is a scalable language is that we can use the same techniques to construct small as well as large programs. In this presentation we’ve focused primarily on programming
in the small: designing and implementing the smaller program pieces out of which we can construct a larger program.The other side of the story is programming in the large: organizing and assembling the smaller pieces into larger programs, applications, or systems.
در این جلسه به بررسی بحث برنامه نویسی شی گرا و کلاس ها در پایتون پرداختیم
PySec101 Fall 2013 J7E1 By Mohammad Reza Kamalifard
Talk About:
Object oriented programming and Classes in Python
Modular programming Using Object in ScalaKnoldus Inc.
Scala is a scalable language is that we can use the same techniques to construct small as well as large programs. In this presentation we’ve focused primarily on programming
in the small: designing and implementing the smaller program pieces out of which we can construct a larger program.The other side of the story is programming in the large: organizing and assembling the smaller pieces into larger programs, applications, or systems.
JavaFX and Scala in the Cloud: Stephen Chinjaxconf
What do you get when you combine JavaFX and Scala together on top of a Cloud architecture? The most highly scalable platform for Java client development possible, leveraging the UI richness of JavaFX, elegance of Scala, and infinite scalability of a multi-cloud platform. In this talk, we will demonstrate a cloud application built on the JClouds platform that makes use of a JavaFX front-end written in the Scala language. This is an ideal platform for cost-efficient cloud use; since JavaFX technology lets your client's processor and GPU do the heavy-lifting while you maintain a lightweight set of REST APIs in the cloud. We will go into background on multi-cloud deployment, writing effective REST services, and building rich user interfaces. Since these all share a common foundation on the Java platform, you will learn how to easily write end-to-end applications leveraging your existing development knowledge and platform. Also, all the technologies showcased are 100% open-source, so you can start using these at your job today. Come join us for a fun, informative talk on application development for the cloud. By the end of the session you will have learned how to build an end-to-end client cloud application from the ground up and have access to the source code as a starting point for your own projects.
Design Summit - Navigating the ManageIQ Object Model - Brad AscarManageIQ
Learn how the ManageIQ data and object models stack up. If you're trying to extend ManageIQ with customized applications, you will need to reference this talk.
More more on ManageIQ, see http://manageiq.org/
Functional streams with Kafka - A comparison between Akka-streams and FS2Luis Miguel Reis
Kafka is a distributed streaming platform whose main strength is the ability to serve as the single message hub for applications of massive scale.It relies on a topic-based publish-subscribe model, where each topic may have multiple partitions to be consumed/published from/into. Kafka diverges from regular message queues in a lot of its functionalities. A significant change from other standard message queues is that each consumer has an associated offset, representing the identifier of the last consumed message from the subscribed topic. This allows for replaying of messages in cases of failures, deployment issues, and other occurrences. How can fully functional applications interact with Kafka and its features while maintaining the characteristics of the functional domain? The Scala ecosystem has many stream-based frameworks that can be leveraged to use Kafka. Two of the most used are Akka-Streams and FS2. These frameworks imply different approaches for processing data streams and dealing with Kafka’s features. The goal of this talk is to provide insight into these differences, in terms of functionality, performance, and their impact in maintaining the code, keeping it functional, robust and readable.
JavaFX and Scala in the Cloud: Stephen Chinjaxconf
What do you get when you combine JavaFX and Scala together on top of a Cloud architecture? The most highly scalable platform for Java client development possible, leveraging the UI richness of JavaFX, elegance of Scala, and infinite scalability of a multi-cloud platform. In this talk, we will demonstrate a cloud application built on the JClouds platform that makes use of a JavaFX front-end written in the Scala language. This is an ideal platform for cost-efficient cloud use; since JavaFX technology lets your client's processor and GPU do the heavy-lifting while you maintain a lightweight set of REST APIs in the cloud. We will go into background on multi-cloud deployment, writing effective REST services, and building rich user interfaces. Since these all share a common foundation on the Java platform, you will learn how to easily write end-to-end applications leveraging your existing development knowledge and platform. Also, all the technologies showcased are 100% open-source, so you can start using these at your job today. Come join us for a fun, informative talk on application development for the cloud. By the end of the session you will have learned how to build an end-to-end client cloud application from the ground up and have access to the source code as a starting point for your own projects.
Design Summit - Navigating the ManageIQ Object Model - Brad AscarManageIQ
Learn how the ManageIQ data and object models stack up. If you're trying to extend ManageIQ with customized applications, you will need to reference this talk.
More more on ManageIQ, see http://manageiq.org/
Functional streams with Kafka - A comparison between Akka-streams and FS2Luis Miguel Reis
Kafka is a distributed streaming platform whose main strength is the ability to serve as the single message hub for applications of massive scale.It relies on a topic-based publish-subscribe model, where each topic may have multiple partitions to be consumed/published from/into. Kafka diverges from regular message queues in a lot of its functionalities. A significant change from other standard message queues is that each consumer has an associated offset, representing the identifier of the last consumed message from the subscribed topic. This allows for replaying of messages in cases of failures, deployment issues, and other occurrences. How can fully functional applications interact with Kafka and its features while maintaining the characteristics of the functional domain? The Scala ecosystem has many stream-based frameworks that can be leveraged to use Kafka. Two of the most used are Akka-Streams and FS2. These frameworks imply different approaches for processing data streams and dealing with Kafka’s features. The goal of this talk is to provide insight into these differences, in terms of functionality, performance, and their impact in maintaining the code, keeping it functional, robust and readable.
E-commerce con SF: dal case study alla realtàSimone D'Amico
Posso sviluppare un e-commerce con Symfony? Esistono bundle disponibili oppure bisogna implementare tutto custom? In questo talk scopriremo insieme cosa offre il mondo delle librerie open source e quali sono state le scelte tecniche con cui abbiamo trasformato l’idea di un e-commerce in realtà.
Entrepreneurship support - an entrepreneur's perspectiveSalim Virani
Based on a talk I gave to the Capital Enterprise stakeholders and members in relation to the Bootstrapping Bootcamp program we're developing and sharing.
You can learn more about the program at http://register.leanca.mp/bootstrapping-bootcamp or contact me at http://SaintSal.com/contact
To learn more about the new tools and methods entrepreneurs are using to find market traction faster, go to http://leanca.mp
Why Your Test Suite Sucks - PHPCon PL 2015CiaranMcNulty
Many teams adopt TDD attracted by the promise of a more productive workflow, fewer regressions and higher code quality. Sometimes this goes wrong and these benefits do not materialise, despite a healthy-seeming test suite. In this talk we will look at what the common pitfalls of testing are, why teams fall into these traps, and they can dig themselves out.
In 2010, I told everyone how to start unit testing Zend Framework applications. In 2011, let’s take this a step further by testing services, work flows and performance. Looking to raise the bar on quality? Let this talk be the push you need to improve your Zend Framework projects.
When developers are introduced to object-oriented programming, one of the first things they are taught is that nouns turn into objects, verbs into methods, and Dog is a subclass of Animal. OOP is more than just turning things into classes and objects and showing that both Boats and Cars have motors, and that Dogs and Cats both speak(). Let's look at OOP in real-world settings and go beyond cars and dogs to see how to use object-oriented programming properly in PHP. Traits, composition, inheritance – none of it is off limits!
I present four design patterns that make your development easier and better. Design patterns are a fantastic way to make more readable code, as they make use of common ideas that many developers know and use. These patterns are tried and tested in the enterprise world.
The first one is dependency injection. This covers putting the variables that a class needs to function preferably inside a constructor.
The second one is the factory pattern. A factory moves the responsibility of instantiating an object to a third-party class.
The third one is dependency injection. This allows us to place a class' dependencies at one time, making it easy to come back and see what the class needs to survive.
Finally, we discuss the chain of responsibility. This allows complex operations to be handled by a chain of classes. Each class in the chain determines whether it is capable of handling the request and, if so, it returns the result.
Supercharging WordPress Development - Wordcamp Brighton 2019Adam Tomat
Slide links:
- https://lumberjack.rareloop.com
- https://docs.lumberjack.rareloop.com
- https://github.com/Rareloop/lumberjack-bedrock-installer
- https://github.com/Rareloop/lumberjack
- https://github.com/Rareloop/lumberjack-validation
- https://github.com/Rareloop/hatchet
- rareloop.com/careers
- https://www.rareloop.com/posts/comparing-modern-mvc-wordpress-frameworks/
- https://lizkeogh.com/2017/08/31/reflecting-reality/amp
- https://www.youtube.com/watch?v=uQUxJObxTUs
- https://www.upstatement.com/timber
- https://roots.io/bedrock
---
Often WordPress themes are not easy to change, maintain or fun to work on. This can rule WordPress out as a viable option for bespoke, non-trivial websites.
In this talk we’ll dive into how this happens & look at how we can benefit from software engineering techniques to help make your code easier to change. I’ll also show how using Lumberjack, a powerful MVC framework built on Timber, can be used to power-up your themes.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
This ppt gives information about:
1. OOPs Theory
2. Defining a Class
3. Creating an Object
4. The $this Attribute
5. Creating Constructors
6. Creating Destructors
Coming to Terms with OOP In Drupal - php[world] 2016Chris Tankersley
Drupal 8 has not only brought to the table a much improved admin experience, but has now moved on from its procedural roots into the realm of Object Oriented Programming. While this is a great thing for developers, many Drupal developers have never been introduced to OOP. This talk will explore a very high-level overview of objects, inheritance, composition, and how to architect your code as it relates to Drupal 8.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...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.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
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/
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
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.
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.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
What S New In Doctrine
1. What’s new in Doctrine
Jonathan H. Wage
Titre présentation | Conférencier
2. What’s new in Doctrine
• Doctrine Book
• Doctrine 1.1
• Doctrine 2.0
• Default ORM in Symfony as of today!!
What’s new in Doctrine | Jonathan H. Wage
4. The first Doctrine book
• Available late June
• Available online(html/pdf) and in book format
• Complete user manual and reference guide for
existing and new Doctrine developers
What’s new in Doctrine | Jonathan H. Wage
15. New Features
New configuration options to
remove hardcoded values
What’s new in Doctrine | Jonathan H. Wage
16. New Features
Specify more global default values
$manager->setAttribute(
Doctrine::ATTR_DEFAULT_TABLE_CHARSET, Global table
'utf8' character set
);
$manager->setAttribute(
Doctrine::ATTR_DEFAULT_TABLE_COLLATE, Global table
'utf8_unicode_ci' collation
);
$manager->setAttribute(
Doctrine::ATTR_DEFAULT_IDENTIFIER_OPTIONS, Default automatic
array('length' => 4) identifier definition
);
$manager->setAttribute(
Default column
Doctrine::ATTR_DEFAULT_COLUMN_OPTIONS,
definition
array('notnull' => true)
);
What’s new in Doctrine | Jonathan H. Wage
17. New Features
Better custom accessor and
mutator support
What’s new in Doctrine | Jonathan H. Wage
18. New Features
Custom accessors and mutators
$manager->setAttribute(
Feature is disabled
Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, by default
true
);
class User extends BaseUser
{ Define a new
public function setPassword($password) mutator
{
$this->_set('password', md5($password));
} Set password
} property and
setPassword() is
invoked
$user->password = 'changeme';
What’s new in Doctrine | Jonathan H. Wage
19. New Features
Enhanced fromArray() and
synchronizeWithArray()
methods to better handle
relationships
What’s new in Doctrine | Jonathan H. Wage
20. New Features
Use the array with an
Define array structure instance of a Doctrine
$userData = array( model
'username' => 'jwage',
$user = new User();
'password' => 'changeme',
$user->fromArray($userData);
'Groups' => array(
array(
'_identifier' => 1,
),
array(
'_identifier' => 2 Internally Symfony uses
),
array( these methods to merge
'name' => 'New Group' form values to your model
)
)
instances
);
What’s new in Doctrine | Jonathan H. Wage
21. New Features
Generate phpDoc property
tags for integration with IDEs
What’s new in Doctrine | Jonathan H. Wage
22. New Features
/** All columns and relationships
* BaseUser
* get a generated @property tag
* This class has been auto-generated by the Doctrine ORM Framework
*
* @property string $username
* @property string $password
*
* @package ##PACKAGE##
* @subpackage ##SUBPACKAGE##
* @author ##NAME## <##EMAIL##>
* @version SVN: $Id: Builder.php 5441 2009-01-30 22:58:43Z jwage $
*/
abstract class BaseUser extends Doctrine_Record
// ....
Offers auto complete for modern IDEs
What’s new in Doctrine | Jonathan H. Wage
24. Database Migrations
General improvements
all around to make things more
intuitive and flexible
What’s new in Doctrine | Jonathan H. Wage
25. Database Migrations
• Generated migration class files use timestamp
prefix instead of incremented number
1.0 1.1
001_my_migration.class.php 1244735632_my_migration.class.php
002_my_migration2.class.php 1244735800_my_migration2.class.php
• Avoid conflicts between developers when
generating migrations
What’s new in Doctrine | Jonathan H. Wage
26. Database Migrations
Introduced new Diff tool
What’s new in Doctrine | Jonathan H. Wage
27. Database Migrations
Generate migration classes
automatically from changes
made to your schema
What’s new in Doctrine | Jonathan H. Wage
28. Database Migrations
The schema we’re migrating from
User:
columns:
username: string(255)
password: string(255)
What’s new in Doctrine | Jonathan H. Wage
29. Database Migrations
The schema we’re migrating to
User:
columns:
username: string(255)
password: string(255)
email_address: string(255)
We added a new email_address column
What’s new in Doctrine | Jonathan H. Wage
30. Database Migrations
• How can we get these changes to our DBMS in
dev, staging, production, etc.?
– Manually write the SQL and apply it in dev, staging and
production? Eeeek!!
– Make SQL change in dev server and filter all DDL
statements from DBMS query log? Eeeek!!
• People handle this a lot of different ways and they
are all dangerous and error prone
• Database migrations give you a reliable and
programmatic way to deploy and even revert
database changes
What’s new in Doctrine | Jonathan H. Wage
31. Database Migrations
Generating the changes
$from = '/path/to/schema/from.yml';
$to = '/path/to/schema/to.yml';
$migrationsDir = '/path/to/migrations';
$diff = new Doctrine_Migration_Diff($from, $to, $migrationsDir);
$changes = $diff->generateChanges();
print_r($changes);
What’s new in Doctrine | Jonathan H. Wage
32. Database Migrations
The generated changes
Array
(
[created_columns] => Array
(
[user] => Array
(
[email_address] => Array
(
[type] => string
[length] => 255
)
)
)
)
What’s new in Doctrine | Jonathan H. Wage
33. Database Migrations
• Changes array used to generate migration classes
• The class generation is not 100%
• Some changes cannot be detected
– For example we can’t detect if a column was renamed or
an old column dropped and a new one created.
• You should always review the generated classes to
make sure they do what you want
• So now we can generate our classes to help us
migrate our database changes
What’s new in Doctrine | Jonathan H. Wage
34. Database Migrations
Generating migration classes
$from = '/path/to/schema/from.yml';
$to = '/path/to/schema/to.yml';
$migrationsDir = '/path/to/migrations';
$diff = new Doctrine_Migration_Diff($from, $to, $migrationsDir);
$diff->generateMigrationClasses();
New migration class written
to the $migrationsDir
What’s new in Doctrine | Jonathan H. Wage
35. Database Migrations
Generating migration classes
// /path/to/migrations/1239913213_version1.php
class Version1 extends Doctrine_Migration_Base
{
public function up()
{
$this->addColumn('user', 'email_address', 'string', '255', array('email' => '1'));
}
public function down()
{
$this->removeColumn('user', 'email_address');
}
}
What’s new in Doctrine | Jonathan H. Wage
36. Database Migrations
Migrating changes
Migrate from version 0 to version 1
$migration = new Doctrine_Migration('migrations');
$migration->migrate();
What’s new in Doctrine | Jonathan H. Wage
37. Database Migrations
Migrating from version 0 to 1
would execute the up()
methods
What’s new in Doctrine | Jonathan H. Wage
38. Database Migrations
Migrating from version 1 to 0
would execute the down()
methods
What’s new in Doctrine | Jonathan H. Wage
39. Database Migrations
Migrating changes
Migrate back to version 0
$migration = new Doctrine_Migration('migrations');
$migration->migrate(0);
What’s new in Doctrine | Jonathan H. Wage
40. Database Migrations
Symfony CLI Workflow
• First modify your YAML schema
• Second run the following command
$ php symfony doctrine:generate-migrations-diff
• Now you need to review the generated migrations
classes in lib/migration/doctrine. Once you
confirm they look good run this command.
$ php symfony doctrine:migrate
• Your database is migrated and you can rebuild
your models from your schema.
$ php symfony doctrine:build-model
What’s new in Doctrine | Jonathan H. Wage
41. Database Migrations
In Symfony migrations work by
comparing your modified
YAML schema to the old
generated models
What’s new in Doctrine | Jonathan H. Wage
44. Scalar Hydration
• Flat
• Rectangular result set
• Performs well
• Harder to work with
• Can contain duplicate data
• Like a normal SQL resultset
What’s new in Doctrine | Jonathan H. Wage
45. Scalar Hydration
$q = Doctrine::getTable('User')
->createQuery('u')
->leftJoin('u.Phonenumbers p');
$results = $q->execute(array(), Doctrine::HYDRATE_SCALAR);
print_r($results);
What’s new in Doctrine | Jonathan H. Wage
48. Single Scalar Hydration
Sub type of scalar hydration
What’s new in Doctrine | Jonathan H. Wage
49. Single Scalar Hydration
Returns single scalar value
What’s new in Doctrine | Jonathan H. Wage
50. Single Scalar Hydration
Useful for retrieving single
value for aggregate/calculated
results
What’s new in Doctrine | Jonathan H. Wage
51. Single Scalar Hydration
Very fast since no need exists
to hydrate the data in to
objects or any other structure
What’s new in Doctrine | Jonathan H. Wage
52. Single Scalar Hydration
$q = Doctrine::getTable('User')
->createQuery('u')
->select('COUNT(p.id) as num_phonenumbers')
->leftJoin('u.Phonenumbers p');
$results = $q->execute(array(), Doctrine::HYDRATE_SINGLE_SCALAR);
echo $results; // 2
What’s new in Doctrine | Jonathan H. Wage
56. Doctrine 2.0
Test suite runs 20% faster and
uses 30% less memory!
These performance increases are without
any code changes. With Doctrine 1.x
under 5.3 the same increases apply
What’s new in Doctrine | Jonathan H. Wage
57. Doctrine 2.0
Hydration Performance
Doctrine 1.1
4.3435637950897 for 5000 records
Doctrine 2.0
1.4314442552312 for 5000 records
Doctrine 2.0
3.4690098762512 for 10000 records
What’s new in Doctrine | Jonathan H. Wage
63. Doctrine 2.0
Removed Limitations
What’s new in Doctrine | Jonathan H. Wage
64. Doctrine 2.0
The old way
class User extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('id', 'integer', null, array(
'primary' => true,
'auto_increment' => true
));
$this->hasColumn('username', 'string', 255);
}
}
What’s new in Doctrine | Jonathan H. Wage
65. Doctrine 2.0
The new way
/**
* @DoctrineEntity
* @DoctrineTable(name="user")
*/
class User
{
/**
* @DoctrineId
* @DoctrineColumn(type="integer")
* @DoctrineGeneratedValue(strategy="auto")
*/
public $id;
/**
* @DoctrineColumn(type="varchar", length=255)
*/
public $username;
}
What’s new in Doctrine | Jonathan H. Wage
66. Doctrine 2.0
No need to extend a base
class anymore
What’s new in Doctrine | Jonathan H. Wage
67. Doctrine 2.0
No more cyclic references
What’s new in Doctrine | Jonathan H. Wage
68. Doctrine 2.0
print_r() your objects
$user = new User();
$user->username = 'jwage';
print_r($user);
User Object
(
[id] =>
[username] => jwage
)
What’s new in Doctrine | Jonathan H. Wage
69. Doctrine 2.0
• Positive effect of removing the base
class all around
• Performance increase
• Easier to debug
What’s new in Doctrine | Jonathan H. Wage
70. Doctrine 2.0
No more shared identity map
across connections
What’s new in Doctrine | Jonathan H. Wage
79. Doctrine 2.0
• Under the hood of Doctrine is a powerful database
abstraction layer.
• It is an evolution of code that has existed in other
projects such as PEAR MDB/MDB2 and Zend_Db
• This layer has always existed but not advertised.
• Now that it can be used standalone we’ll be
advertising it much more as a separate system.
What’s new in Doctrine | Jonathan H. Wage
80. Doctrine 2.0
A few examples of the DBAL
What’s new in Doctrine | Jonathan H. Wage
82. Doctrine 2.0
Try a method. If an error
occurs in the DBAL an
exception is thrown
Sometimes you may want to
catch the exception and
swallow it.
What’s new in Doctrine | Jonathan H. Wage
83. Doctrine 2.0
Use the tryMethod() to......try a method
and return false if it fails. The exception
that was thrown if any can be retrieved
and inspected.
if ($sm->tryMethod('createTable', 'new_table', $columns, $options)) {
// do something
}
What’s new in Doctrine | Jonathan H. Wage
84. Doctrine 2.0
Often when issuing DDL statements you
are creating something that may or may
not exist already so you might want to get
rid of it first before re-creating it.
What’s new in Doctrine | Jonathan H. Wage
85. Doctrine 2.0
Previously in Doctrine 1.x, the code for
that might look something like the
following for dropping and creating a
database.
try {
$sm->dropDatabase('test_db');
} catch (Exception $e) {}
$sm->createDatabase('test_db');
What’s new in Doctrine | Jonathan H. Wage
86. Doctrine 2.0
But now we have added new methods for
dropping and creating things so the code
looks like this now.
$sm->dropAndCreateDatabase('test_db');
Every create*() method has a matching
dropAndCreate*() method
What’s new in Doctrine | Jonathan H. Wage
87. Doctrine 2.0
You’ll be hearing a lot more about the
Doctrine DBAL but for now we’ll get back
to talking about what else is new in
Doctrine
What’s new in Doctrine | Jonathan H. Wage
88. Doctrine 2.0
Due to the decoupling things
are easier to extend and
override
What’s new in Doctrine | Jonathan H. Wage
89. Doctrine 2.0
Better support for multiple
database connections
What’s new in Doctrine | Jonathan H. Wage
90. Doctrine 2.0
Sequences, schemas and
catalogs fully supported
What’s new in Doctrine | Jonathan H. Wage
91. Doctrine 2.0
Simplified connection information
$config = new DoctrineORMConfiguration();
$eventManager = new DoctrineCommonEventManager();
$connectionOptions = array(
'driver' => 'pdo_sqlite',
'path' => 'database.sqlite'
);
$em = DoctrineORMEntityManager::create(
$connectionOptions, $config, $eventManager
);
What’s new in Doctrine | Jonathan H. Wage
92. Doctrine 2.0
No more DSN nightmares
What’s new in Doctrine | Jonathan H. Wage
93. Doctrine 2.0
Connection information
specified as simple PHP arrays
What’s new in Doctrine | Jonathan H. Wage
94. Doctrine 2.0
Removed old and heavy
constant based attribute
system
What’s new in Doctrine | Jonathan H. Wage
95. Doctrine 2.0
Replaced with a simpler and
lighter string based
configuration system
What’s new in Doctrine | Jonathan H. Wage
96. Doctrine 2.0
Real Native SQL support
What’s new in Doctrine | Jonathan H. Wage
97. Doctrine 2.0
Driver based Meta Data
What’s new in Doctrine | Jonathan H. Wage
98. Doctrine 2.0
Annotations
/**
* @DoctrineEntity
* @DoctrineTable(name="user")
*/
class User
{
/**
* @DoctrineId
* @DoctrineColumn(type="integer")
* @DoctrineGeneratedValue(strategy="auto")
*/
public $id;
/**
* @DoctrineColumn(type="varchar", length=255)
*/
public $username;
}
What’s new in Doctrine | Jonathan H. Wage
99. Doctrine 2.0
PHP Code
$metadata = new ClassMetadata('User');
$metadata->mapField(array(
'fieldName' => 'id',
'type' => 'integer',
'id' => true
));
$metadata->setIdGeneratorType('auto');
$metadata->mapField(array(
'fieldName' => 'username',
'type' => 'varchar',
'length' => 255
));
What’s new in Doctrine | Jonathan H. Wage
100. Doctrine 2.0
YAML
User:
properties:
id:
id: true
type: integer
idGenerator: auto
username:
type: varchar
length: 255
What’s new in Doctrine | Jonathan H. Wage
101. Doctrine 2.0
• Other drivers possible
• XML, PHP arrays, etc.
• Write your own driver
What’s new in Doctrine | Jonathan H. Wage
102. Doctrine 2.0
Caching
What’s new in Doctrine | Jonathan H. Wage
103. Doctrine 2.0
Query Cache
Cache final SQL that is generated from parsing DQL
What’s new in Doctrine | Jonathan H. Wage
104. Doctrine 2.0
Metadata Cache
Cache the metadata containers so they are only populated once
What’s new in Doctrine | Jonathan H. Wage
105. Doctrine 2.0
Result Cache
Cache the result sets of your queries
What’s new in Doctrine | Jonathan H. Wage
106. Doctrine 2.0
Inheritance Mapping
What’s new in Doctrine | Jonathan H. Wage
107. Doctrine 2.0
Single Table
One table per hierarchy
What’s new in Doctrine | Jonathan H. Wage
108. Doctrine 2.0
Class Table
One table per class
What’s new in Doctrine | Jonathan H. Wage
109. Doctrine 2.0
Concrete Table
One table per concrete class
What’s new in Doctrine | Jonathan H. Wage
110. Doctrine 2.0
Testing
What’s new in Doctrine | Jonathan H. Wage
111. Doctrine 2.0
Switched to phpUnit
What’s new in Doctrine | Jonathan H. Wage
112. Doctrine 2.0
Better mock testing
What’s new in Doctrine | Jonathan H. Wage
113. Doctrine 2.0
Test suite can be ran against
any DBMS. MySQL, PgSQL,
Oracle, Sqlite, etc.
What’s new in Doctrine | Jonathan H. Wage
114. Doctrine 2.0
Because of code decoupling
tests are more granular and
easier to debug
What’s new in Doctrine | Jonathan H. Wage
115. Doctrine 2.0
New Features
What’s new in Doctrine | Jonathan H. Wage
116. Doctrine 2.0
New DQL Parser
What’s new in Doctrine | Jonathan H. Wage
118. Doctrine 2.0
Constructs AST objects
What’s new in Doctrine | Jonathan H. Wage
119. Doctrine 2.0
PHP class names of DQL
parser directly represent the
language itself
OrderByClause.php
SelectClause.php
SelectExpression.php
Subselect.php
DeleteClause.php
etc. etc.
What’s new in Doctrine | Jonathan H. Wage
120. Doctrine 2.0
Every DQL feature has a class
to handle the parsing
What’s new in Doctrine | Jonathan H. Wage
121. Doctrine 2.0
• Easy to use
• Easy to expand and add new features
• Easy to use and understand the parsing of a DQL
string
• Expand the DQL parser with your own functionality
and add to the DQL language
What’s new in Doctrine | Jonathan H. Wage
122. Doctrine 2.0
Performance of DQL parser is
irrelevant due to the parsing
being cached
What’s new in Doctrine | Jonathan H. Wage
123. Doctrine 2.0
Custom Data Types
What’s new in Doctrine | Jonathan H. Wage
124. Doctrine 2.0
namespace DoctrineDBALTypes;
class MyCustomObjectType extends Type
{
public function getName()
{
return 'MyCustomObjectType';
}
public function getSqlDeclaration(array $fieldDeclaration,
DoctrineDBALPlatformsAbstractPlatform $platform)
{
return $platform->getClobDeclarationSql($fieldDeclaration);
}
public function convertToDatabaseValue($value,
DoctrineDBALPlatformsAbstractPlatform $platform)
{
return serialize($value);
}
public function convertToPHPValue($value)
{
return unserialize($value);
}
}
What’s new in Doctrine | Jonathan H. Wage
125. Doctrine 2.0
Add the custom type
Type::addCustomType(
'MyCustomObjectType',
'DoctrineDBALTypesMyCustomObjectType'
);
What’s new in Doctrine | Jonathan H. Wage
126. Doctrine 2.0
Overriding data types
What’s new in Doctrine | Jonathan H. Wage
127. Doctrine 2.0
Override Types
class MyString extends StringType
{
}
Type::overrideType('string', 'DoctrineDBALTypesMyString');
What’s new in Doctrine | Jonathan H. Wage
128. Questions
Jonathan H. Wage
jonathan.wage@sensio.com
+1 415 992 5468
sensiolabs.com | doctrine-project.org | sympalphp.org | jwage.com
You can contact Jonathan about Doctrine and Open-Source or
for training, consulting, application development, or business
related questions at jonathan.wage@sensio.com
What’s new in Doctrine | Jonathan H. Wage