CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.3 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.3
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • BakeTask
  • ControllerTask
  • DbConfigTask
  • ExtractTask
  • FixtureTask
  • ModelTask
  • PluginTask
  • ProjectTask
  • TemplateTask
  • TestTask
  • ViewTask
 1: <?php
 2: /**
 3:  * Base class for Bake Tasks.
 4:  *
 5:  * PHP 5
 6:  *
 7:  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 8:  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 9:  *
10:  * Licensed under The MIT License
11:  * For full copyright and license information, please see the LICENSE.txt
12:  * Redistributions of files must retain the above copyright notice.
13:  *
14:  * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
15:  * @link          http://cakephp.org CakePHP(tm) Project
16:  * @since         CakePHP(tm) v 1.3
17:  * @license       http://www.opensource.org/licenses/mit-license.php MIT License
18:  */
19: 
20: App::uses('AppShell', 'Console/Command');
21: 
22: /**
23:  * Base class for Bake Tasks.
24:  *
25:  * @package       Cake.Console.Command.Task
26:  */
27: class BakeTask extends AppShell {
28: 
29: /**
30:  * Name of plugin
31:  *
32:  * @var string
33:  */
34:     public $plugin = null;
35: 
36: /**
37:  * The db connection being used for baking
38:  *
39:  * @var string
40:  */
41:     public $connection = null;
42: 
43: /**
44:  * Flag for interactive mode
45:  *
46:  * @var boolean
47:  */
48:     public $interactive = false;
49: 
50: /**
51:  * Disable caching and enable debug for baking.
52:  * This forces the most current database schema to be used.
53:  *
54:  * @return void
55:  */
56:     public function startup() {
57:         Configure::write('debug', 2);
58:         Configure::write('Cache.disable', 1);
59:         parent::startup();
60:     }
61: 
62: /**
63:  * Gets the path for output. Checks the plugin property
64:  * and returns the correct path.
65:  *
66:  * @return string Path to output.
67:  */
68:     public function getPath() {
69:         $path = $this->path;
70:         if (isset($this->plugin)) {
71:             $path = $this->_pluginPath($this->plugin) . $this->name . DS;
72:         }
73:         return $path;
74:     }
75: 
76: /**
77:  * Base execute method parses some parameters and sets some properties on the bake tasks.
78:  * call when overriding execute()
79:  *
80:  * @return void
81:  */
82:     public function execute() {
83:         foreach ($this->args as $i => $arg) {
84:             if (strpos($arg, '.')) {
85:                 list($this->params['plugin'], $this->args[$i]) = pluginSplit($arg);
86:                 break;
87:             }
88:         }
89:         if (isset($this->params['plugin'])) {
90:             $this->plugin = $this->params['plugin'];
91:         }
92:     }
93: 
94: }
95: 
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs