CakePHP,设置“蛋糕”环境变量?

发布于 2024-08-21 11:38:52 字数 178 浏览 8 评论 0原文

我在 Mac OS X 10.6.2 上使用 cakephp 中的“cake”控制台。如何设置环境变量(或路径?),以便我需要在终端中输入的是“cake”......而不是控制台应用程序的完整路径?

当谈到终端命令和这些 UNIX 的东西时,我毫不掩饰是一个新手(但我正在学习!),所以如果我的解释/词汇有点偏差,请耐心等待。

I'm using the "cake" console in cakephp on Mac OS X 10.6.2. How do I set up the environment variable (or PATH?) so that all I need to type in terminal is "cake"... as opposed to the full path to the console app?

I'm unabashedly a newb when it comes to terminal commands and these UNIX things (but I'm learning!), so bear with me if my explanation/vocabulary is a bit off.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你丑哭了我 2024-08-28 11:38:52

您应该添加

alias cake=PATH_TO_CAKE

到您的 .bashrc 文件(通常位于您的主目录中)。

要公开 shell 目录中的所有 cake 脚本,请将 cake shell 路径添加到系统路径。

export PATH=/your_path_to_cake:$PATH

别名和导出都可以添加到 .bashrc 文件中或直接在命令行上执行。 .bashrc 是一个 shell 脚本,每次启动新的 shell 会话时都会执行该脚本,并且无论您的工作目录如何,放置其中一行或两行都会使 cake 指向正确的程序。

You should add

alias cake=PATH_TO_CAKE

To your .bashrc file (it's usually in your home directory).

To expose all cake scripts in the shell directory, add the cake shell path to your system path.

export PATH=/your_path_to_cake:$PATH

Both alias and export can be added to your .bashrc file or executed directly on the command line. .bashrc is a shell script which will be executed each time you start a new shell session and placing one or both of the lines will make cake point to the correct program reagardless of your working directory.

别念他 2024-08-28 11:38:52

matiasf 发布的上述解决方案应该可以让您很快上手。

我唯一建议的是将蛋糕目录放在一个中心位置(即/usr/local/cake)。

我最近在博客文章中写了一些说明(http:// /developinginthedark.com/posts/cakephp-tip-2-run-multiple-cakephp-releases),逐步完成 Mac 上的设置(以及 Windows 的用户评论说明),特别侧重于建立环境并运行支持多个版本的 CakePHP。

听起来您只需要开始使用一个版本,但说明应该仍然相关。

希望这对您自己和/或其他人有所帮助。

The above solution posted by matiasf should get you going pretty quickly.

The only thing I'd recommend is putting your cake directory in a central location (ie, /usr/local/cake).

I recently wrote up some instructions in a blog post (http://developinginthedark.com/posts/cakephp-tip-2-run-multiple-cakephp-releases) that walks through settings things up on a Mac (and user commented instructions for Windows), specifically focusing on getting an environment up and running that supports multiple releases of CakePHP.

It sounds like you just need to get going with one version, but the instructions should still be relevant.

Hopefully this helps yourself and/or others.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文