comparison cake/console/libs/tasks/bake.php @ 0:261e66bd5a0c

hg init
author Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
date Sun, 24 Jul 2011 21:08:31 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:261e66bd5a0c
1 <?php
2 /**
3 * Base class for Bake Tasks.
4 *
5 * PHP versions 4 and 5
6 *
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8 * Copyright 2005-2010, Cake Software Foundation, Inc.
9 *
10 * Licensed under The MIT License
11 * Redistributions of files must retain the above copyright notice.
12 *
13 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link http://cakephp.org CakePHP(tm) Project
15 * @package cake
16 * @subpackage cake.cake.console.libs.tasks
17 * @since CakePHP(tm) v 1.3
18 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
19 */
20 class BakeTask extends Shell {
21
22 /**
23 * Name of plugin
24 *
25 * @var string
26 * @access public
27 */
28 var $plugin = null;
29
30 /**
31 * The db connection being used for baking
32 *
33 * @var string
34 * @access public
35 */
36 var $connection = null;
37
38 /**
39 * Flag for interactive mode
40 *
41 * @var boolean
42 */
43 var $interactive = false;
44
45 /**
46 * Gets the path for output. Checks the plugin property
47 * and returns the correct path.
48 *
49 * @return string Path to output.
50 * @access public
51 */
52 function getPath() {
53 $path = $this->path;
54 if (isset($this->plugin)) {
55 $name = substr($this->name, 0, strlen($this->name) - 4);
56 $path = $this->_pluginPath($this->plugin) . Inflector::pluralize(Inflector::underscore($name)) . DS;
57 }
58 return $path;
59 }
60 }