Practical Web Applications Development

Get Started. It's Free
or sign up with your email address
Practical Web Applications Development by Mind Map: Practical Web Applications Development

1. Preface

1.1. Greeting

1.1.1. Welcome!

1.1.2. Добре дошли!

1.1.3. Καλώς ήρθατε!

1.1.4. Hoşgeldiniz!

1.2. Who am I?

1.2.1. Stoyan Cheresharov :) 15+ years in Web Applications Development E-mail: [email protected] Twitter: @wingman0070 Site:

1.3. Thoughts

1.3.1. We are on this planet to give love and be happy!

1.3.2. We are drops from the same ocean put in different vessels!

1.3.3. The world is inside of us. We are the creators of our life.

1.3.4. "Nothing makes sense, but it is very important to keep doing it!" Mahatma Gandhi

1.4. Live video streaming

1.4.1. On YouTube 9:15 - 12:30 BG time (7:15 - 10:30 GMT) Every Friday Starting January 11, 2013 on Bulgarian 9:15-10:37:30 11:07:30 - 12:30 Links to be added later My Channel

1.4.2. Using Google+ Hangout 9 people online

1.5. Adventure

1.5.1. Web Development is a Beautiful Journey in a Magical Forest! It changes as we go! It becomes more friendly

1.6. Mind Maps

1.6.1. Link to this map

1.6.2. Tony Buzan Answers How to learn and remember. Mind Maps Supermind How to read fast and remember everything I want? ...more

1.6.3. Web Based, Cloud free No presentations No google drive integration Adds free for 3 maps max Works with Google Drive Your own pictures upload Presentations

1.6.4. Popular Free Softwares FreeMind XMind

1.6.5. Tantek Çelik IETF

1.6.6. Use it everywhere Taking notes Planing Presenting Brainstorming ...more

1.6.7. Own cloud

1.7. Inovations

1.7.1. Web Based, Cloud Technologies Mind Maps Presentations Live Streaming Recording Google+ Hangout Cloud Based SDLC

1.7.2. University is to try the cutting edge tehnologies etc.

1.7.3. 21 century education

1.7.4. Everything in this series is new.

1.7.5. We will discover and learn things together.

1.8. Acknowledgments

1.8.1. доц. д-р Гъров Gave me the opportunity

1.8.2. Тодор Величков Inspired me

1.9. Copyrights

1.10. Organization

1.10.1. Introduction

1.10.2. Content

1.10.3. Summary

1.10.4. Q&A

1.11. Hangout on Air

2. 1. Zend Framework. Easy, Simple, Fast!

2.1. Introduction

2.1.1. LAMP Linux Apache web server MySQL PHP

2.1.2. Approaches Computer Installed Portable Cloud Work from anywhere Use any device

2.2. Let's get our hands dirty

2.2.1. Install XAMPP Method A: Installation with the Installer Method B: "Installation" without the Installer 1. Download the zip file 2. Unzip to the portable or local device (e.g. x:\xampp) 3. Check if there is a service running on port 80 4. Skype is usualy causing problems 5. Go to the folder and run "apache_start.bat" 6. Open the browser and type in the URL filed "localhost"

2.2.2. CGI Pearl PHP BAT files C C++ Java + BAT files bat Fortran ...more

2.2.3. ZF1 http://localhost phpinfo Download ZF1 Extract and copy Zend to H:\xampp\php\pear folder Copy zf.bat in /xamp/php Prepare the environment variables create a project create a virtual server H:\xampp\apache\conf\extra\httpd-vhosts.conf

2.2.4. ZF2 Download ZF2 Extract and copy Zend to H:\xampp\php\pear\ZF2 Add to httpd.conf or H:\xampp\apache\conf\extra\httpd-vhosts.conf alternative is to add it to.htaccess ZendSkeletonApplication Click on download as Zip Unzip in the projects folder Create a virtual host H:\xampp\apache\conf\extra\httpd-vhosts.conf Optional Read and follow Tutorial App

2.2.5. ZF2 and modules with composer Install composer SET PATH Make sure SSL is enabled in php.ini cd /xampp/php Install composer Create bath file Make sure composer works Install ZF2 skeleton App Install Alternative Modules Installation DoctrineModule Doctrine ORM or ODM Zfcuser

2.2.6. ZF2 with zftool install zftool with composer Manual zip from github zftool.phar

2.2.7. phpcloud dispaly_errors index.php module.config.php

2.3. Development Stacks

2.3.1. XAMPP No xDebug installed in the latest versions pros Doesn't start with the sstartup cons no Xdebug

2.3.2. WAMP Download Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) WAMP server 2.4 not working on Virtual machine Win XP SP3 512 MB RAM solution is to increase the RAM config is in C:\wamp\bin\apache\Apache2.4.4\conf

2.3.3. easyphp

2.3.4. Zend Server Download Zend Server (PHP 5.4) Zend Server (PHP 5.4) Zend Server Free Edition Zend Server CE Without License or Expired License is CE

2.4. IDEs

2.4.1. Notepad++ Portable Plugins php script engine Autocompletion for PHP DBGP plugin

2.4.2. Eclipse PDT Zend All-in-ones is Portable. Just unzip and use PHP Development Tools All-in-ones download Zend All-in-ones PDT 3.2.0 w/Eclipse Indigo Debuggers Xdebug Zend Debugger Eclipse Downloads pros ZF2 project integrates with Zend Server Creates the sceleton app in the IDE cons for Git SVN we need to install plugins EGit (on top of JGit) for Eclipse WiKi HowTo install it Install HoTo But Not recommended and still need TortoiseGit for SSH

2.4.3. Dreamwaver

2.4.4. Zend Studio

2.4.5. NetBeans PHP and HTML5 Learning Trail NetBeans PHP features Download You need JDK 6 or higher Zend Tutorial App in NetBeans pros Has Git and SVN cons ZF2 is not supported yet (but could be done trough ZF.bat) SSH git Generating an SSH Key Generating And Using RSA key on Windows RentAFlat ZF1 tutorial app There is a Readme.html in the root of the project

2.4.6. Microsoft Notepad

2.4.7. Apple TextMate

2.4.8. Linux vi

2.4.9. Sublimetext

2.4.10. Aptana Studio

2.4.11. Linux vim

2.4.12. phpDesigner

2.4.13. JetBrains PHPStorm phpStorm It's bit pricey though, unfortunately

2.4.14. ActiveState Komod

2.4.15. PHPEdit

2.4.16. RapidPHP

2.4.17. RadPHP (formerly Delphi for PHP)

2.4.18. OpenKomodo

2.4.19. Comparison Seven great PHP IDEs compared List in WiKi

2.5. Debuggers

2.5.1. Zend Debugger proprietary protocol

2.5.2. XDebug DBGP protocol Remote Debugging Profiling Outputs cachegrind compatible file Clients Clients Xdebug extensions for web browsers Start a session

2.6. Repositories (SCM, VCS)

2.6.1. Distributed Git Linus Torvalds Implementations Version Control Hosting Services RSA key pairs for git (Installing SSH keys on Windows) Configuration (Setting up Git profile) Mercurial Bazaar

2.6.2. Central server SVN (Subversion) CVS

2.7. Cloud

2.7.1. Virtualization + web services hypervisor

2.7.2. Categories by what they offer IaaS AWS PaaS CloudBees CloudFoundry Appfog Heroku OpenShift Google App Engine Elastic Beans Talk Microsoft Azure SaaS Zoho

2.7.3. Categories by location Private Public Hybrid

2.8. Cloud Approaches

2.8.1. IDE Native apps Web based (Cloud, HTML5) Requrments Will detach us from the device

2.8.2. VMware Zend Image We control it

2.8.3. VNC VPN I have to install native apps

2.8.4. Web Desktop, Web (Browser) OS Lucid (Dojo) ExtTop

2.8.5. HTML5 CSS3 HTML5 JS (ES5) Alternatives???

2.9. Cloud Development Stacks

2.9.1. Managing your SSH keys PEM RSA keypair PPK RSA keypair Connecting via Git Connecting via SFTP WinSCP Setting up the Debugger starting the debugger Connecting to the Database tools OpenSSH WinSCP PuTTy Git MySQL IDEs Browser Plugins XDebug


2.10. Cloud IDEs

2.10.1. Cloud 9 What it is according to Wikipedia? Public code repositories GitHub BitBucket Works with Mercurial repositories Git repositories FTP servers Support for deployment (PaaS) Heroku Joyent Windows Azure Features OpenId GitHub BitBucket Chrome app Cloud 9 NOT FREE Only 1 RSA key pair Can not export the private key you can not use PuTTy or WinSCP at the same time with Cloud 9 Can not import RSA key pair HAS A TERMINAL WINDOW (console) Big plus

2.10.2. Codenvy (former Exo IDE) What it is according to Wikipedia? No info on first search page Public code repositories GitHub Google ??? Support for deployment (PaaS) Amazon Web Services appfog CloudBees CloudFoundry Google App Engine Heroku OpenShift OpenId GitHub Google Mobile native Apps iPad iPhone Android Chrome app Cloud IDE Doesn't support node.js

2.10.3. Installed on your own server

2.10.4. How to OSS github Exo IDE Cloud9 bitbucket

2.11. Cloud free public repositories (hosting code)



2.11.3. What is GitHub according to Wikipedia Main Features forking pull request merge U can use it without web interface It has Issue Tracker WiKi

2.11.4. Issue Tracker Jira

2.12. Summary

2.13. Q&A

2.14. Cloud Step By Step Tutorial

2.14.1. Exo IDE Create New OSS project 1. Create an account on GitHub 2. (Optional) Create an account on Exo IDE 3. Create an account on AppFog 4. Login to Exo IDE 5. Choose PaaS 6. Create a Project 7. (Optional) Delete the files and folders in the new project 8. (Optional) Create your own files and folders sutable for the project 9. Do "git init" 10. Create a repository in GitHub 11. Add Remote Repository (github) 12. Generate RSA key pair in Exo IDE 13. Add the generated public key to github 14. In Exo IDE do "git add ."; "git commit -m "My first commit""; "git push <reponame> master" Contribute to an OSS project 1. Create an account on GitHub 2. (Optional) Create an account on Exo IDE 3. Create an account on AppFog 4. Login to Exo IDE 5. Choose PaaS 6. Create a Project 7. (Optional) Delete the files and folders in the new project 8. (Optional) Create your own files and folders sutable for the project 9. Do "git init" 10. Add Remote Repository (github) To the project in Exo IDE 11. Generate RSA key pair in Exo IDE 12. Add the generated public key to github 13. Fork the existing project 14. In Exo IDE do "git pull"

2.15. git (DSCM, VCS)

2.15.1. git init

2.15.2. git clone ssh://[email protected]/gitprojects/fmi.git

2.15.3. git remote add zend ssh://[email protected]/gitprojects/fmi.git

2.15.4. git remote

2.15.5. git remote rm zend

2.15.6. git branch git branch iss53 git checkout iss53 git commit -a -m 'added a new footer [issue 53]' git branch -d hotfix $ git branch -r Remote tracking branches

2.15.7. git branch mybranch

2.15.8. git rm

2.15.9. git fetch zend

2.15.10. git merge zend/master

2.15.11. .gitignore git rm --cached filename

2.15.12. git push origin master

2.15.13. git pull origin master

2.15.14. git checkout zend/mybranch

2.15.15. git add index.php (. to add all files)

2.15.16. git add <folder>/*

2.15.17. git commit -m "My first commit"

2.15.18. git --version

2.15.19. Zend help git --version git clone <git repo URL> $ GIT_SSL_NO_VERIFY=1 git clone <git repo URL> .git/configfile [http] postBuffer = 524288000 $ git add index.php$ git commit -m "Adding index.php" $ git push origin master Pushing an Existing Git Project into Zend Developer Cloud Platform $ git remote add zendcloud <git repository URL> $ git pull zendcloud master $ git push zendcloud master

2.15.20. Oficial Git tutorial $ git config --global "Your Name Comes Here" $ git config --global [email protected]

2.16. Cloud Design


2.17. tools, frameworks, distribution systems (networks), repositories

2.17.1. PEAR

2.17.2. PECL

2.17.3. Pyrus

2.17.4. Composer

2.17.5. Phar extension

2.17.6. ZF2 Modules


2.18. Deployment to AppFog

2.18.1. .htaccess root public all other folders

2.18.2. vendor ZF2 library

2.18.3. .gitignore public vendor first you have to remove the file do git remove <filename> After the removal the ignore will take place Note: you can not ignore existing files without first deleting them

2.18.4. Services MySQL local.php install phpMyAdmin phpMyAdmin Bind your PhpMyAdmin app to the MySQL service PMA_PASSWORD use your username for AppFog

2.18.5. Custom DNS Free public DNS Free DNS hosting Cloud DNS hosting

2.18.6. public/index.php

2.18.7. autoload file in vendor

2.19. phpunit

2.19.1. Installation PEAR Composer PHP Archive (PHAR) Optional packages Upgrading

2.20. ZF2 cheatsheet

2.21. PSR-0 (Pretty Standard, Really)

2.22. Getting Started with composer packages

2.23. PHPspc

2.24. Behat

2.25. Red Mind

2.26. HTML5, CSS3, JS IDEs

2.27. Continuous integration

2.28. The best Server IDE combinations

2.28.1. Zend EclipsePDT Zend Server (Zend Debugger) EGit extra installed SSH? trough PuTTY

2.28.2. NetBeans XAMPP Install Xdebug WAMP Comes with Xdebug Why doesn't work Comes with Git SSH? HoTo 1 Download and install Git 2* (Optional) Generate RSA key pairs 3* (Optional) Enter the public key in your bitbucket account 4 Download and install WAMP 5 add to PATH 6 Enable SSL in PHP manualy 7 Install composer 8 Virtual host 9 NetBeans

2.28.3. Minimalistic approach Git (MSYS) ssh-keygen -t rsa XAMPP, WAMP or Zend Server Add to Path vhost with ports vhost subdomain IMPORTANT NOTES for vhosts composer In the PATH get composer.phar create a bath file IMPORTANT NOTES (espacialy for WAMP) Notepad++

2.29. PPI framework Skeleton Application

2.30. ZfcUser, BjyAuthorize and Doctrine working together

2.30.1. How to start a project?

2.31. Naming coding standards

2.32. ZendTool

2.32.1. GitHub

2.32.2. separate from ZF2 project

2.32.3. Documentation

2.32.4. Installation Composer Move the folder to vendor Sugested changes Manual Without installation, using the PHAR file I have created zf.bat in the same folder as zftool.phar

2.32.5. Doesn't create composer.phar in the root of the project

3. 2. MVC. Model View Controller.

3.1. HTML5 kingdom

3.1.1. HTML5 the king and knight HTML - HyperText Markup Language History History of HTML5 2004 tags block inline What is new in HTML5 The <canvas> element for 2D drawing The <video> and <audio> elements for media playback Support for local storage New content-specific elements, like <article>, <footer>, <header>, <nav>, <section><aside> New form controls, like calendar, date, time, email, url, search Browser Support for HTML5 HTML5 is not yet an official standard W3C Structure some structural HTML5 tags drawing

3.1.2. CSS3 the tailor structure and visualisation separation W3C Position External Internal Selectors Properties (style attributes ) Pseudo-classes Pseudo elements CSS for DHTML position top, left bottom, right width, height z-index display visibility clip overflow margin, border, padding background opacity CSS Box model Internet Explorer quirks Our CSS Main file Layout Typography Navigation

3.1.3. JavaScript (ES5) the wizard Embedding Scripts in HTML The <script> Tag Scripts in External Files

3.1.4. To conquer all natives

3.1.5. Progressive Enhancement vs Graceful Degradation

3.1.6. The all cool things in the web

3.1.7. ULITA Usability Localisation (l10n) Internationalization (i18n) Translation Accessability

3.2. PHP

3.2.1. "Hello World"

3.2.2. ";" at the end of the statement

3.2.3. Variables start with "$" a-z A-Z 0-9 _ don't start with number

3.2.4. Loosely Typed (dynamic) vs Stricktly Typed (Static)

3.2.5. Types Numeric float int Boolean true false String

3.2.6. functions

3.2.7. PHP Arrays

3.2.8. PHP is from the syntax group of the C languages

3.2.9. Operators

3.2.10. Statements if if else switch

3.2.11. while

3.2.12. do-while

3.2.13. for

3.2.14. $_GET

3.2.15. $_POST

3.2.16. constants

3.2.17. some magic constants __FILE__ __DIR__ __METHOD__ __CLASS__

3.2.18. some predefined constants DIRECTORY_SEPARATOR PATH_SEPARATOR

3.2.19. some predefined superglobal variables $_SERVER $_COOKIE setcookie('name', 'value', time() + 3600, "/", "", 0) $_SESSION session_start();

3.2.20. 1000+ functions header($header, $replace, $response_code) OSI Model ob_start(); ob_flush()

3.3. OOP - Object Oriented Programing

3.3.1. Features Inheritance Abstraction Encapsulation Polymorphism example

3.3.2. Goal Reuse Arhitecture (Structure) The cost of change vs hacking 1 more level of abstraction system programming usualy NO OOP computer doesn care Agile Software Development (Extreme programming) Continuous Integration (OOP) Refactoring Test Driven Development Everyone can write code which the computer can understand, but not everyone can write a code that othe human can understand. Is it the Holy Grail? NO. We continue searching and discovering

3.3.3. Topics Class Blueprint Constructor Destructor Methods Properties Object Instance of a class Methods Member functions Access Parent Class parent:: Properties Member variables Scope private protected public Constants Static Methods Properties for access :: $this not available (use self) has scope Abstract Class Must have at least 1 abstarct method No direct instance No abstract properties Interface Determen the methods Can implement multiple interfaces interface - keyword implements - keyword methods makes sure there are well know methods comming from the interface Overriding Overloading Magical methods Autoload Since PHP 5.2 spl_autoload_register() Namespaces Since PHP 5.3 basics use Anonymous (Lambda) functions and Closures SInce 5.3 callback parameters variable assignment Closure favor object composition over inheritance inheritance composition Interfaces

3.3.4. Letter to a student (personal)

3.4. Design Patterns

3.4.1. Christopher Alexander architect first created the term

3.4.2. Gang Of Four - Design Patterns, Elements Of Reusable Object Oriented Software Creational Patterns Abstract Factory Builder Factory Method Prototype Singleton Structural Patterns Adapter Bridge Composite Decorator Façade Flyweight Proxy Behavioral Patterns Chain of Responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template Method Visitor

3.4.3. Patterns of Enterprise Application Architecture Domain Logic Patterns Transaction Script Domain Model Table Module Service Layer Data Source Architectural Patterns Table Data Gateway Row Data Gateway Active Record Data Mapper Object-Relational Behavioral Patterns Unit of Work Identity Map Lazy Load Object-Relational Structural Patterns Identity Field Foreign Key Mapping Association Table Mapping Dependent Mapping Embedded Value Serialized LOB Single Table Inheritance Class Table Inheritance Concrete Table Inheritance Inheritance Mappers Object-Relational Metadata Mapping Patterns Metadata Mapping Query Object Repository Web Presentation Patterns Model View Controller Page Controller Front Controller Template View Transform View Two-Step View Application Controller Distribution Patterns Remote Facade Data Transfer Object Offline Concurrency Patterns Optimistic Offline Lock Pessimistic Offline Lock Coarse Grained Lock Implicit Lock Session State Patterns Client Session State Server Session State Database Session State Base Patterns Gateway Mapper Layer Supertype Separated Interface Registry Value Object Money Special Case Plugin Service Stub Record Set

3.5. Zend Framework 2

3.5.1. Building a module Modules Setting up the Album module Configuration Informing the application about our new module Routing and controllers module.config.php AlbumController.php Initialise the view scripts Database connect Models model classes represent each entity in your application ORM Forms and actions gitignore

3.6. We don't have to know the entire technology in details to start working

3.6.1. Know just enough to get the job done

3.6.2. Use google

4. 3. Forms.

4.1. ZF2 sources of knowledge

4.1.1. IRC: #zftalk (#zftalk.2 - closed) on Freenode Webchat

4.1.2. Maillist Subscribe Browse Archive

4.1.3. Webinars (old) Doctrine2 ZF1

4.1.4. Blogs Enrico Zimuel Matthew Weier O'Phinney Rob Allen Ralph Schindler Ryan Mauger github Evan Coury

4.1.5. Official site About Overview FAQ (ZF2 FAQ) ZF1 FAQ Security Changelog Blog New BSD License Learn User Guide Reference Guide APIs Training & Certification Support & Consulting Get Started Downloads Get the Skeleton App Try on Participate Overview Contributors Guide Blogs Contact Us form mailing lists IRC

4.1.6. Zend Framework 2 Getting started Reference Guide API

4.1.7. skeleton app Welcome to Zend Framework 2 ZF2 Skeleton Application Fork Zend Framework 2 on GitHub » Follow Development wiki dev blog issue tracker ZF2 Development Portal Discover Modules on GitHub Explore ZF2 Modules »(web site) Help & Support IRC: #zftalk (#zftalk.2 - closed) on Freenode mailing lists Ping us on IRC »

4.1.8. How to use ZF1 libraries in ZF2

4.1.9. Wiki

4.1.10. ? Thorsten Ruf's ZF1(zenddispatch_en.pdf) ?

4.1.11. ? Dispatch ZF2 Diagram ?

4.1.12. ? Front Controller Dispatch Process ?

4.1.13. Dispatch ZF2 correct link

4.1.14. Zend Framework 2 Cheat Sheet

4.1.15. ZF2 Patterns

4.1.16. Event Manager Triggered: Zend Framework 2's EventManager Event Listener Event Manager (Connection Bus) Priority how to trigger Listeners Custom Events Recomendations Global Events some terms other terms

4.1.17. Service Manager ("object manager” or “instance manager”)

4.1.18. The MVC architecture of ZF2 New architecture MVC Di Events Service Module PSR-2 compliant packaging system pyrus composer PHP 5.3.5 Performace Improvments Lazy Loading The new core ZF1 ZF2 MVC separation of concern code reusability Event Driven Architecture bootstrap root dispatch A common workflow Default services EventManager ModuleManager Request Response RouteListener Router DispatchListener VIewManager config/application.config.php public/.htaccess The front controller is index.php public/index.php Zend\ServiceManager IS A SL (SERVICE LOCATOR) implementation Well known object in which you can register object and retrieve them later Driven by configuration Type of services Explicit Invocables Factories Aliases Abstract Factories Scoped Containers Shared modules inform the MVC about services and event listeners subset of the app Modules are simply module/Application/Module.php module/Application/config/module.config.php module/Application/src/Application/Controller/IndexController.php

4.1.19. ZF 2, Doctrine 2 Using Doctrine 2 in Zend Framework 2 Install Doctrine 2 on ZF2 Doctrine 2 ORM Module for Zend Framework 2 github Tutorial github

4.1.20. Composer - Dependency Management for PHP on github Official site Install in php folder Make sure SSL enabled in PHP Make it global use Create Project Require Module Manualy Add a Module Don't forget to add the modules to application.config.php Autoloading require 'vendor/autoload.php';

4.1.21. Do we need framework at all???

4.1.22. Some tips to write better Zend Framework 2 modules On Russian

4.2. ZF2 Di Theory

4.2.1. Strong Cohesion

4.2.2. Loosly Coupling Decoupling

4.2.3. Reuse

4.2.4. Cost of change

4.2.5. IoC Inversion of Control ( concep) Inversion of Control Containers and the Dependency Injection pattern Components and Services A Naive Example Inversion of Control Forms of Dependency Injection Using a Service Locator Deciding which option to use Some further issues Concluding Thoughts

4.2.6. Di - Dependancy Injection (pattern) Constructor Injection pros cons Setter Injection pros cons Interface injection "Aware" cons DiC Dependancy Injection Container (tool) sources of information webinar Documentation on the site

4.2.7. Service Locator (pattern) alternative for Di (SL) Service Locator !== (DiC) Dependancy injection Container But DiC == SL DiC can be the foundation of consumed for Service Location cons SL becomes a dependancy pros Not all code paths may use all dependancies

4.2.8. Zend\Di (DiC implementation) Not a requirment supprot for both constructor setter Not "Hello World" friendly

4.2.9. Type-hints

4.3. Event Manager

4.3.1. Space Station Modules Consists by independent modules Each module is build from a group of smaller modules following the same pattern The smaller modules are build from even smaller modules following the same pattern etc. Each module can trigger an event There are maybe modules listening on this channel (for this event) or maybe not Each module can listen for an event But there are maybe modules emitting (notifying) about this event or not

4.3.2. Electronic Circuits Phisical Interfaces Logical Electrical Phisical

4.3.3. Event Something that does happen

4.3.4. Listener a callback responds to an event

4.3.5. Event Manager (how to attach a callback listener) a collection of Listeners triggers events

4.3.6. Priority

4.3.7. how to trigger

4.3.8. Listeners Receive a single argument ($e) Any PHP callback

4.3.9. Recomendations __FUNCTION__ dot-notation pass all input as a parameter

4.3.10. Global Events

4.3.11. some terms trigger/attach public/subscribe notify/listen

4.3.12. more terms target context

4.3.13. associations Environment for signals Wires Channels Connection Bus

4.4. MVC architecutre of ZF2

4.5. Bridge the domain Model and the View layer

4.5.1. spread across Controller Model View list = index

4.5.2. Terms Hydration Extraction

4.5.3. The bond $form->bind($model) Make the bond Fly in the Clouds

4.5.4. Zend Hydrators Zend\Stdlib\Hydrator\ArraySerializable Zend\Stdlib\Hydrator\ClassMethods Zend\Stdlib\Hydrator\ObjectProperty HydratorInterface

4.5.5. Look the "Album" tutorial app

4.5.6. Annotation to unite

5. 4. ORM. Object Relational Mapping.

5.1. Doctrine 2

5.1.1. What is Doctrine?

5.1.2. What are Entities?

5.1.3. Doctrine 2 Working with Associations

5.1.4. Doctrine configuration

5.1.5. EntityManager The main access point

5.1.6. Association Mapping

5.1.7. Getting Started

5.1.8. new Zend Form features explained

5.1.9. Hydrator

5.1.10. Notes on Doctrine 2

5.1.11. Doctrine ZF2 Lection

5.2. Propel

5.3. No SQL DB (ODM)

5.3.1. Mongo DB

5.3.2. Apache CouchDB

5.4. "What is first, the chicken or the egg?"

5.4.1. First build the DB as a result of the system analysis? If you don't know the programming language framework etc. The ORM has tools for reverse engineering to build the classes from DB.

5.4.2. First build the domain logic with classes (Entities) as a result of the system analysis. If you are going to use OOP If you are planning to use ORM If the ORM has tools for creating DB Always keep in mind the DB at the back of your head If you don't know what DB are you going to use'

5.5. Composer is used for the modules (Doctrine)

5.5.1. Cloud 9 offers console but you have to pay

5.5.2. I would prefer to install development stack on a local machine XAMPP Composer

5.6. Local workflow

5.6.1. Start Notepad++

5.6.2. Start Git console Clone the repo

5.6.3. /xampp/apache_start.bat

5.6.4. /xampp/mysql_start.bat

5.6.5. Console for MySQL

5.6.6. Start MongoDB shutdown The 32 bit version works on 46 bit WIn7 64 bit allocates about 4GB disk space

5.6.7. Console for MongoDB show databases = show dbs tables = collections rows = documents

5.6.8. Console for composer Install ONLY ZF2 Install ONLY DoctrineORM Install ONLY DoctrineODM Install the Doctrine modules for ZF2 DoctrineModule DoctrineORM Module DoctrineODM Module

5.6.9. Allow the modules and setup the connections etc. DoctrineORM add DoctrineModule and DoctrineORMModule to your config/application.config.php create directory data/DoctrineORMModule/Proxy module.config.php or application.config.php /config/autoload/ Registered Service names Command Line Service Locator DoctrineODM my/project/directory/configs/application.config.php config/autoload/module.doctrine-mongo-odm.local.php create directory my/project/directory/data/DoctrineMongoODMModule/Proxy create directory my/project/directory/data/DoctrineMongoODMModule/Hydrator Command Line Service Locator

5.6.10. Console for Doctrine DoctrineORM Commands you need cli-config.php and bootstrap DoctrineODM Commands you need cli-config.php and bootstrap Reverse engineer the DB Create the bootstrap.php in your project Create cli-config.php Create the mappings Generate the entities CLI with the ZF2 module doctrine-module.bat no bootsrap and cli-config neccessary update create drop and create

5.6.11. Apache Virtual Host .htaccess local.php

5.6.12. links to the projects and initial installation xampp MongoDB Download Install and run on Windows Composer Getting Started Install Doctrine Zend Framework doc Zend Modules DoctrineModule on github DoctrineORMModule on github DoctrineMongoODMModule on github php_intl tinyMCE in the view script jQuery Date/Time Entry in the view script Dojo, dijit/form/DateTextBox Themes and Theming dijit/form/DateTextBox in the view script

5.6.13. Module.php module.config.php

6. 5. CRUD. Create Retrieve Update Delete.

6.1. WInSCP (native app) for the sensitive files

6.2. With Cloud 9

6.2.1. Only Git

6.2.2. No access to the private key No other app can be used

6.2.3. Only Git tricks but very complex Branch public Branch production Merging is a problem???

6.3. Codenvy

6.3.1. The solution for the sensitive files

6.4. Creating new Controller in Application

6.4.1. branch exp1

6.4.2. module.config.php controllers invokables

6.4.3. view optional

6.5. Set MIME type

6.5.1. application/php

6.6. branches

6.6.1. will be more dificult

6.7. approaches

6.7.1. MySQL, Oracle, PostgreSQL etc. API MySQL Functions mysql_connect

6.7.2. DBAL: ADOdb, PDO PDO PDO Drivers ADOdb ADOdb Active Record Dealing with Collections Zend\Db\Adapter thin wrapper Doctrine DBAL thin wrapper of PDO

6.7.3. Zend\Adapter, Doctrine DBAL Doctrine DBAL over PDO Zend DBAL Zend\Db\Adapter

6.7.4. ORM technics Design Patterns Table Data Gateway Row data Gateway Active Record Data Mapper

6.8. The progress in ZF2

6.8.1. Simple CRUD (with Table Data Gateway) The Result Set is a Collection of Objects (each row is an object) The ResultSet is Zend\Db\ResultSet\ResultSet. Each row is an Zend\Db\RowGateway\RowGateway Object. Zend\Db\TableGateway\Feature\RowGatewayFeature('usr_id') in Table Data Gateway Return Custom Object The Result Set is an Zend\Db\ResultSet\ResultSet of ArrayObjects. Each row is an ArrayObject. The ArrayObject can be used as an ordinar array or as an object. $row->usr_id and $row['usr_id'] will both work

6.8.2. Integrate Doctrine wirh ZF2 Doctrine DBAL almost the same like Zend\Db\Adapter\Adapter Doctrine Entity Manager With separate classes and files for forms and DQL in the controller We use annotations to generate forms from the entities Entity Repositories

6.9. The evolution

6.9.1. 1) native DB API set of functions and variables difficult to replace

6.9.2. 2) Abstract the connection to DB DBAL OOP. We delegate the communication to DB to an object. We create the SQL statments Easy to replace the RDBMS by changing the Object But we still deal with concrete tables (we have to know the names structure etc.) and we use SQL statements

6.9.3. 3) Abstract the tables - objects in the DB We can change the tables and still be OK Table Data Gateway but we deal with functions which have nothing to do with our domain logic CRUD and we have to know the structure of the DB

6.9.4. 4) Abstract the rows (they better represent the real entities of our domain logic) Row Data Gateway

6.9.5. 5) Add domain logic to these Row Objects. Think for them as Domain Objects. (e.g. teach Object User to tell his name. add tellYourName(), greating etc..) We still think about technical details. We are not detached from the concrete implementation. We have our domain logic in the DB not in the App

6.9.6. 6) Forget about the DB. Create a Domain model using Entities. Network of objects - virtual DB. Data mapper. Persisting is not a concern for this object. We don't need methods like save delete etc. We have ONLY the properties-characteristics of the object and accessory methods to set and get values to the properties. In the perfect world we will not need to save anything to persistent layer. The SSD drives will become the RAM of the computer. Even if you turn your computer off the running programs will keep their state until we decide to exit or close the program.

6.9.7. 7) Forget about the DB. Use a dedicated Data Mapper like Doctrine. We don't have to create the datamapper objects anymore for each table There is Doctirne Entity Manager (ORM) or Doctrine DOcumentManager (ODM) Network of objects. Virtual Data Base

7. 6. JS basics.

7.1. sources of knowledge

7.1.1. David Flanagan JavaScript: The Definitive Guide, Sixth Edition jQuery Pocket Reference JavaScript Pocket Reference, 3rd Edition

7.1.2. Douglas Crockford JavaScript: The Good Parts

7.1.3. Nicholas C. Zakas High Performance JavaScript (Build Faster Web Application Interfaces)

7.1.4. Stoyan Stefanov JavaScript Patterns Object-Oriented Java Script

7.1.5. John Resig Manning: Secrets of the JavaScript Ninja

7.1.6. YUI Theater

7.2. Development

7.2.1. Prototype based

7.2.2. Classless

7.2.3. Object Oriented

7.2.4. Event Driven

7.3. Getting Started Example

7.4. Functions

7.4.1. First Class Objects A function is an instance of the Object type A function can have properties and has a link back to its constructor method You can store the function in a variable You can pass the function as a parameter to another function You can return the function from a function

7.4.2. Example

7.4.3. definitions functions defined with the function statement function defined with literal expression With the Function class

7.4.4. Universal Properties and Methods Properties myNewClass.length myNewClass.prototype Methods{}, 'arg1', 'arg2') myNewClass.apply({}, ['arg1', 'arg2'])

7.4.5. Operators typeof myNewClass myNewClass instanceof Function

7.4.6. Functions methods and Constructors Function Constructor Method

7.5. Objects

7.5.1. Create Created as Literal (Expression) Created with one of the Standart Classes "Object Class" Created with a Constructor that defines a Class of Objects (custom class)

7.5.2. Universal Properties and Methods Properties myObject.constructor Methods myObject.toString() myObject.toLocaleString() myObject.valueOf() myObject.hasOwnProperty('prop1') myObject.propertyIsEnumerable('prop1') Object.isPrototypeOf( myObject )

7.5.3. Operators typeof myObject myObject instanceof myClass

7.6. Programming Styles

7.6.1. Pseudoclasical technique

7.6.2. Prototypal style

7.6.3. Functional style

7.7. Ajax

7.7.1. DOM Manipulation

7.7.2. Remouting

7.7.3. Dynamic Behaviour

7.8. Example 1

7.9. Example 2

7.10. Architecture of an app

7.10.1. Leave if you don't like it I am always amazed by the negative people! You have to appreciate at least the effort. If you have to say something bad, better don't say anything Create somethign yourself. Don't criticise! We live in a free country! Everybody can be stupid and ugly as he likes! :) I have a great lifestyle! I am happy and thankful! The fact that somebody doesn't like the ideas, is not going to change the fact I enjoy my life and what I am doing! These are my original ideas Maybe somebody else came up with the same ideas Usually the same ideas come to more than one person when the moment is suitable! The truth and the ideas are always there the people are just the conductors. I am not asking anybody to watch the videos. If I am the only viewer I still will be happy. they will help me to recall some ideas and concepts. I am doing these videos for myself, my friends, colleagues and students.

7.10.2. lets mimic the real objects and systems Nature Plant Human Technical systems (They to mimic the nature) Space Station Motherboard

7.10.3. Everythign starts from a seed Config is the DNA Events (communication object) gives the senses Bootstrap is not really a paradox What is first? The chick or the egg? What is first the program or the computer? Is it a real paradox? it would be a paradox if it is like Baron von Munchausen pulling himself from the swamp. Bootstrapping Wizard In the case of JS the wizard is (HTML tag) The MVC comes later

8. 7. JS toolkits. (frameworks???)

8.1. Dojo Toolkit

8.1.1. Dijit

8.1.2. Getting Dojo Downloading an official release Downloading from Subversion CDN

8.1.3. Hello Dojo

8.1.4. Modern Dojo Migration Guide require() define() module IDs (MID) AMD

8.1.5. Dojo Base and Core

8.1.6. Events and Advice

8.1.7. DOM Manipulation

8.1.8. Waiting for the DOM

8.1.9. Adding Visual Effects

8.1.10. Dijit and Widgets

8.1.11. XHR

8.1.12. Ajax

8.2. jQuery

8.2.1. fluent interfaces and method chaining

8.2.2. An expressive syntax (CSS selectors) for referring to elements in the document

8.2.3. intro

8.2.4. jQuery Basics The jQuery library defines a single global function named jQuery(). $ as a shortcut for it This single global function with two names is the central query function for jQuery. var divs = $("div"); jQuery() is a factory function rather than a constructor: it returns a newly created object but is not used with the new keyword. $("p.details").css("background-color", "yellow").show("fast"); method chaining idiom is common in jQuery programming $(".clicktohide").click(function() { $(this).slideUp("slow"); }); Obtaining jQuery download CDN (Content Distribution Network) The jQuery() Function $() is to pass a CSS selector The second way to invoke $() is to pass it an Element or Document or Window object The third way to invoke $() is to pass it a string of HTML text Finally, the fourth way to invoke $() is to pass a function to it. If you do this, the function you pass will be invoked when the document has been loaded and the DOM is ready to be manipulated. The jQuery library also uses the jQuery() function as its namespace Queries and Query Results $("body").length

8.2.5. jQuery Getters and Setters Getting and Setting HTML Attributes $("#icon").attr("src", "icon.gif"); set $("form").attr("action"); get Getting and Setting CSS Attributes $("h1").css("font-weight"); get $("div.note").css("border", compound styles "solid black 2px"); set Getting and Setting CSS Classes $("h1").addClass("hilite"); Getting and Setting HTML Form Values $("#surname").val(); get $("#email").val("Invalid email address"); set Getting and Setting Element Content text() html() Getting and Setting Element Geometry Getting and Setting Element Data

8.2.6. Altering Document Structure Inserting and Replacing Elements Copying Elements Wrapping Elements Deleting Elements empty() removes all children (including text nodes) The remove() method removes any event handlers the unwrap()

8.2.7. Handling Events with jQuery Simple Event Handler Registration jQuery Event Handlers The jQuery Event Object Advanced Event Handler Registration $('p').bind('click', f); Deregistering Event Handlers unbind() Triggering Events Custom Events Live Events

8.2.8. Animated Effects Simple Effects fadeIn(), fadeOut(), fadeTo() show(), hide(), toggle() slideDown(), slideUp(), slideToggle() Custom Animations

8.2.9. Ajax with jQuery The load() Method

8.2.10. Utility Functions

8.2.11. Extending jQuery with Plug-ins

8.2.12. The jQuery UI Library widgets

8.3. Prototype


8.4. MooTools

8.5. YUI Library

8.6. Ext JS

8.6.1. Very Good Documentation

8.6.2. JSDuck

8.7. Backbone.js

8.8. Server Side JS

8.8.1. node.js

8.9. AngularJS by Google

8.9.1. on GitHub

8.9.2. MVW

8.10. Twitter Bootstrap

8.10.1. on GitHub

9. 8. JS Zend integration.

9.1. Create a Layout

9.1.1. get the links right

9.1.2. add to your module

9.1.3. Use the View Helpers Doctype Helper HeadLink Helper HeadMeta Helper HeadScript Helper HeadStyle Helper HeadTitle Helper HTML Object Helpers InlineScript Helper

9.1.4. Use existing template example

9.1.5. layout.phtml

9.1.6. change.phtml

9.2. Switch the Layout in the actions

9.3. Load different JS files in the view

9.4. Use widgets (Dojo, jQuery)

9.4.1. jQuery

9.4.2. Dijit js file

9.5. View Helper Json

9.6. Disabling the layout in Zend Framework 2

9.7. Disable the layout and the view

9.8. Communicate to the server (ZF2)

9.8.1. Only with JS

9.8.2. jQuery way

9.8.3. Dojo way example

9.9. Deploy to AppFog

9.10. Change the layout for a module

9.11. index.php

10. 9. Ajax.

10.1. Pure JS

10.1.1. Controller Action

10.1.2. View Script js-ajax.phtml

10.1.3. JS File jsAjax.js

10.2. jQuery

10.2.1. Controller Action

10.2.2. View Script jquery-ajax.phtml

10.2.3. JS File jqueryAjax.js

10.3. Dojo

10.3.1. Controller Action

10.3.2. View Script dojo-ajax.phtml

10.3.3. JS File

10.4. Service

10.4.1. View Script

10.4.2. Controller Action

10.5. JSON service

10.5.1. Controller Action

10.5.2. View Script

11. 10. HTML5 CSS3.

12. Introduction

12.1. What is a Web Development?

12.2. What is the Web Application Development?

12.3. Web Application

12.4. Software engineering

12.4.1. Could be the best job in the world! No boss! No working hours. Full creative freedom! You are an ... alien!

12.4.2. Why some people think "The cariera in IT sucks?" Average salary in the developed countries. A lot of work Age and sex discrimination There are no "old experience professionals" Everyone is a newbie How can be "old experience professional" in a 6 months old technology You never stop reading and learning

12.4.3. We have to raise the prestige of the profession.

12.4.4. Nothing can stop you if you have a real passion and fun!

12.5. The topics

12.5.1. Server-side (The first 5 Fridays) PHP ZF

12.5.2. Client-side (The last 5 Firdays) Front End Engineering JavaScript HTML CSS

12.6. I hold the rights to change the topics as we go.

12.7. Used tools

12.7.1. Web Based, Cloud

12.7.2. The students can change the devices

13. Lessons Learned

13.1. MInd Maps

13.1.1. MindMesiter Presentations Difficult Do I realy need them Tip Upload Images The Android App Not free Notes are very small Try bigger font size Use zoom In Out Right Click to collapse expand nodes

13.1.2. MInd42 Free Android 2.2 Stock Browser

13.1.3. Google Presentations Try the combination

13.2. Google+ Hangout

13.2.1. No background noise

13.2.2. Sound Breaking

13.2.3. No zoom

13.2.4. Ask Somebody to watch the live stream

13.3. Speach

13.3.1. Don't use often "In general" "Общо взето..." "etc." "така нататък"

13.3.2. use acurate words pay attention to the details the right words and terms

13.3.3. replace "I don't know" with "We will check"

13.4. Other technologies for recording

13.4.1. Try Adobe Flash Media Live Encoder

13.4.2. screencast-o-matic Doesn't even start in FF and Chrome Java updates done

13.5. YouTube

13.5.1. Create playlists

13.6. Use HD, at least 720p

13.7. Use screen resolution of 1280x720p for YouTbe HD

13.7.1. Use 1280x1024 top and render at the same resolution in Camtasia. YouTube is not cutting anything 1280x1024 is also OK YouTube is filling the right and left with black Renderin at 1280x1024 is much slower compare to 1280x720

13.7.2. Camtasia cuts top and the bottom to fit in 1280x720

13.7.3. Resolution 1280x720 doesn't work on my screen 4:3. Everythign is distorted.

13.8. codenvy was giving me [ERROR] on git push zend but no changes have been made

13.9. Codenvy

13.9.1. consol - very limited

13.9.2. I can upload RAS private key

13.9.3. No SFTP client

13.10. git

13.10.1. problems the way we use it

13.10.2. idea git rm . still doesn't work clone in codenvy instead of doing init use patch and diff at the bottom ofthe pull requests try to use clone in the IDE instead of new project merge manualy with patches (no fetch merge) Don't use the original for anything else

13.10.3. check the diffs and the changes before merging

13.11. Cloud 9

13.11.1. NO way to upload RSA private key

13.11.2. Very nice consol

13.11.3. You can run your pages there

13.11.4. No SFTP client

13.12. Maybe we don't need AppFog for the students

13.13. pay atention

13.13.1. <?php echo $this->basePath(); ?>/

13.13.2. css, js, images in public

13.13.3. ActionNames mmLayoutAction mm-layout.phtml

13.14. workflow (idea)

13.14.1. fork (in github) clone (no fetch merge) in the IDE PullRequest

13.15. some students don't use the original repo to create their modules

13.16. some students keep css, js, images in the folder module

13.17. some students don't add $this->basePath() to the URLs in the layout

13.18. some students use <? echo $this->basePath(); ?>

13.19. correct the paths in css files also

13.20. codenvy approaches

13.20.1. create new project use PaaS git init

13.20.2. clone repo or import from github NO PaaS clone guthub clone zend Projects -> New -> Import from github NO PaaS Git -> Clone NO PaaS

13.21. frequent mistakes

13.21.1. Add ...Controller.php at the end of the controller files

13.21.2. Add ..phtml as an extension for the view files

13.21.3. redirect


14.1. 12 weeks

14.1.1. 240 hours per student

14.1.2. 8 hours per mentor

14.1.3. Every Monday 10:00 BG time untill 12:00 - lection for 4 weeks 8 hours are over But I will continue

14.1.4. Every working day consultations from 13:00 untill 17:00 15 min per student In 6-7 weeks the 8 hours will be over But I will continue 1:15 per student per week

14.2. 5 projects

14.2.1. 3 students per project designer server site (back end) front end

14.2.2. projects BTK MGS GRD STO NIK

14.3. Open source project

14.3.1. Regrouping

14.4. communication

14.4.1. Google+ for the lections Google Hangout on Air

14.4.2. Skype for the consultations shared audio files in google drive

14.4.3. Everythign recorded

14.5. Documents shared in Google Drive

14.5.1. Schedule

14.5.2. Students

14.6. Virtualisation

14.6.1. Oracle VM Virtual Box free

14.6.2. VMware free

14.7. Design

14.7.1. Responsive Design

14.8. JS toolkits

14.8.1. jQuery

14.8.2. Dojo

14.9. cheatsheet

14.10. coding naming standards

14.11. Self project vs Zfc

14.11.1. self pros better learning cons low quality in the beginning

14.11.2. Zf-commons pros popular somebody else has done the job high quality? cons integration in our project

14.12. Shell we use modules vs building them from scratch?

14.12.1. common opinion is to use already build modules Zf-commons

14.13. Git HowTo

14.13.1. Centralized Workflow

14.13.2. How It Works Managing Conflicts

14.13.3. Example Someone initializes the central repository Everybody clones the central repository git clone ssh://user@host/path/to/repo.git John works on his feature Mary works on her feature John publishes his feature git push origin master Mary tries to publish her feature git push origin master Mary rebases on top of John’s commit(s) git pull --rebase origin master Mary resolves a merge conflict git status solve the problem git rebase --abort Mary successfully publishes her feature Mary successfully publishes her feature git push origin master

14.13.4. How to merge PR on GitHub?

14.14. Skeleton App how to start?

14.14.1. composer

14.14.2. git composer

14.14.3. ZFTool How to Install ZFTool Installation using Composer¶ Manual installation Without installation, using the PHAR file Usage Basic information Project creation Module creation Classmap generator ZF library installation Compile the PHAR file What works for me

14.15. tasks

14.15.1. ss install install DoctrineModule ZfcUser BjyAuthorize Doctrine ZfcUser ORM SamUser cdli/CdliTwoStageSignup How To Extend ZfcUser (and other modules) to match my needs?

14.15.2. designers viewhelpers in the layout

14.15.3. Ajax in the scripts

14.16. NetBeans (very good IDE)

14.17. CMS

14.17.1. libracms github

14.17.2. GotCms github

14.17.3. DotsCms

14.18. ideas for name

14.18.1. DB naming standards

14.18.2. SPDX OpenSource Registry

14.19. Lessons Learnd

14.19.1. Using modules CMS Monolyte system They almost don't use other modules Like Joomla, Drupal, WordPress No way to register user Only Admin can login You can not have ordinary users Not easy to learn and extend Specific Installations Not separate modules applications Black Box Very simple sites with the available CMS

14.20. DB Naming convensions

14.20.1. DB design for mere mortals Table types Data Linking Subset Validation Table Names Fields Resolving Multipart Fields Resolving Multivalued Fields

14.21. ZF2

14.21.1. Form Binding

14.21.2. ZF tool

14.21.3. Tutorial App

14.21.4. Controller Plugins

14.21.5. Zend/Mvc on top of Zend\ServiceManager Zend\EventManager Zend\Http Zend\Stdlib\DispatchableInterface sub-components are exposed Zend\Mvc\Router Zend\Http\PhpEnvironment Zend\Mvc\Controller Zend\Mvc\Service Zend\Mvc\View The gateway to the MVC Zend\Mvc\Application Bootstrapping an Application

14.22. mysqladmin change password

14.23. Book

14.24. Authorization

14.24.1. How to get Zend\Authentication\AuthenticationService new instance every time alias invocables in the config use Controller Plugin

14.24.2. simple approach with direct use cons Problem with more complex requirments. No central point No separation of concern. We don't follow DRY pros very intuitive