Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
[DEPRECATED for ZF2 & Composer] Best practice Zend Framework (ZF) skeleton / base with Doctrine2 integration : High code coverage & build scripts using TDD. Issues section ar e used for project planning (features etc)
PHP Other

This branch is 48 commits ahead, 47 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
application
data
docs
library
public
tests
.gitignore
README

README

--------------------------------------------------------
GOAL - BEST PRACTICE TEST DRIVEN DEVELOPMENT
--------------------------------------------------------
To achieve a Best Practice Zend Framework skeleton project. Using Doctrine ORM with full Code Coverage on the Doctrine Models and with Database Migrations. Using PHPUnit, Ant & Jenkins for Continous Integration and PHPDocumentor for our API documents. Using jQuery to progessively enhance the UI.

Together we can achieve this! FORK ME!

Follow the latest updates of this project on twitter http://twitter.com/eddiejaoude_git

Project builds on jenkins ci http://build.jaoudestudios.com:8080 

Projects using this base: (send me your links)
https://github.com/eddiejaoude/github-adv-search

--------------------------------------------------------
FEATURES include
--------------------------------------------------------
- ZF Modular (modules) structure
  - auth module
    - login
    - register (inc. captcha)
  - custom controller plugin helpers
  - custom controller action helpers
  - flash message (flashMessenger) helper useable from any controller action
- jQuery
- Unit testing
  - setup & configured
  - 100% code coverage
- Best practice php tools
  - phploc
  - phpcpd
  - phpdcd (coming soon)
  - pdepend
  - phpmd 
  - phpcs 
  - php_codebrowser 
  - phpdocs
- Ant build scripts for Continuous Integration
- Ant deploy script including 'dry run' mode (coming soon)

--------------------------------------------------------
TECHNOLOGIES USED
--------------------------------------------------------
- Zend Framework 1.11+
- Doctrine 2+
- PHPUnit 3.5+
- PHP Documentor
- jQuery


--------------------------------------------------------
OTHER TECHNOLOGIES REQUIRED
--------------------------------------------------------
- PHP 5.3+
- Xdebug 2.x
- MySQL 5.x
- Ant
- Jenkins (formally Hudson)


--------------------------------------------------------
ADVANTAGES of TTD (Test Driven Developement)
--------------------------------------------------------
- Improved stability
- Refactoring - code can be improved without breaking
- Test first - improves code planning
- High code coverage reports - shows what code is not tested yet
- ...

--------------------------------------------------------
RUNNING TESTS
--------------------------------------------------------
> cd tests/
> phpunit OR > ant 

--------------------------------------------------------
INSTALLATION (linux)
--------------------------------------------------------
- Navigation to root directory of project (ie. application,data,docs,library etc)
- Create the database with the following command
> mysql -u[username] -p[password] [database] < data/accounts.sql
> mysql -u[username] -p[password] [database] < data/account_audit.sql
> mysql -u[username] -p[password] [database] < data/accounts_role_members.sql
> mysql -u[username] -p[password] [database] < data/acl_privileges.sql
> mysql -u[username] -p[password] [database] < data/acl_role_privileges.sql
> mysql -u[username] -p[password] [database] < data/acl_roles.sql
- Create apache vhost, with config:
<VirtualHost *:80>
        DocumentRoot /var/www/vhosts/js.skeleton/httpdocs/public
        ServerName js.skeleton
        <Directory /var/www/vhosts/js.skeleton/httpdocs/public>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>
- Install/Enable apache module mod_rewrite
- Restart apache with:
[Ubuntu] > sudo service apache2 restart
[CentOS] > sudo service httpd restart
- Add ServerName, in this case js.skeleton to your host file with your local IP
> vi /etc/hosts
> 127.0.0.1 js.skeleton
- Update application/config/application.ini file with your database credentials

--------------------------------------------------------
SCREEN SHOTS
--------------------------------------------------------
See Wiki

--------------------------------------------------------
FAQs
--------------------------------------------------------
Coming shortly



--------------------------------------------------------
APPENDIX
--------------------------------------------------------
- Zend Framework
Zend Framework is an open source framework for developing web applications and services with PHP 5. Zend Framework is implemented using 100% object-oriented code. The component structure of Zend Framework is somewhat unique; each component is designed with few dependencies on other components. This loosely coupled architecture allows developers to use components individually. We often call this a "use-at-will" design.
While they can be used separately, Zend Framework components in the standard library form a powerful and extensible web application framework when combined. Zend Framework offers a robust, high performance MVC implementation, a database abstraction that is simple to use, and a forms component that implements HTML form rendering, validation, and filtering so that developers can consolidate all of these operations using one easy-to-use, object oriented interface. Other components, such as Zend_Auth and Zend_Acl, provide user authentication and authorization against all common credential stores. Still others implement client libraries to simply access to the most popular web services available. Whatever your application needs are, you're likely to find a Zend Framework component that can be used to dramatically reduce development time with a thoroughly tested foundation.

- Doctrine
Doctrine is an object relational mapper (ORM) for PHP 5.2.3+ that sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.

- PHPUnit
Even good programmers make mistakes. The difference between a good programmer and a bad programmer is that the good programmer uses tests to detect his mistakes as soon as possible. The sooner you test for a mistake the greater your chance of finding it and the less it will cost to find and fix. This explains why leaving testing until just before releasing software is so problematic. Most errors do not get caught at all, and the cost of fixing the ones you do catch is so high that you have to perform triage with the errors because you just cannot afford to fix them all.

Testing with PHPUnit is not a totally different activity from what you should already be doing. It is just a different way of doing it. The difference is between testing, that is, checking that your program behaves as expected, and performing a battery of tests, runnable code-fragments that automatically test the correctness of parts (units) of the software. These runnable code-fragments are called unit tests.

- Jenkins
Jenkins monitors executions of repeated jobs, such as building a software project or jobs run by cron. Among those things, current Jenkins focuses on the following two jobs:
1. Building/testing software projects continuously, just like CruiseControl or DamageControl. In a nutshell, Jenkins provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.
2. Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Jenkins keeps those outputs and makes it easy for you to notice when something is wrong.

- PHPDocumentor
phpDocumentor uses an extensive templating system to change your source code comments into human readable, and hence useful, formats. This system allows the creation of easy to read documentation in 15 different pre-designed HTML versions, PDF format, Windows Helpfile CHM format, and in Docbook XML. You can also create your own templates to match the look and feel of your project.

Something went wrong with that request. Please try again.