Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/19'
Browse files Browse the repository at this point in the history
Close #19
Fixes #18
  • Loading branch information
weierophinney committed Feb 6, 2013
2 parents 4fd4b12 + 7beba93 commit e0a06db
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ It runs from the command line and can be installed as ZF2 module or as PHAR (see
## Manual installation
1. Clone using `git` or [download zipball](https://github.com/zendframework/ZFTool/zipball/master).
2. Extract to `vendor/ZFTool` in your ZF2 application
3. Edit your `config/application.config.php` and add `ZFTool` to `modules` array.
4. Open console and try one of the following commands...
3. Enter the `vendor/ZFTool` folder and execute `zf.php` as reported below

## Using the PHAR file (zftool.phar)

1. Download the [zftool.phar from packages.zendframework.com](http://packages.zendframework.com/zftool.phar)
2. Execute the `zftool.phar` with one of the options reported below (`zftool.phar` replace the `zf.php`)

## Usage

Expand Down
21 changes: 18 additions & 3 deletions zf.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,25 @@
error_reporting(E_ALL);
ini_set("display_errors", 1);

require_once __DIR__ . '/vendor/autoload.php';
$basePath = __DIR__;
if (file_exists("$basePath/vendor/autoload.php")) {
require_once "$basePath/vendor/autoload.php";
} else {
$basePath = dirname(dirname($basePath));
chdir($basePath);
if (file_exists("init_autoloader.php")) {
require_once "init_autoloader.php";
} elseif (file_exists("vendor/autoload.php")) {
require_once "vendor/autoload.php";
} else {
echo 'Error: I cannot find the autoloader of the application.' . PHP_EOL;
echo "Check if $basePath contains a valid ZF2 application." . PHP_EOL;
exit(2);
}
}

if (file_exists('config/application.config.php')) {
$appConfig = require 'config/application.config.php';
if (file_exists("$basePath/config/application.config.php")) {
$appConfig = require "$basePath/config/application.config.php";
if (!isset($appConfig['modules']['ZFTool'])) {
$appConfig['modules'][] = 'ZFTool';
}
Expand Down

0 comments on commit e0a06db

Please sign in to comment.