Giter VIP home page Giter VIP logo

learnzf2's Introduction

Learn ZF2

"Learn ZF2" (http://learnzf2.com) is a book dedicated to help you learn fast and easy Zend Framework 2.

Source Code

The book is accompanied by source code from which you can learn by example. The source is based on the ZendSkeletonApplication version 2.1.0. You can get the latest version of the source code from its github repository: https://github.com/slaff/learnzf2

The book has two edition and this repository contains the source code for the second edition. If you are looking for the source code of the first edition of the book take a look at that repository: https://github.com/slaff/learnzf2-v1

Zend Framework Book

For more information about the book and purchase options visit its official web site: http://learnzf2.com

Development Box

If you do not feel comfortable with setting up the application and its environment then as a quick start you can use our LearnZF2 dev box which is using Vagrant and VirtualBox. If you want to experiment with Zend Framework 2 and the upcoming PHP7 you can also use the LearnZF2 VM as described here.

Application

Build Status The final version of the source code comes with ready to test Zend Framework 2 web application with prefilled SQLite database.

The steps below are needed if you don't use the LearnZF2 dev box. But we would strongly encourage you to take a look at these steps and understand their meaning.

Preparation

In order to get the dependant packages, like Zend Framework 2 for example, we have to run the following commands once in the beginning.

cd learnzf2/
./composer.phar self-update
./composer.phar install

Run from PHP built-in server

The easiest way to run the code, if you have PHP 5.4 or newer is to type:

cd learnzf2/
php -S 127.0.0.1:8080 -t public/

And then open in your browser the following URL: http://127.0.0.1:8080/

Run from separate web server

In order to use the application with via separate web server(Apache, NGINX, etc) make sure that:

The data/db/tc.sqlite file is readable from the web server user. The following commands can help you set the group to www-data and adjust the permissions.

chgrp www-data -R data/db
chmod g+rx data/db
chmod g+w data/db/tc.sqlite

Application Users

There are two users that you can use.

  1. Admin user with email: [email protected] and password admin123
  2. Member user with email: [email protected] and password member123.

If you want to take some of the sample exams that come with this application then you have to login and go to Exam -> List and choose one from the list.

learnzf2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learnzf2's Issues

Composer Config outdated

Hi Slavey,

I bought your Learn ZF2 book and was starting to follow your code examples. Unfortunately, the composer install step fails with dependency errors. Do you intend to update the composer.json config to make it work with current dependencies?

Here is the error:

php composer.phar install
This dev build of composer is outdated, please run "composer.phar self-update" to get the latest version.
Loading composer repositories with package information
Installing dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package learnzf2/debug dev-master could not be found.
Problem 2
- The requested package doctrine/common >=2.1 could not be found.
Problem 3
- The requested package doctrine/orm >=2.1 could not be found.
Problem 4
- The requested package zendframework/zendframework 2.* could not be found.
Problem 5
- The requested package zendframework/zendpdf 2.* could not be found.

Potential causes:

Tag ch-debug-module in zf2 2.2.4

Using your tag version, the Debug module's Module.php file has all 4 method which causes fatal errors if used in latest zf2. Error logging will only shows stack trace. However if you have just the 2 methods of init and loadedModulesInfo (like shown in the book on page 30), the error logging works fine and shows the loaded modules in the error log. Your tag works fine but if one wanted to use the same Module.php code from Debug module in 2.2.4, how can this be done?

Developement environment preparation

I would suggest you to add instructions on how to build the same development environment as yours. For example, a short introduction on virtual box, vagrant or at least puPHPet would be nice to have as a chapter. Why do I say so? I say so because I tried to run unit tests on Windows computer (I use one with Windows 8.1 OS) and then I got some major errors... I was not able to run unit tests the way you wrote (for example, at page 103 of the first edition book). Running the same commands on Linux results in success.
This is the place you could read more about the problem I got:
http://stackoverflow.com/questions/27999373/why-phpunit-test-does-not-work-zf2

Many thanks for The Book! It helps a lot.

Use ModuleManager event name constants.

John Chadwick noticed this issue (http://learnzf.com/forum/topic/errata/)
"Small error: Your code on GIT has ‘loadModules.post’ rather than what is in the book, showing constant ModuleEvent::EVENT_LOAD_MODULES_POST which is the preferred format as I have learned from you."
That has to be changes in the source code and the whole git history has to be rewritten.

Debug module

After updating for the Debug module via git there are test files the Debug module. You do not describe any of it in your book. Just pointing this out because as a newcomer to ZF, it's all pretty confusing at times and everyone writes the same kind of examples in different ways. One should expect the code and files to match what is in the book at given point.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.