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.4 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.4
      • 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

Class ProjectTask

Task class for creating new project apps and plugins

AppShell
Extended by ProjectTask
Package: Cake\Console\Command\Task
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Console/Command/Task/ProjectTask.php

Properties summary

  • $configPath public
    string
    configs path (used in testing).

Method Summary

  • _replaceCorePath() protected
    Replaces the CAKE_PATH placeholder in the template files.
  • bake() public

    Looks for a skeleton template of a Cake application, and if not found asks the user for a path. When there is a path this method will make a deep copy of the skeleton to the project directory.

  • cachePrefix() public
    Writes cache prefix using app's name
  • cakeAdmin() public
    Enables Configure::read('Routing.prefixes') in /app/Config/core.php
  • cakeOnIncludePath() public
    Checks PHP's include_path for CakePHP.
  • consolePath() public

    Generates the correct path to the CakePHP libs that are generating the project and points app/console/cake.php to the right place

  • corePath() public
    Generates and writes CAKE_CORE_INCLUDE_PATH
  • execute() public

    Checks that given project path does not already exist, and finds the app directory in it. Then it calls bake() with that information.

  • getOptionParser() public
    get the option parser.
  • getPrefix() public
    Checks for Configure::read('Routing.prefixes') and forces user to input it if not enabled
  • securityCipherSeed() public
    Generates and writes 'Security.cipherSeed'
  • securitySalt() public
    Generates and writes 'Security.salt'

Method Detail

_replaceCorePath() protected ¶

_replaceCorePath( string $filename , boolean $hardCode )

Replaces the CAKE_PATH placeholder in the template files.

Parameters
string $filename
The filename to operate on.
boolean $hardCode
Whether or not the define should be uncommented.
Returns
boolean
Success

bake() public ¶

bake( string $path , string $skel = null , string $skip = array('empty') )

Looks for a skeleton template of a Cake application, and if not found asks the user for a path. When there is a path this method will make a deep copy of the skeleton to the project directory.

Parameters
string $path
Project path
string $skel optional null
Path to copy from
string $skip optional array('empty')
array of directories to skip when copying
Returns
mixed

cachePrefix() public ¶

cachePrefix( string $dir )

Writes cache prefix using app's name

Parameters
string $dir
Path to project
Returns
boolean
Success

cakeAdmin() public ¶

cakeAdmin( string $name )

Enables Configure::read('Routing.prefixes') in /app/Config/core.php

Parameters
string $name
Name to use as admin routing
Returns
boolean
Success

cakeOnIncludePath() public ¶

cakeOnIncludePath( )

Checks PHP's include_path for CakePHP.

Returns
boolean
Indicates whether or not CakePHP exists on include_path

consolePath() public ¶

consolePath( string $path )

Generates the correct path to the CakePHP libs that are generating the project and points app/console/cake.php to the right place

Parameters
string $path
Project path.
Returns
boolean
success

corePath() public ¶

corePath( string $path , boolean $hardCode = true )

Generates and writes CAKE_CORE_INCLUDE_PATH

Parameters
string $path
Project path
boolean $hardCode optional true
Whether or not define calls should be hardcoded.
Returns
boolean
Success

execute() public ¶

execute( )

Checks that given project path does not already exist, and finds the app directory in it. Then it calls bake() with that information.

Returns
mixed

getOptionParser() public ¶

getOptionParser( )

get the option parser.

Returns
ConsoleOptionParser

getPrefix() public ¶

getPrefix( )

Checks for Configure::read('Routing.prefixes') and forces user to input it if not enabled

Returns
string
Admin route to use

securityCipherSeed() public ¶

securityCipherSeed( string $path )

Generates and writes 'Security.cipherSeed'

Parameters
string $path
Project path
Returns
boolean
Success

securitySalt() public ¶

securitySalt( string $path )

Generates and writes 'Security.salt'

Parameters
string $path
Project path
Returns
boolean
Success

Properties detail

$configPath ¶

public string

configs path (used in testing).

null
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