Comments (27)
Could you add your configs to this report? it is very hard to see from this what the issue is, or if there even is one, it may simply be something local to your system or configuration. From this all we can tell is that it did not find the class ZFTool\Module.
from zftool.
I included it in the main issue description. Let me know if that's not acceptable.
from zftool.
This issue should be solved with my last push. Check it and let me know, thanks.
from zftool.
If it will help you.
Zend\ModuleManager\ModuleManager
I do:
protected function loadModuleByName($event)
{
$result = $this->getEventManager()->trigger(ModuleEvent::EVENT_LOAD_MODULE_RESOLVE, $this, $event, function ($r) {
return (is_object($r));
});
$module = $result->last();
$h = fopen('C:/zendToolLog', 'a+');
$debug = \Zend\Debug\Debug::dump($result); // My Debug
fwrite($h,$debug,strlen($debug));
fclose($h);
if (!is_object($module)) {
throw new Exception\RuntimeException(sprintf(
'Module (%s) could not be initialized.',
$event->getModuleName()
));
}
return $module;
}
In logs:
class Zend\EventManager\ResponseCollection#52 (3) {
protected $stopped =>
bool(true)
private $flags =>
int(6)
private $dllist =>
array(1) {
[0] =>
class Application\Module#56 (0) {
}
}
}
class Zend\EventManager\ResponseCollection#52 (3) {
protected $stopped =>
bool(true)
private $flags =>
int(6)
private $dllist =>
array(1) {
[0] =>
class ZendDeveloperTools\Module#65 (0) {
}
}
}
class Zend\EventManager\ResponseCollection#52 (3) { // <<<<< THIS THROW ERROR
protected $stopped =>
bool(false)
private $flags =>
int(6)
private $dllist =>
array(1) {
[0] =>
bool(false)
}
}
IF I DO:
$h = fopen('C:/zendToolLog', 'a+');
$debug = \Zend\Debug\Debug::dump($event->getModuleName()); // <<<
fwrite($h,$debug,strlen($debug));
fclose($h);
In logs:
string(11) "Application"
string(18) "ZendDeveloperTools"
string(6) "ZFTool" // <<<<<<<<<<<<<<<
from zftool.
I updated ZFTool to requires ZF 2.2.2. Can you install zftool again and check? Thanks.
from zftool.
That's famous! Thank you!
from zftool.
Hi I have the same problem.
Environment:
Ubuntu 12.04 as Guest in VirtualBox Windows 7 Host
Apache 2.4, PHP5.5
ZFTool 2.2.4 (zftool.phar move to /usr/local/bin/zftool)
Shows ZFTool version, ZF2 Project created using zftool
Error when checking version within project directory
Composer installs dependencies
Calling zftool version results in error.
It seems I needed to install zftool into the project for the globally available zftool to function properly.
composer require zendframework/zftool:dev-master
The error was solved after running the composer install for zftool. It seems for the global zftool to function, the zftool also needs to be installed within the project.
from zftool.
Hey Guys,
is there any new process on this suppect. I have the same problem with "phar" usage of the tool.
best wishes,
nicolas
from zftool.
I am too
from zftool.
I was able to reproduce this in a slightly different way. I did not use the phar file but created a link to a central ZFTool installation within /usr/local/bin/zf. When I have a local ZFTool installation in the current project, everything works fine. But when I kick that out, I get a slightly different error:
Module (ZendDeveloperTools) could not be initialized.
When I comment out the ZendDeveloperTools within my application.config.php everything works fine again. So it seems that ZFTool is not able to initilize modules within /vendor when there is no ZFTool installation in the /vendor path.
Could you please check that so I will have the same setup?
Thanks and regards,
Ralf
from zftool.
Hi Ralf,
If I recall correctly I get the same thing as you mentioned above.
from zftool.
Unfortunately I had an error in the setup of my example application. I corrected this and the error is gone. Could you please provide more information about your full setup? Until I cannot reproduce the error I have no chance to fix it.
from zftool.
I was using Ubuntu 12.04 in VirtualBox.
I had PHP 5.5 installed and copied zftool.phar into usr/local/bin/
Attached is a screenshot of the info.
from zftool.
Ok, I was able to reproduce your problem and it is weird. When I use an installation of https://github.com/zendframework/ZFTool with a symlink in /usr/local/bin/zf to its zf.php file, I don't get this error when I call zf within a ZF2 project. But calling zf in a non-ZF2-directory I am not able to get it run:
Error: I cannot find the autoloader of the application.
Check if /home/devhost contains a valid ZF2 application.
So, currently you need a global zftool.phar installation to create a project and a global zf.php installation to work within a project...
Need to look into this...
from zftool.
Hi,
I am new to Zend developing. I have Studio 10.5 developing on the zend cloud.
When I create a new skeleton app then update zendframework to 2.2.2 and add zend developer tools 0.0.2 all works as expected. However, if I close Studio then open and relaunch the app I get the error:
Debug Warning: /shareventcloud4/vendor/composer/ClassLoader.php line 185 - include(/home/sharevent/.apps/http/default/0/shareventcloud4/1.0.0/vendor/zendframework/zend-developer-tools/Module.php): failed to open stream: No such file or directory
If I upload the module zend developer tools again the app works. Surely Studio should have uploaded these files the first time - it seems that a re-launch of the app deletes them for some reason.
Any ideas?
from zftool.
The same to me!
ZF 2.2.5
Downloaded ZFTool master from github, ran composer install, created phar with create-phar command, installed zftool in /usr/local/bin/zf
After that, I was able to create a new project using # zf create project ./path
But accessing application path and issuing a create module commmand, I get an error...(the same for # zf version)
zf create module Album
PHP Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (ZFTool) could not be initialized.' in /media/data/www/clients/client1/web2/web/bafixauto/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:175
Stack trace:
#0 /media/data/www/clients/client1/web2/web/bafixauto/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php(149): Zend\ModuleManager\ModuleManager->loadModuleByName(Object(Zend\ModuleManager\ModuleEvent))
#1 /media/data/www/clients/client1/web2/web/bafixauto/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php(90): Zend\ModuleManager\ModuleManager->loadModule('ZFTool')
#2 [internal function]: Zend\ModuleManager\ModuleManager->onLoadModules(Object(Zend\ModuleManager\ModuleEvent))
#3 /media/data/www/clients/client1/web2/web/bafixauto/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))
#4 /media/da in /media/data/www/clients/client1/web2/web/bafixauto/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php on line 175
from zftool.
Well, this is pretty weird!, if I run the commands from the projecy parent directory, zftool works!
IE: folder/projectfolder if I run zftool from here, I get the above error, but if I run zf from parent (folder/ it works!)...example: zf create module Album ./projectfolder/
from zftool.
@ghiamar Try requiring ZFTool in your composer... I had the same problem, now it's fixed. No need to enable module, just download his library.
from zftool.
Thanks @fmarcoux96, but whats the goal of having a dependency when I had installed zftool.phar globally in my system?
from zftool.
I had the same problem. Zftool worked everywhere except in a ZF2 project folder, which is kind of where you want it to work.
I'm on Windows on the computer I'm working on at the moment.
I solved this by hacking zf.php in vendor/zendframework/zftool/zf.php in my system location which is C:\ProgramData\Zftool (not in a zf2 project).
I changed line 10
// the path on my system
$basePath = realpath('C:\ProgramData\Zftool');
Then commented out the first two if/else blocks at line 14 for load autoloader. Now it's this:
// load autoloader
/*
if (file_exists("$basePath/vendor/autoload.php")) {
require_once "$basePath/vendor/autoload.php";
} elseif (file_exists("$basePath/init_autoload.php")) {
require_once "$basePath/init_autoload.php";
} else
// */
if (\Phar::running()) {
require_once __DIR__ . '/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);
}
Then I re-ran:
> php create-phar
Added C:\ProgramData\Zftool\vendor\zendframework\zftool\bin to my %PATH%. Then created zftool.bat in the same location with these contents:
@ECHO OFF
SET PHP_INI_PATH="C:\PHP\php.ini"
php -c "%PHP_INI_PATH%" "%~dp0zftool.phar" %*
Total hack; works, even in a ZF2 project. Obviously the 'fix for everyone' would have to be a little more thought out. Maybe setting that $basePath variable better.
from zftool.
I've updated to the latest version and agree with @stormwild. Adding zftool to composer solved the issue.
from zftool.
Composer itself is a phar and can be installed globally and can be called
while the user is within a specific project directory and is able to apply
the commands to that directory. I feel ZFTool should be used in a similar
way without it having to be a dependency within each project. I would
rather use it as a tool or dependency within my dev environment.
On Wed, Feb 19, 2014 at 9:21 PM, ghiamar [email protected] wrote:
Thanks @fmarcoux96 https://github.com/fmarcoux96, but whats the goal of
having a dependency when I had installed zftool.phar globally in my system?—
Reply to this email directly or view it on GitHub
#51 (comment).
Alexander R. Torrijos
Web Developer
Mobile: +63 919 991 5653
Res: +63 2 822 7219
http://alex.stormwild.com
Skype/YM: artorrijos
from zftool.
make sure you are in the project directory.
and call: php path/to/zftool/zf.php create module your_module_name
That worked for me. But if i call it within zftool directory with a path/to/module_name, it failed
from zftool.
I had the same problem. And that`s what worked for me:
Situation in details:
- I am on Windows 8.1
- I have my ZF2 project inside of F:\www\myproject
- F:\www\myproject\composer.phar (from the ZF2 Skeleton Application)
- F:\www\myproject\zftool.phar (downloaded from http://packages.zendframework.com/zftool.phar)
The command like that works just fine:
F:\www>php F:\www\myproject\zftool.phar create module Debug myproject
Pay attention to the path where I am running the command from! it is outside of the myproject
from zftool.
zf.php
line 15 an16 replace by this... works
if (file_exists("$basePath/../../../vendor/autoload.php")) {
require_once "$basePath/../../../vendor/autoload.php";
and execute whit this in any location in windows...8.1: php "E:\xampp\htdocs\zend3\vendor\zendframework\zftool\zf.php" create module Users2 "E:\xampp\htdocs\zend3"
from zftool.
I'm closing this old issue because it's not relevant anymore.
from zftool.
to fixe this error, you have to make form parent directory : # php zftool.phar create module MyModule MyProject
from zftool.
Related Issues (20)
- No namespace in module config file after creation
- zftool.phar: command not found HOT 3
- Can't install using composer HOT 7
- Create action doesn't work HOT 2
- Enable Travis-ci service HOT 2
- Enable phpcs
- Add documentation about json response in diagnostics
- Controller creation fails when directory is missing
- Error on display config list HOT 2
- create Action fails when using project path
- ZFTool keeps saying it has thrown an exception when no exception is listed. HOT 2
- Create classmap on Windows OS HOT 2
- Zend 3 compatible? HOT 8
- zf.php version not showing version
- unable to find download link of zftool.phar HOT 1
- fail run zftool after phar create HOT 3
- zftool config list seems to be executing MVC code...
- What is the license of this project? HOT 2
- Error install composer HOT 8
- Default loading page does not load Zend framework 3 .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zftool.