The document discusses developing your own PHP framework and provides tips on when it makes sense. It summarizes common issues with existing frameworks like CakePHP and Zend Framework. It also outlines how to take a broader view when designing a framework, including using a model-view-controller push or pull approach and implementing hierarchical model-view-controller. The document provides examples of how to structure controllers for a master, group, and element to implement this pattern.
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
This class is intended for people who know some HTML and CSS, and covers the fundamental principles of Drupal theming geared toward people who wish to take a static mockup of a site design and turn it into a Drupal theme. You will also learn about using base themes, grid-based layout and helper modules to streamline and customize your Drupal theme.
Trainer Ryan Price has built entertainment sites, social networks, and eCommerce sites for clients including Popular Science, Field and Stream and Outdoor Life magazines. With over 10 years of experience building sites with PHP and other technologies, Ryan began immersing himself in Drupal around 2006. Ryan often teaches and writes articles along with Mike Anello, and the duo is also known for producing the DrupalEasy Podcast with their host Andrew Riley.
The Solar Framework for PHP 5 (2010 Confoo)Paul Jones
This presentation is a whirlwind tour of the Solar framework for PHP 5. After a short bit of background, the presentation will outline the major concepts in Solar: everything is a library, the unified constructor, unified configuration, inherited configuration and localization, unified factory and adapter systems, lazy-loading registry, and the dependency-injection system. Next is an overview of how the dynamic dispatch cycle works in Solar, and how it compares to other framework dispatch cycles. From there we will move on to the SQL system, including the MysqlReplicated adapter, and lead into the ORM system. The ORM overview will briefly cover models, collections, records, automated filters, automated form generation, and more. After discussing the authentication layer, CLI tooling, and command-line controllers, it will wrap up with a brief discussion of Solar project architecture, and a short note on Solar's performance in relation to other popular frameworks.
The document discusses WordPress themes and their anatomy. It explains that WordPress uses themes to change the look and feel of a site. Themes consist of PHP files and CSS/image/JavaScript files. Key PHP template files include header.php, footer.php, sidebar.php, index.php, single.php and page.php. These files work with WordPress template tags and functions to retrieve content from the database and display it on the site. The document provides guidance on creating custom themes from scratch versus using pre-made themes.
Content Management Systems (CMS) & Wordpress theme developmentDave Wallace
- WordPress is a popular content management system (CMS) that can be used to manage websites with frequently updated content from multiple sources. It allows both technical and non-technical users to manage content.
- While WordPress started as a blogging platform, it has evolved into a full-fledged CMS through the use of plugins and themes. Many websites built with WordPress do not look like blogs.
- Setting up WordPress involves downloading and installing the WordPress files, creating a database, editing configuration files, and creating an administrator account. Key interfaces include the public interface for visitors and the admin interface for content management.
This document provides an overview of PHP survival techniques for Drupal front end development. It discusses using square dancing as an analogy to explain PHP concepts. Some key points include:
- PHP and templating with PHPtemplate can be understood through analogies to deciding on a dance, choosing clothes, and then dancing.
- Important PHP concepts like variables, arrays, objects, and functions are explained using square dancing terminology like partners, calls and moves.
- Examples from the Drupal theme guide and books on front end Drupal development are used to demonstrate PHP snippets and template files.
- Conditionals, preprocessing functions, and the template.php file allow for customizing and extending themes. Understanding variables and how
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
This class is intended for people who know some HTML and CSS, and covers the fundamental principles of Drupal theming geared toward people who wish to take a static mockup of a site design and turn it into a Drupal theme. You will also learn about using base themes, grid-based layout and helper modules to streamline and customize your Drupal theme.
Trainer Ryan Price has built entertainment sites, social networks, and eCommerce sites for clients including Popular Science, Field and Stream and Outdoor Life magazines. With over 10 years of experience building sites with PHP and other technologies, Ryan began immersing himself in Drupal around 2006. Ryan often teaches and writes articles along with Mike Anello, and the duo is also known for producing the DrupalEasy Podcast with their host Andrew Riley.
The Solar Framework for PHP 5 (2010 Confoo)Paul Jones
This presentation is a whirlwind tour of the Solar framework for PHP 5. After a short bit of background, the presentation will outline the major concepts in Solar: everything is a library, the unified constructor, unified configuration, inherited configuration and localization, unified factory and adapter systems, lazy-loading registry, and the dependency-injection system. Next is an overview of how the dynamic dispatch cycle works in Solar, and how it compares to other framework dispatch cycles. From there we will move on to the SQL system, including the MysqlReplicated adapter, and lead into the ORM system. The ORM overview will briefly cover models, collections, records, automated filters, automated form generation, and more. After discussing the authentication layer, CLI tooling, and command-line controllers, it will wrap up with a brief discussion of Solar project architecture, and a short note on Solar's performance in relation to other popular frameworks.
The document discusses WordPress themes and their anatomy. It explains that WordPress uses themes to change the look and feel of a site. Themes consist of PHP files and CSS/image/JavaScript files. Key PHP template files include header.php, footer.php, sidebar.php, index.php, single.php and page.php. These files work with WordPress template tags and functions to retrieve content from the database and display it on the site. The document provides guidance on creating custom themes from scratch versus using pre-made themes.
Content Management Systems (CMS) & Wordpress theme developmentDave Wallace
- WordPress is a popular content management system (CMS) that can be used to manage websites with frequently updated content from multiple sources. It allows both technical and non-technical users to manage content.
- While WordPress started as a blogging platform, it has evolved into a full-fledged CMS through the use of plugins and themes. Many websites built with WordPress do not look like blogs.
- Setting up WordPress involves downloading and installing the WordPress files, creating a database, editing configuration files, and creating an administrator account. Key interfaces include the public interface for visitors and the admin interface for content management.
This document provides an overview of PHP survival techniques for Drupal front end development. It discusses using square dancing as an analogy to explain PHP concepts. Some key points include:
- PHP and templating with PHPtemplate can be understood through analogies to deciding on a dance, choosing clothes, and then dancing.
- Important PHP concepts like variables, arrays, objects, and functions are explained using square dancing terminology like partners, calls and moves.
- Examples from the Drupal theme guide and books on front end Drupal development are used to demonstrate PHP snippets and template files.
- Conditionals, preprocessing functions, and the template.php file allow for customizing and extending themes. Understanding variables and how
This PPT gives information about:
1.Drupal overview,
2.basic concepts and terminology of Drupal,
3. Basic Site Building Concepts
4. Advantages
5. Disadvantages
6. Drupal Terminology
This document provides an introduction to the basics of Drupal, an open source content management system (CMS). It describes Drupal's advantages over custom or other CMS platforms, including its modular architecture, security updates, and large community. It also summarizes key Drupal concepts like nodes, taxonomy, modules, themes, and essential modules like Views and CCK. The document concludes with best practices for Drupal usage, administration, and important resources.
This document discusses theming in Drupal 8. It covers:
- What theming is and how themes override default module outputs
- Creating a theme and selecting a base theme like classy or stable
- Using Twig templates to define HTML and preprocess functions
- Declaring libraries for asset loading and managing dependencies
- Defining breakpoints and configuration options for the admin interface
- Registering new theme hooks and template files
To install Wordpress on a remote web server, you must:
1. Download and extract the Wordpress package and upload it to your server.
2. Create a new MySQL database using your hosting control panel or PHPMyAdmin.
3. Edit the wp-config.php file with your database details.
4. Create an administrator account to access the Wordpress admin interface.
This presentation was delivered on 11th May, 2014 in Drupal Camp Pakistan held in DatumSquare IT Services Islamabad. Contents of the presentation contains some basics stuff for designers, themers and coders.
This document provides an overview of connecting to and working with DB2 for IBM i from PHP applications. It discusses using Zend Server, which includes the ibm_db2 driver for connecting to DB2. The document reviews parameters for db2_connect() such as database name, username, password and optional options. It also covers topics like setting a default library, using library lists, and strategies for user profiles. An included sample script demonstrates prepared statements, binding parameters, and retrieving result sets from DB2 using ibm_db2.
JMP402 Master Class: Managed beans and XPages: Your Time Is NowRussell Maher
Russell Maher presented on using managed beans in XPages applications. He began with high-level concepts on what managed beans are and how they are configured and used. He then walked through creating a simple "first" managed bean as an example. Maher discussed when managed beans make sense to use, such as for complex logic or persistence needs. The presentation continued with building an "audit bean" for a demo application and discussed debugging and documentation of managed beans.
Drupal distributions - how to build themDick Olsson
The document discusses how to build Drupal distributions by using tools like Drush Make, install profiles, and exportables. It provides an overview of the key components of a distribution like configuration, third party libraries, install profiles, and exportables. It also demonstrates how to build a distribution and provides tips for using Drush Make, keeping install profiles minimal, organizing exportables, and relying on "broken" handlers for some components.
Add-On Development: EE Expects that Every Developer will do his Dutyreedmaniac
Add-Ons are what make ExpressionEngine the flexible powerhouse that it is today. Being able to write your own simple plugins or incredibly expansive modules allows you to mold ExpressionEngine to nearly any task that your website might require. However, with that power comes a great responsibility to insure that your code is not slowing down the entire site or unduly stressing the server through bad code architecture.
There are simple tools already built into ExpressionEngine and PHP that you can use to see precisely what your Add-On is doing during page processing and where it might be doing more work than is absolutely necessary. Every developer should use these to optimize their work from the very beginning of development, prior to release. This workshop will explain these tools and how you can use them effectively. It will also delve deeper into optimization techniques and tricks that will keep your code light and clean, while finding a balance between functionality and performance.
This document summarizes a Drupal beginner training session. It introduces Drupal and content management systems. It discusses the Drupal business model, users, and history. It covers installing Drupal, the admin area, content and module workflows. It also summarizes setting up themes, views, panels, users, and favorite modules. The document emphasizes practicing Drupal skills and provides several resource links.
WordPress themes are files that work together to create the design and functionality of a WordPress site. An efficient theme structure includes separate files for assets, functions, templates and parts to keep the code modular and reusable. Key aspects of the structure include folders for CSS, JS and images; functions split across multiple files; main templates in the root directory with custom templates in a sub-folder; and reusable parts included using get_template_part(). This summary outlines best practices for organizing WordPress theme code and structure.
Little documentation and few base themes with 8.x branches - what's a front end developer to do? I'll show you what's changing in Drupal theming between D7 and D8 and how to create a custom theme based on the Classy base theme, step by step. We'll go over Twig basics and Twig debugging.
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
Too many responsive websites fall into the "move the sidebars around" trap and end up looking the same as any other responsive site. By combining the CSS of Zen Grids and the smart markup of the Zen 5 theme, you can create a stellar, unique responsive design for your website with ease.
Zen has always been a popular starting point for building Drupal themes, but the new Zen 5 has been re-written from the ground-up with updated best practices including HTML5, Modernizr integration, Normalize, IE conditional classes, responsive layouts, and, best of all, Sass and Compass integration.
Zen Grids is an all new project, independent from the Zen theme. The Zen Grids system reinvents the flexible, but complicated CSS layout method in old versions of the Zen theme, transforming it into a radically simplified process using the power of Sass. Where traditional grid systems (like 960.gs) often don't scale to match a responsive design's requirements, Zen Grids makes it incredibly easy to create amazing responsive layouts in just a couple lines of code.
Responsive Layout Frameworks for XPages Application UIChris Toohey
The document discusses responsive layout frameworks for XPages applications. It covers what responsive layouts are, popular frameworks like Twitter Bootstrap, tips for getting started like using Bootstrap styles and grids, and the pros and cons of responsive layouts versus progressive enhancement. Responsive layouts make a single design adapt to different screen sizes but may be slower, while progressive enhancement combines graceful degradation and client-specific functionality.
Does Git make you angry inside? In this workshop you will get a gentle introduction to working efficiently as a Web developer in small teams, or as a solo developer. We'll focus on real world examples you can actually use to make your work faster and more efficient. Windows? OSX? Linux? No problem, we'll get you up and running with Git, no matter what your system. Yes, this is an introductory session. This is for people who feel shame that they don't know how to "clone my github project", wish they too could "get the gist", and get mad when people say "just diff me a patch" as if it's something as easy as making a mai thai even though you have no rum. No, you don't have to have git installed to attend. You don't even need to know where the command line is on your computer.
Quite significant changes were introduced in the theme system between Drupal 8 and 7. This guide contains information that applies to Drupal 8 theming.
Getting started with Catalyst and extjsPeter Edwards
This document is a presentation about getting started with the ExtJS JavaScript library and the Catalyst Perl framework. It provides an overview of ExtJS and Catalyst, discusses how to put them together in an example application, and concludes that the combination allows for quick and easy development of Web 2.0 applications. The presentation was given at the 2008 Perl Mova conference in Kyiv, Ukraine.
The document provides an overview of a JavaScript crash course, including topics that will be covered such as core language syntax, strings, regular expressions, functions, and objects. It also advertises customized Java EE training courses developed and taught by Marty Hall on various technologies including servlets, JSP, JSF, Struts, Ajax, GWT, Spring and more. The training is available both at public venues and customized on-site versions at organizations.
How to learn to build your own PHP frameworkDinh Pham
The document discusses how to build your own PHP framework and bridge the gap between PHP, object-oriented programming, and software architecture. It outlines some common wisdom around reinventing the wheel versus using existing frameworks. It also provides an overview of some shortcomings of popular frameworks like CakePHP and Zend Framework to consider when building your own framework.
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkNguyen Duc Phu
The document discusses building your own PHP framework and bridging the gap between PHP, OOP, and software architecture. It covers making judgments on developing a framework, understanding existing frameworks like CakePHP and Zend Framework, and taking a broader view of MVC architecture and implementing hierarchical model-view-controller (HMVC).
PHP is the top platform for building and modernizing IBM i applications. In this webinar, Erwin discusses how features of the application server can be leveraged to streamline the development process as well as fast-tracking the management of the PHP environment.
The document introduces the Zend Framework, an open-source PHP framework. It discusses what the framework is, the goals in developing it, why another framework was needed for PHP, how it takes advantage of PHP5 features, and how developers can get started using the framework, including an overview of its MVC architecture and input filtering capabilities.
This PPT gives information about:
1.Drupal overview,
2.basic concepts and terminology of Drupal,
3. Basic Site Building Concepts
4. Advantages
5. Disadvantages
6. Drupal Terminology
This document provides an introduction to the basics of Drupal, an open source content management system (CMS). It describes Drupal's advantages over custom or other CMS platforms, including its modular architecture, security updates, and large community. It also summarizes key Drupal concepts like nodes, taxonomy, modules, themes, and essential modules like Views and CCK. The document concludes with best practices for Drupal usage, administration, and important resources.
This document discusses theming in Drupal 8. It covers:
- What theming is and how themes override default module outputs
- Creating a theme and selecting a base theme like classy or stable
- Using Twig templates to define HTML and preprocess functions
- Declaring libraries for asset loading and managing dependencies
- Defining breakpoints and configuration options for the admin interface
- Registering new theme hooks and template files
To install Wordpress on a remote web server, you must:
1. Download and extract the Wordpress package and upload it to your server.
2. Create a new MySQL database using your hosting control panel or PHPMyAdmin.
3. Edit the wp-config.php file with your database details.
4. Create an administrator account to access the Wordpress admin interface.
This presentation was delivered on 11th May, 2014 in Drupal Camp Pakistan held in DatumSquare IT Services Islamabad. Contents of the presentation contains some basics stuff for designers, themers and coders.
This document provides an overview of connecting to and working with DB2 for IBM i from PHP applications. It discusses using Zend Server, which includes the ibm_db2 driver for connecting to DB2. The document reviews parameters for db2_connect() such as database name, username, password and optional options. It also covers topics like setting a default library, using library lists, and strategies for user profiles. An included sample script demonstrates prepared statements, binding parameters, and retrieving result sets from DB2 using ibm_db2.
JMP402 Master Class: Managed beans and XPages: Your Time Is NowRussell Maher
Russell Maher presented on using managed beans in XPages applications. He began with high-level concepts on what managed beans are and how they are configured and used. He then walked through creating a simple "first" managed bean as an example. Maher discussed when managed beans make sense to use, such as for complex logic or persistence needs. The presentation continued with building an "audit bean" for a demo application and discussed debugging and documentation of managed beans.
Drupal distributions - how to build themDick Olsson
The document discusses how to build Drupal distributions by using tools like Drush Make, install profiles, and exportables. It provides an overview of the key components of a distribution like configuration, third party libraries, install profiles, and exportables. It also demonstrates how to build a distribution and provides tips for using Drush Make, keeping install profiles minimal, organizing exportables, and relying on "broken" handlers for some components.
Add-On Development: EE Expects that Every Developer will do his Dutyreedmaniac
Add-Ons are what make ExpressionEngine the flexible powerhouse that it is today. Being able to write your own simple plugins or incredibly expansive modules allows you to mold ExpressionEngine to nearly any task that your website might require. However, with that power comes a great responsibility to insure that your code is not slowing down the entire site or unduly stressing the server through bad code architecture.
There are simple tools already built into ExpressionEngine and PHP that you can use to see precisely what your Add-On is doing during page processing and where it might be doing more work than is absolutely necessary. Every developer should use these to optimize their work from the very beginning of development, prior to release. This workshop will explain these tools and how you can use them effectively. It will also delve deeper into optimization techniques and tricks that will keep your code light and clean, while finding a balance between functionality and performance.
This document summarizes a Drupal beginner training session. It introduces Drupal and content management systems. It discusses the Drupal business model, users, and history. It covers installing Drupal, the admin area, content and module workflows. It also summarizes setting up themes, views, panels, users, and favorite modules. The document emphasizes practicing Drupal skills and provides several resource links.
WordPress themes are files that work together to create the design and functionality of a WordPress site. An efficient theme structure includes separate files for assets, functions, templates and parts to keep the code modular and reusable. Key aspects of the structure include folders for CSS, JS and images; functions split across multiple files; main templates in the root directory with custom templates in a sub-folder; and reusable parts included using get_template_part(). This summary outlines best practices for organizing WordPress theme code and structure.
Little documentation and few base themes with 8.x branches - what's a front end developer to do? I'll show you what's changing in Drupal theming between D7 and D8 and how to create a custom theme based on the Classy base theme, step by step. We'll go over Twig basics and Twig debugging.
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
Too many responsive websites fall into the "move the sidebars around" trap and end up looking the same as any other responsive site. By combining the CSS of Zen Grids and the smart markup of the Zen 5 theme, you can create a stellar, unique responsive design for your website with ease.
Zen has always been a popular starting point for building Drupal themes, but the new Zen 5 has been re-written from the ground-up with updated best practices including HTML5, Modernizr integration, Normalize, IE conditional classes, responsive layouts, and, best of all, Sass and Compass integration.
Zen Grids is an all new project, independent from the Zen theme. The Zen Grids system reinvents the flexible, but complicated CSS layout method in old versions of the Zen theme, transforming it into a radically simplified process using the power of Sass. Where traditional grid systems (like 960.gs) often don't scale to match a responsive design's requirements, Zen Grids makes it incredibly easy to create amazing responsive layouts in just a couple lines of code.
Responsive Layout Frameworks for XPages Application UIChris Toohey
The document discusses responsive layout frameworks for XPages applications. It covers what responsive layouts are, popular frameworks like Twitter Bootstrap, tips for getting started like using Bootstrap styles and grids, and the pros and cons of responsive layouts versus progressive enhancement. Responsive layouts make a single design adapt to different screen sizes but may be slower, while progressive enhancement combines graceful degradation and client-specific functionality.
Does Git make you angry inside? In this workshop you will get a gentle introduction to working efficiently as a Web developer in small teams, or as a solo developer. We'll focus on real world examples you can actually use to make your work faster and more efficient. Windows? OSX? Linux? No problem, we'll get you up and running with Git, no matter what your system. Yes, this is an introductory session. This is for people who feel shame that they don't know how to "clone my github project", wish they too could "get the gist", and get mad when people say "just diff me a patch" as if it's something as easy as making a mai thai even though you have no rum. No, you don't have to have git installed to attend. You don't even need to know where the command line is on your computer.
Quite significant changes were introduced in the theme system between Drupal 8 and 7. This guide contains information that applies to Drupal 8 theming.
Getting started with Catalyst and extjsPeter Edwards
This document is a presentation about getting started with the ExtJS JavaScript library and the Catalyst Perl framework. It provides an overview of ExtJS and Catalyst, discusses how to put them together in an example application, and concludes that the combination allows for quick and easy development of Web 2.0 applications. The presentation was given at the 2008 Perl Mova conference in Kyiv, Ukraine.
The document provides an overview of a JavaScript crash course, including topics that will be covered such as core language syntax, strings, regular expressions, functions, and objects. It also advertises customized Java EE training courses developed and taught by Marty Hall on various technologies including servlets, JSP, JSF, Struts, Ajax, GWT, Spring and more. The training is available both at public venues and customized on-site versions at organizations.
How to learn to build your own PHP frameworkDinh Pham
The document discusses how to build your own PHP framework and bridge the gap between PHP, object-oriented programming, and software architecture. It outlines some common wisdom around reinventing the wheel versus using existing frameworks. It also provides an overview of some shortcomings of popular frameworks like CakePHP and Zend Framework to consider when building your own framework.
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkNguyen Duc Phu
The document discusses building your own PHP framework and bridging the gap between PHP, OOP, and software architecture. It covers making judgments on developing a framework, understanding existing frameworks like CakePHP and Zend Framework, and taking a broader view of MVC architecture and implementing hierarchical model-view-controller (HMVC).
PHP is the top platform for building and modernizing IBM i applications. In this webinar, Erwin discusses how features of the application server can be leveraged to streamline the development process as well as fast-tracking the management of the PHP environment.
The document introduces the Zend Framework, an open-source PHP framework. It discusses what the framework is, the goals in developing it, why another framework was needed for PHP, how it takes advantage of PHP5 features, and how developers can get started using the framework, including an overview of its MVC architecture and input filtering capabilities.
This document summarizes best practices for beginners learning Drupal, including leveraging contributed modules, developing a local environment, workflow, content structure, theming, and coding standards. Key recommendations include assessing project pages and README files for modules, putting modules and themes in organized directories, using tools like Drush and version control, following a development to production workflow, breaking content into manageable pieces, and participating in the Drupal community to continue learning.
This document provides an overview and introduction to the Zend Framework. It begins with introductions of the speaker and an outline of topics to be covered, which include basics of the Zend Framework, its model-view-controller implementation, components and libraries, and what's new. It then discusses what the Zend Framework is, how it was developed, its requirements, flexible licensing, and benefits of using it. The rest of the document explains key aspects of the Zend Framework including its front controller, action controllers, views, models, and how they work together in the traditional MVC pattern. It also provides examples of controllers, views, models, and customizing the framework.
This document introduces CodeIgniter, an open source PHP web application framework based on the Model-View-Controller (MVC) pattern. It discusses why MVC frameworks are useful for building enterprise web applications. CodeIgniter provides features like routing, database access, form validation and security filtering to help structure applications and make tasks less tedious. The document outlines CodeIgniter's directory structure, controllers, views, helpers and libraries to demonstrate how it implements the MVC pattern.
Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL)Mark Hamstra
This document summarizes a PHP user group meetup that took place in July 2015. It provides details on the meetup location, sponsor, and speaker. The speaker, Mark Hamstra, gave a presentation on unleashing creative freedom with MODX, an open source CMS. The presentation covered what MODX is, its features like templates and snippets, and its architecture including the xPDO ORM and extending MODX through custom models and packages.
MVC is a popular PHP framework that follows the model-view-controller architectural pattern. It uses components like Zend_Db for database access, Zend_Service for web services, and Zend_View for templating. MVC implements patterns like the front controller and two-step view. Sample code shows how to create an application, controller, and view to display "Hello World".
Organinzing Your PHP Projects (2010 Memphis PHP)Paul Jones
By using a single organizational principle, developers can easily make their project structure more predictable, extensible, and modular. The talk will discuss this one lesson, how it can be discovered from researching publicly available PHP projects, how to apply it, and how it is used (or not used) in well-known applications and frameworks.
Organizing Your PHP Projects (2010 ConFoo)Paul Jones
By using a few simple organizational principles, developers can make their project structure predictable, extensible, and modular. These techniques make it easy to de-conflict and share code between multiple projects. They also make it easy to automate project-support tasks such as testing, documentation, and distribution. This talk will discuss these principles, how they can be discovered from researching publicly available PHP projects, and how they are used (or not used) in popular applications and frameworks.
The document provides an overview of technologies that are useful for startups. It discusses what a startup is, stages of startup development, product evolution and life cycles, tech stacks, databases, programming languages, and server-side frameworks. The key considerations when choosing technologies include problem fit, performance, productivity, scalability, and maturity of the software/framework. Relational databases are generally the best default option, and other data stores like NoSQL should only be considered if relational databases cannot meet the needed scale.
Making the Most of Modern PHP in Drupal 7Ryan Szrama
With Drupal 8 due to land later this year, the Drupal community is about to get a crash course in modern PHP. More of Drupal will use object oriented programming and its related design patterns. More of Drupal will be based on libraries that "weren't invented here." More of Drupal will require an understanding and use of a popular tool called Composer for dependency management (a mixture of Drupal's module .info files and drush).
If you haven't been heavily involved in the development of Drupal 8, all of these changes combined can be overwhelming or come with no perceivable benefit. However, that doesn't have to be the case. You can begin learning now to improve your own development capabilities and deliver better results to your customers by making the most of modern PHP even in your Drupal 7 projects.
This presentation introduces what a Drupal developer or agency can to do today to prepare for this future.
Symfony CMF: un nuovo paradigma per la gestione dei contenutiMichele Orselli
Presentation from phpday2011. La modellazione e gestione dei contenuti costituisce un dominio complesso. Soluzioni standard come Drupal, Joomla o Wordpress si adattano con difficoltà sul dominio di uno specifico cliente; d'altro canto soluzioni fatte in casa costano in termini di tempi di sviluppo e riusabilità. Non esiste allora ""one cms to rule them all""?
Nel talk verrà introdotto il progetto Symfony CMF discutendo tra l'altro di:
- standard per la modellazione dei contenuti
- modellazione ed organizzazione dei contenuti
- scelte architetturali
- linee guida per l'utlizzo del cmf
Symfony CMF: un nuovo paradigma per la gestione dei contenutiManuel Baldassarri
Presentation from phpday2011. La modellazione e gestione dei contenuti costituisce un dominio complesso. Soluzioni standard come Drupal, Joomla o Wordpress si adattano con difficoltà sul dominio di uno specifico cliente; d’altro canto soluzioni fatte in casa costano in termini di tempi di sviluppo e riusabilità. Non esiste allora "one cms to rule them all"?
Nel talk verrà introdotto il progetto Symfony CMF discutendo tra l’altro di:
- standard per la modellazione dei contenuti
- modellazione ed organizzazione dei contenuti
- scelte architetturali
- linee guida per l’utlizzo del cmf
This document discusses how to scale PHP applications to meet high demand. It begins by noting that large companies like Facebook and Wikipedia use PHP. It then outlines several techniques for scaling PHP, including: using opcode caches to improve performance; storing sessions in a database rather than disk; leveraging in-memory data caches like Memcached and Redis; doing blocking work in background tasks via queues; and utilizing HTTP caching with a reverse proxy cache. The document emphasizes that performance is important for user experience and business results, and that these techniques can help PHP applications handle high traffic loads.
Talk was given at WebConf Riga 2012. There was some trolling about Symfony 2 and ZF2 just for fun. I actually think these are great projects so sorry if it hury your feelings.
This is a low-level, and philosophical discussion on the act of compiling data out of your PHP applications using Zend\Code: Scanning, Generating, Annotating code in PHP.
A few tips on how to go to the next level in PHP web application development. Tells about SCM, code convention, code testing, DRY, etc. Targeted towards the new PHPers who have worked for around 6-12 months.
how startups can benefit from launch communityhazzaz
The document describes Launch Community, a nonprofit organization in Vietnam that aims to foster entrepreneurship through knowledge sharing and collaboration. It provides resources for startups like access to investors, advisors, and expertise. Launch Community hosts events like cafe meetups and pitching sessions to connect entrepreneurs and offers an active Facebook group with over 600 members to share knowledge. The organization's goals are to support both new and existing startups and help bring a second wave of tech startups to Vietnam.
This document provides an overview of how to start a business using the Magento e-commerce platform. It discusses Magento's architecture and flexibility, features like multi-store management, catalog and product browsing, marketing tools, and reporting. It also addresses questions about building extensions, the most important aspects, and selling extensions on marketplaces like Magento Connect and Magestore.com.
The document is a presentation about HTML5 and CSS3 by Dang Minh Tuan. It discusses what HTML5 and CSS3 are, who develops them, who supports them, who uses them, and how to learn them. It encourages starting projects with HTML5 and CSS3 now despite any fears or doubts, as they allow for more innovative designs and an improved user experience compared to older technologies. The presentation provides examples and references to support its points.
This document discusses JavaScript unit testing and frameworks. It provides an agenda that covers JavaScript, unit testing, and JavaScript unit testing frameworks. It defines JavaScript and unit testing, and provides examples of unit tests using QUnit. It discusses test-driven development and the benefits of unit testing like isolating parts of a program and facilitating change. Finally, it lists some JavaScript unit testing frameworks and leaves time for coding examples and questions.
This document discusses how to build a PHP extension in C. It provides an overview of PHP extensions and the extension development process. It then walks through an example "Hello World" extension, showing how to generate the extension skeleton, add functions in the header and source files, build and install the extension, and test the new functionality. Advanced topics like parameters, return values, memory allocation and preventing memory leaks are also briefly mentioned.
This document discusses various techniques for optimizing website performance, including: reducing page generation time through caching and opcode caching; minimizing round-trip times by leveraging browser caching, combining files, and parallel downloads; decreasing response sizes by gzipping files, image optimization, and using a CDN; and improving rendering through CSS/JS placement and preloading. Tools mentioned for analyzing performance include XDebug, WinCacheGrind, Page Speed, and YSlow.
This document discusses speeding up the ZingMe-NTVV2 application by writing a PHP extension module. It introduces NTVV2, which has high traffic volumes. Writing a PHP extension can make complicated business functions run faster and use less memory compared to pure PHP. The document explains what a PHP extension is, its lifecycle, and how to set up the build environment. It recommends using SWIG, an interface compiler, to more easily connect C/C++ code to PHP. SWIG allows defining types, wrapping classes/functions, and exposing functions to PHP. The document provides steps for using SWIG, including defining the module interface, generating code, compiling it into a PHP extension, and caching data in the new
This document discusses best practices for building scalable PHP websites, as demonstrated by ZingMe's architecture. It covers scaling by adding servers horizontally (scaling out) rather than vertically on single servers. Key aspects covered include load balancing with HAProxy, managing user sessions in Memcached to allow scaling, and deploying code changes automatically across servers using SVN and scripts. ZingMe's implementation supports over 1.7 million daily active users on over 300 servers through these scalability techniques.
The document discusses MySQL optimization and indexing principles. It provides examples of queries with and without indexes and uses the EXPLAIN statement to analyze query performance. Indexing types for MyISAM and InnoDB storage engines are explained. Considerations for when indexes can and cannot be used are also covered. The document is presented by someone who works with MySQL and offers their contact information for questions.
The document discusses the entity-attribute-value (EAV) data model used in Magento. In an EAV model, attributes are stored in a separate table from the core entity/object table. Each row contains the entity ID, attribute name, and attribute value. This provides flexibility but can result in inefficient queries. Solutions like using a pivot table to normalize the data are discussed. The EAV model works best for scenarios where flexibility and scalability are prioritized over query performance.
CSS has evolved significantly since its inception. Originally, CSS provided basic styling capabilities that separated web page structure from presentation. Over time, CSS gained more powerful features through specifications like CSS3, and new techniques and frameworks like OOCSS emerged to make CSS more flexible and powerful. Looking ahead, CSS will likely continue advancing with new specifications and tools, though some question if it will be replaced by another technology in the future. CSS has come a long way and will likely remain a core technology for styling web pages.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
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.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
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.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
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
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
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
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.
2. How to develop your own framework Introduction
Introduction
A foundation member of JavaVietnam since 2003
(http://www.javavietnam.org)
A foundation member of PHPVietnam Discussion Group since 2004
(http://groups.google.com/group/phpvietnam)
Lead web developer with World’Vest Base Inc.
Java is my first love since 1999
PHP is my real lover since 2003. I love the way PHP community
works
Sometimes I works on Python, Ruby, Erlang
I am a strong believer in dynamic programming languages,
JavaScript, web standards, convergence of web as a platform and
Outsourcing 2.0
I spent 2 years to play with my framework named Pone (PHP One)
2
3. How to develop your own framework Introduction
Objectives
Where is PHP now? It is changing.
Enterprise oriented: which is driven by Yahoo, Facebook, Zend,
Sun/MySQL, Oracle, OmniTI … PHP is too big. It can not just be
ignored
Object Oriented Programming adoption
Increased complexity of web applications
Web vs. Adobe Air, MS Silverlight, JavaFX, Google Native Client
Trends Will Move Applications to the Web: Consumer Innovation Setting
the Pace, Rise of the Power Collaborator, New Economics of Scale for
IT, Barriers to Adoption Are Falling
Scale-out wins
Understanding what framework designers think
Building up shared mindsets
Providing food for thought
3
4. How to develop your own framework Introduction
Agenda – 40 slides
Making judgments
Top notch frameworks and their shortcomings
A broader view on your framework
Lessons to learn
4
5. How to develop your own framework
Making judgments
• Common wisdom: Reinventing the wheel
• Good
– You know it inside and out
– You control its pace
– It fits your needs. Sometimes, your need is unique
– It teaches you how the world around you works
– License: This is why GPL is sometime a bad thing
• Bad
– You may not as good as other ones
– No community
– No outside contributors
– Reinventing the square wheel
5
6. How to develop your own framework
Making judgments
• To develop a framework is just like to set up a business
• Think of your limitation: time, resources, knowledge to
build/test/document/maintain your own mental baby
• Know your team: how to train them
• Know the market: known frameworks in the market.
Sometimes your needs are satisfied to some extent in several
little-known frameworks
• Starts with pencil and paper: its components and how they
interact
• Starts with API: learn how to design an API first
• You never do it right from day one
6
7. How to develop your own framework
Know the market
• CakePHP shortcomings
• Zend Framework shortcomings
• Third party frameworks shortcomings
7
8. How to develop your own framework
Know the market - CakePHP
• Misleading terms: plugin, model…
– Plugin: CakePHP allows you to set up a combination of controllers,
models, and views and release them as a packaged application
• Too database centric: CakePHP naming convention is driven by table names, not
dependency injection mechanism.
• Admin routing sucks: why do we need one-and-only backend
for the whole application/plugin/etc…?
• Flat application structure: plugin/controller/action and no
more.
• Global space constants
8
9. How to develop your own framework
Know the market - CakePHP
• No elegant way to change media file (css,
javascript, meta content) on each layout
page, controlled by a Controller.
<head>
<?php echo $html->charset(); ?>
<title>
<?php echo $title_for_layout; ?>
</title>
<?php
echo $html->css('cake.generic');
echo $javascript->link('prototype-1.6.0.2');
echo $scripts_for_layout;
echo $html->meta('icon','/myapp/img/favicon.ico', array
('type' =>'icon'));
?>
</head>
9
10. How to develop your own framework
Know the market - CakePHP
• loadModel(), loadController() are not about dependency injection
• E.x: You want to provide access to a model from a Component
Say you have a model called FooBar in a file called foo_bar.php
loadModel('FooBar');
$this->FooBar = &new FooBar();
• loadModel() maybe deprecated in favor of
App::import('Model', 'ModelName');
10
11. How to develop your own framework
Know the market - CakePHP
• beforeFilter(), afterFilter() are coupled with a certain controller
(controller is a heavy object. It should avoid being hit too soon)
<?php
class AppController extends Controller {
var $beforeFilter = array('checkAccess');
var $components = array('Acl');
function checkAccess(){
}
}
?>
11
12. How to develop your own framework
Know the market - CakePHP
• Reuse of view via elements with requestAction() is bad and
expensive
– The dispatcher is called for each call to a controller (routing,
figures out what (Plugin)/Controller/Action is request, loops
through all $paths->controllerPaths files, to figure out what
Controller to load)
– The controller is set up again
• Behavior: controllerActAsModel
• Controller is an interface to another tier
• Controller is not designed to provide data for internal components
• Cache unfriendly
12
13. How to develop your own framework
Know the market - CakePHP
• Caching hits its hard time because there is no way to get
generated view content
<?php
$this->element('helpbox', array("cache" => array('time'=> "+7
days",'key'=>'unique value')));
?>
• What about URL-based caching, session/cookie-
based caching, geo-based caching, date-based
caching
(there are a lot of things to tell about CakePHP but it is all for today)
13
14. How to develop your own framework
Know the market – Zend Framework
• Zend Framework tries to be a better PEAR
– Powered by a solid foundation
– A solid and controllable licensing (CLA)
– More strictly controlled development environment
– Enterprise-oriented class library
– A well-defined roadmap and versioning
• Zend Framework is a glue framework or framework-
oriented class library
14
15. How to develop your own framework
Know the market – Zend Framework
• Zend Framework is extremely big and bloated
– Zend Framework 1.6.2: 1261 file, 267 folders
– Zend_Mail: 33 files
– Zend_Pdf: 89 files
– Zend_Controller: 50 files
– Zend_View: 57 files
– Drupal includes folders: 33 files
• Zend Framework is designed most like Java frameworks
– Small class file
– Lot of classes: object graph is hard (see next)
– Atomic responsibility
– Strongly embrace design patterns
15
17. How to develop your own framework
Know the market – Zend Framework
• Everything is an object, even a HTML button or checkbox. The same to Java
(see Apache Wicket, Tapestry, JBoss Seam)
class Zend_View_Helper_FormReset extends Zend_View_Helper_FormElement
{
public function formReset($name = '', $value = 'Reset', $attribs = null)
{
$info = $this->_getInfo($name, $value, $attribs);
extract($info); // name, value, attribs, options, listsep, disable
// check if disabled
$disabled = '';
if ($disable) {
$disabled = ' disabled="disabled"';
}
// get closing tag
$endTag = '>';
if ($this->view->doctype()->isXhtml()) {
$endTag = ' />';
}
// Render button
$xhtml = '<input type="reset"'
. ' name="' . $this->view->escape($name) . '"'
. ' id="' . $this->view->escape($id) . '"'
. $disabled;
. . . . . . . . .
}
} 17
18. How to develop your own framework
Know the market – Zend Framework
• What Zend Framework brings
– Lot of files are loaded per request which is a bad thing for a dynamic,
interpreted language and stateless platform like PHP
– Much more memory usage
– Bad thing for PHP memory management model in which memory is
allocated in small chunks
– Zend Framework code: There are lot of require_once() call inside an if
statement which is bad for opcode caching mechanism
– Zend Framework leaves shared hosting in the cold.
• 700 sites per server are quite normal
• No control over file system optimization
• No control over memory
• No control over opcode caching
18
19. How to develop your own framework
Know the market – Zend Framework
• A glue framework requires you to know every concrete
class and how to use them in a application life cycle
• A lot of things to consider means bootstrapping is a
mess
19
20. How to develop your own framework
Know the market – Zend Framework
define('ROOT_DIR', dirname(dirname(dirname(__FILE__))));
define('APP_DIR',dirname(dirname(__FILE__)));
set_include_path('.' . PATH_SEPARATOR . APP_DIR . '/lib/' . PATH_SEPARATOR . APP_DIR .
'/application/default/models/' . PATH_SEPARATOR . ROOT_DIR . '/shared/lib/' . PATH_SEPARATOR .
get_include_path());
//This requires that your Zend library lies in ROOT_DIR/shared/lib/
//make classes autoload without doing require
require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();
if(defined('ENV') !== TRUE) {
define('ENV','production'); //change staging to production to go to production settings
}
$config = new Zend_Config_Xml(APP_DIR . '/config/config.xml', ENV);
Zend_Registry::set('config',$config);
//init session
$session = new Zend_Session_Namespace($config->session_name);
Zend_Registry::set('session',$session);
Zend_Db_Table::setDefaultAdapter(Zend_Db::factory(Zend_Registry::get('config')->database));
/**
* Init the Smarty view wrapper and set smarty suffix to the view scripts.
*/
$view = new EZ_View_Smarty($config->smarty->toArray());
20
21. How to develop your own framework
Know the market – Zend Framework
// use the viewrenderer to keep the code DRY instantiate and add the helper in one go
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
$viewRenderer->setViewSuffix($config->smarty->suffix);
/**
* Set inflector for Zend_Layout
*/
$inflector = new Zend_Filter_Inflector(':script.:suffix');
$inflector->addRules(array(':script' => array('Word_CamelCaseToDash', 'StringToLower'), 'suffix' => $config->layout->suffix));
// Initialise Zend_Layout's MVC helpers
Zend_Layout::startMvc(array('layoutPath' => ROOT_DIR.$config->layout->layoutPath,
'view' => $view,
'contentKey' => $config->layout->contentKey,
'inflector' => $inflector));
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(array(
'default' => '../application/default/controllers',
'blog' => '../application/blog/controllers',
));
$front->throwExceptions(true);
// enable logging to default.log
$writer = new Zend_Log_Writer_Stream(APP_DIR.'/data/log/default.log');
$logger = new Zend_Log($writer);
// give easy access to the logger
Zend_Registry::set('logger', $logger);
try {
$front->dispatch();
} catch(Exception $e) {
echo nl2br($e->__toString());
} 21
22. How to develop your own framework
Know the market – Zend Framework
• Zend Framework is different.
– It is not a solid application framework like CakePHP, it is
designed to be a platform on which other frameworks are built
• Technical details should be mentioned in another talk
(enough for today)
22
23. How to develop your own framework
A broader view on your framework
• MVC Push or Pull
– MVC Push or Passive View
<?php
// Load the Savant3 class file and create an instance.
require_once 'Savant3.php';
$tpl = new Savant3();
// Create a title.
$name = "Some Of My Favorite Books";
// Generate an array of book authors and titles.
$booklist = array(
array(
'author' => 'Hernando de Soto',
'title' => 'The Mystery of Capitalism'
),
array(
'author' => 'Neal Stephenson',
'title' => 'Cryptonomicon'
),
array(
'author' => 'Milton Friedman',
'title' => 'Free to Choose'
)
);
// Assign values to the Savant instance.
$tpl->title = $name;
$tpl->books = $booklist;
// Display a template using the assigned values.
$tpl->display('books.tpl.php');
?>
23
24. How to develop your own framework
A broader view on your framework
• MVC Push or Pull
– MVC Pull or so-called HMVC (see next): break a big controller
into small ones
24
25. How to develop your own framework
A broader view on your framework
25
27. How to develop your own framework
A broader view on your framework
• MVC Push or Pull: HMVC implementation
– Master Controller
/**
* Show the home page
*
* @link http://www.wvbresearch.com/home/index/index
* @name index
* @access public
*/
public function indexAction()
{
// Attach placeholder: the name of ElementGroup
$this->_layout->registerBody('homeIndex');
// Set content for the response
$this->_response->setContent($this->_layout->render('index3col'));
}
27
28. How to develop your own framework
A broader view on your framework
• MVC Push or Pull: HMVC implementation
– Group Controller
class Group_HomeIndex extends Pone_View_ElementGroup
{
/**
* Elements in in this group
*
* @var array
*/
protected $_elementsInGroup = array(
'homeTopNegativeEpsSurprises', 'homeTopPositiveEpsSurprises',
'homeIntroduction', 'brokerRatingsUpgrades', 'homeAnalystEstimatesSearchBox',
'homeResearchReportSearchBox', 'latestResearchReports'
);
protected $_templateFile = 'homeIndex';
public function setup()
{
}
}
28
29. How to develop your own framework
A broader view on your framework
• MVC Push or Pull: HMVC implementation
– Element Controller
class Element_LatestResearchReports extends Pone_View_Element
{
protected $_templateFile = 'latestResearchReportsOnHome';
/**
* List of recent research reports
*
* @var Pone_DataSet
*/
public $researchReports;
public function setup()
{
$module = Pone::getContext()->getFront()->getRequest()->getModuleName();
$numberOfItems = 7;
if ('home' !== $module)
{
$this->_templateFile = 'latestResearchReports';
$numberOfItems = 10;
}
$dbConn = Pone_Action_Helper_Database::getInstance()->getConnection('oracleweb', true);
$researchReportDs = ResearchReportDatabaseService::getInstance($dbConn);
$this->researchReports = $researchReportDs->findRecentList($numberOfItems);
}
}
29
30. How to develop your own framework
A broader view on your framework
• MVC Push or Pull: HMVC implementation
– Element Controller template
<div class="featureBlockHeader">
<h2>Latest reports</h2>
</div>
<div class="textBox">
<div class="textBoxContent">
<?php if (true === $this->researchReports->isReadable()): $iter = $this-
>researchReports->getIterator(); ?>
<ul class="imgList">
<?php foreach ($iter as $report): ?>
<li><a href="research/detail/view/rpid/<?php echo $report-
>get('report_id') ?>"><?php echo $report->get('title'); ?></a></li>
<?php endforeach; ?>
</ul>
<?php else: echo $this->researchReports->getMessage(); endif;?>
</div>
</div>
30
31. How to develop your own framework
A broader view on your framework
• IDE support
– Code completion rocks
– MVC Push is bad for view data documentation
– Zend_Registry is bad for code completion
Zend_Registry::set('logger', $logger);
– Think of interface because implementing a way to load dynamic
class from a variable or an array element.
– Learn how to write DocBlock
31
32. How to develop your own framework
A broader view on your framework
• Core feature set
– MVC framework
• Model layer: DBO, File handling/transformation, business rules,
workflows, search, messaging, memory, remote resource access …
– Validation framework instead of form handling
– Unified directory structure: model classes, controllers, views (page
fragments, layouts), plugins, filters, custom exceptions, helpers
– Session
– Authentication and ACL: Abstract and extensible
• HTTP Digest
• Database backed
• SAML/SSO
• Serializable Unified Session User Object
32
33. How to develop your own framework
A broader view on your framework
• Core feature set
– Validation framework
class Form_Signup extends Pone_Form_Input
{
. . . . . .
public function onPost()
{
// Email
$emailRules = array(
Pone_Form_Rule::EMAIL => array('feedback' => _t('common.error.email.notvalid'))
);
$this->setValidationRule('email', $emailRules);
// Email 2
$email2Rules = array(
Pone_Form_Rule::STRING_EQUAL => array('feedback' => _t('common.error.reemail.not_match'),
'reference' => 'email')
);
$this->setValidationRule('email2', $email2Rules);
// password
$passwordRules = array(
Pone_Form_Rule::NOT_EMPTY => array('feedback' => _t('common.error.password.empty'))
);
$this->setValidationRule('password', $passwordRules);
// password 2
$password2Rules = array(
Pone_Form_Rule::STRING_EQUAL => array('feedback' => _t('common.error.repassword.not_match'),
'reference' => 'password') 33
);
$this->setValidationRule('password2', $password2Rules);
}
34. How to develop your own framework
A broader view on your framework
• Much more things that need to take into account
– Behavior layer
– Caching
• Distributed caching
• Local caching
– Dependency Injection framework
– Internationalization
(enough for today)
34
35. How to develop your own framework
Lessons to learn
• Take your hand dirty please.
• Singleton is bad thing when dependency injection and
unit testing are taken into consideration
– can't replace it with an interface
– Factory allows for both discovery and instance management of
the service providers
– Final classes should keep singleton objects
$dbConn = Pone_Action_Helper_Database::getInstance()->getConnection('oracleweb',
true);
$researchReportDs = ResearchReportDatabaseService::getInstance($dbConn);
$this->researchReports = $researchReportDs->findRecentList($numberOfItems);
35
36. How to develop your own framework
Lessons to learn
• Factory and interface make good things
– Factory and Adapter are good for service providers
$conn = Pone_Database_ConnectionFactory::getConnection($config);
$stmt = $conn->createStatement();
$stmt->addBatch("INSERT INTO test2 VALUES (1007, 'pcdinh1007', 1)");
$stmt->addBatch("INSERT INTO test2 VALUES (1009, 'pcdinh1009', 1)");
$stmt->addBatch("INSERT INTO test2 VALUES (1010, 'pcdinh1010', 1)");
$conn->beginTransaction();
$updateCounts = $stmt->executeBatch();
36
37. How to develop your own framework
Lessons to learn
• Fluent interface/object chaining sometimes is a bad thing
– Law of Demeter
$module = Pone::getContext()->getFront()->getRequest()->getModuleName();
37
38. How to develop your own framework
Lessons to learn
• Don’t think DAO or ActiveRecord, think Domain
Respository
38
39. How to develop your own framework
Lessons to learn
• An interface between Model and Controller must be
defined
– Model class returns an array: bad thing. How to catch errors and
deal with them in the view template
39
40. How to develop your own framework
Lessons to learn
• Dependency Injection
– Does all injection through the constructor
$libBasePath = $basePath.'/libs';
$appBasePath = $basePath.'/apps';
Pone::executeContext(new BenchmarkContext(), $basePath, $appBasePath, $libBasePath);
OR
$front->setRequest(new Pone_Request(new Pone_Request_SimpleUrlParser()));
– Use Template Method design pattern
• Seam
if (session_id() === '' && PHP_SAPI != 'cli')
{
Pone::getContext()->loadSessionUserClass();
$started = session_start(); // PHP 5.3: returns false or true
$this->_started = true;
}
– Use XML/YAML like in Spring, Symfony which is somewhat heavy in an
interpreted language like PHP
40
41. How to develop your own framework
Design by Interface
• Rule: Don’t call me, I will call you
• Template Method
• Convention over configuration
That’s end for today
41
42. How to develop your own framework
Thanks you
• Any question?
42
Editor's Notes
You need to think different. You can not see it in a 1999 manner. Java purist mindsets are obsolete