CakePHP,Set“cake”环境变量? [英] CakePHP, Set "cake" Environment Variable?

查看:255
本文介绍了CakePHP,Set“cake”环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

当我谈到终端命令和这些UNIX的东西(但我在学习!)时,我毫不犹豫地是一个新手,所以如果我的解释/词汇有点离开,请忍受我。

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.

推荐答案

您应该添加

alias cake=PATH_TO_CAKE

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

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

要显示shell目录中的所有蛋糕脚本,请将蛋白shell路径添加到系统路径。

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

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

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.

这篇关于CakePHP,Set“cake”环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆