oncesk / yii-node-socket

66 stars 46 forks source link

Incomplete configuration instructions? #9

Open daxpresents opened 10 years ago

daxpresents commented 10 years ago

Hi, first off THANK YOU for making this extension, it seems incredibly useful.

Unfortunately I have run into an issue getting it running.

I followed your installation and configuration instructions, I cloned the repository, added the necessary changes to my console.local and main.local config files and installed the node.js components successfully.

Now I go to start node-socket and get an error that seems to be related to namespaces:

./yiic node-socket start

PHP Fatal error: Class 'YiiNodeSocket\Frame\Event' not found in //protected/extensions/yii-node-socket/lib/php/frames/ChannelEvent.php on line 4

I tried using Yii::setPathOfAlias in the console.php file but couldn't see to get past this.

Please help me (and the other devs who may encounter this issue).

Thank you!

oncesk commented 10 years ago

Hi, it seems very strange, because frame ChannelEvent useless now and it included in /lib/php/frames/FrameFactory.php on 6 line, after Event.php

Please give me more information (stack trace) about a error, now i comment Event.php in /lib/php/frames/FrameFactory.php and was error like in issue

header of extensions/yii-node-socket/lib/php/frames/FrameFactory.php

<?php
namespace YiiNodeSocket\Frame;

require_once 'AFrame.php';
require_once 'Event.php';       // if comment this line will be error as in your issue
require_once 'ChannelEvent.php';// try comment, if will be error in Multiple.php we will investigate =)
require_once 'Multiple.php';
require_once 'PublicData.php';
require_once 'Invoke.php';
require_once 'JQuery.php';

class FrameFactory implements IFrameFactory {

    /**
     * @var \NodeSocket
     */
    protected $_nodeSocket;

now i tested all installation steps and all was good

for tests try comment 6 line (require_once 'ChannelEvent.php';) in file extensions/yii-node-socket/lib/php/frames/FrameFactory.php

Please tell me what operation system you are using and version of php?

oncesk commented 10 years ago

Hi, did you solve problem?

daxpresents commented 10 years ago

Still having the issue after a fresh download and install of your new version.

PHP 5.5 on OSX.

daxs-computer-4:tronic-fm dax$ ./app/yiic node-socket start PHP Error[2]: include(/Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/config/../extensions/yii-node-socket/lib/php/Frame/Event.php): failed to open stream: No such file or directory in file /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/YiiBase.php at line 433

0 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/YiiBase.php(433): autoload()

1 unknown(0): autoload()

2 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/frames/Invoke.php(8): spl_autoload_call()

3 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/frames/FrameFactory.php(9): require_once()

4 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/NodeSocket.php(3): require_once()

5 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/YiiBase.php(320): require()

6 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/YiiBase.php(196): import()

7 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/base/CModule.php(386): createComponent()

8 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/NodeSocketCommand.php(147): CConsoleApplication->getComponent()

9 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/NodeSocketCommand.php(190): NodeSocketCommand->getComponent()

10 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/NodeSocketCommand.php(180): NodeSocketCommand->getPidFile()

11 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/NodeSocketCommand.php(170): NodeSocketCommand->updatePid()

12 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/NodeSocketCommand.php(218): NodeSocketCommand->getPid()

13 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/extensions/yii-node-socket/lib/php/NodeSocketCommand.php(33): NodeSocketCommand->_start()

14 unknown(0): NodeSocketCommand->actionStart()

15 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()

16 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): NodeSocketCommand->run()

17 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()

18 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/vendor/yiisoft/yii/framework/base/CApplication.php(180): CConsoleApplication->processRequest()

19 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/yiic.php(21): CConsoleApplication->run()

20 /Volumes/512SSD/web_dev/htdocs/tronicfm_github/tronic-fm/app/yiic(4): require_once()

oncesk commented 10 years ago

Hi, sorry, but i do not test it on php 5.5

seems like problem with your php because this is impossible

code below you can find in https://github.com/oncesk/yii-node-socket/blob/master/lib/php/frames/FrameFactory.php

<?php
namespace YiiNodeSocket\Frame;

require_once 'AFrame.php';
require_once 'Event.php';
require_once 'ChannelEvent.php';
require_once 'Multiple.php';
require_once 'PublicData.php';
require_once 'Invoke.php';
require_once 'JQuery.php';

class FrameFactory implements IFrameFactory {

this order of require_once calls is valid order, but in your case Invoke.php included before Event.php, how this is possible?

oncesk commented 10 years ago

try 0.1 version https://github.com/oncesk/yii-node-socket/tree/0.1

in 0.1 version used autoloader for loading classes, maybe it will be works

Seb- commented 10 years ago

Hello,

I had the same issue and I fixed it by changing the line to require_once DIR.'/Event.php';

It is because the Event.php file was already used somewhere else on my code.

Regards