控制台在 Windows 版 CakePHP 中找不到 Shell
我在 winows (XAMPP) 上获取蛋糕控制台以查看演示 shell 时遇到问题,
C:\xampp\htdocs\twitter\app\vendors\shells>dir
2011/03/31 21:11 <DIR> .
2011/03/31 21:11 <DIR> ..
2011/03/31 21:16 761 demo.php
2011/03/31 21:01 <DIR> tasks
2011/03/31 21:01 <DIR> templates
我的 shell 目录中有 demo.php shell。
C:\xampp\htdocs\twitter\app\vendors\shells>cake demo
Error: Class DemoShell could not be loaded.
但蛋糕控制台找不到它。
C:\xampp\htdocs\twitter\app\vendors\shells>cake
Welcome to CakePHP v1.3.7 Console
---------------------------------------------------------------
Current Paths:
-app: shells
-working: C:\xampp\htdocs\twitter\app\vendors\shells
-root: C:\xampp\htdocs\twitter\app\vendors
-core: C:\xampp\htdocs\twitter
Changing Paths:
your working path should be the same as your application path
to change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp
Available Shells:
acl [CORE] i18n [CORE]
api [CORE] schema [CORE]
bake [CORE] testsuite [CORE]
console [CORE]
To run a command, type 'cake shell_name [args]'
To get help on a specific command, type 'cake shell_name help'
C:\xampp\htdocs\twitter\app\vendors\shells>
并且控制台本身无法识别它。 (注意核心正在从正确的目录读取)。
这可能是一些愚蠢的疏忽,但知道我在这里做错了什么吗?
I'm having trouble getting the cake console on winows (XAMPP) to see the demo shell
C:\xampp\htdocs\twitter\app\vendors\shells>dir
2011/03/31 21:11 <DIR> .
2011/03/31 21:11 <DIR> ..
2011/03/31 21:16 761 demo.php
2011/03/31 21:01 <DIR> tasks
2011/03/31 21:01 <DIR> templates
I have the demo.php shell in the shell directory.
C:\xampp\htdocs\twitter\app\vendors\shells>cake demo
Error: Class DemoShell could not be loaded.
But the cake console couldn't find it.
C:\xampp\htdocs\twitter\app\vendors\shells>cake
Welcome to CakePHP v1.3.7 Console
---------------------------------------------------------------
Current Paths:
-app: shells
-working: C:\xampp\htdocs\twitter\app\vendors\shells
-root: C:\xampp\htdocs\twitter\app\vendors
-core: C:\xampp\htdocs\twitter
Changing Paths:
your working path should be the same as your application path
to change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp
Available Shells:
acl [CORE] i18n [CORE]
api [CORE] schema [CORE]
bake [CORE] testsuite [CORE]
console [CORE]
To run a command, type 'cake shell_name [args]'
To get help on a specific command, type 'cake shell_name help'
C:\xampp\htdocs\twitter\app\vendors\shells>
And it isn't recognised by the console itself. (note the core is reading from the correct directory).
It's probably some silly oversight but any idea what I am doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该从应用程序文件夹中调用 Cake [shell name]:
C:\xampp\htdocs\twitter\app\>cake demo
。请告诉我是否有效。
You should call
cake [shell name]
from within the app folder:C:\xampp\htdocs\twitter\app\>cake demo
.Please let me know if it works.
阅读错误,它没有说“找不到文件”,而是说“找不到类”,因此您似乎在 demo.php shell 中错误地命名了该类
错误:无法加载类 DemoShell。这是一个关于它应该是什么的提示
Read the error, it does not say 'file not found' it says 'class not found' so it would seem you have named the class incorrectly inside your demo.php shell
Error: Class DemoShell could not be loaded. that is a hint as to what it should be