On this page
Class ProjectTask
Task class for creating new project apps and plugins
- AppShell
- ProjectTask 
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/Command/Task/ProjectTask.php
Properties summary
- 
    $configPathpublicconfigs path (used in testing).string
Method Summary
- 
    _replaceCorePath() protectedReplaces the CAKE_PATH placeholder in the template files.
- 
    bake() publicLooks 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() publicWrites cache prefix using app's name
- 
    cakeAdmin() publicEnables Configure::read('Routing.prefixes') in /app/Config/core.php
- 
    cakeOnIncludePath() publicChecks PHP's include_path for CakePHP.
- 
    consolePath() publicGenerates the correct path to the CakePHP libs that are generating the project and points app/console/cake.php to the right place 
- 
    corePath() publicGenerates and writes CAKE_CORE_INCLUDE_PATH
- 
    execute() publicChecks that given project path does not already exist, and finds the app directory in it. Then it calls bake() with that information. 
- 
    getOptionParser() publicGets the option parser instance and configures it.
- 
    getPrefix() publicChecks for Configure::read('Routing.prefixes') and forces user to input it if not enabled
- 
    securityCipherSeed() publicGenerates and writes 'Security.cipherSeed'
- 
    securitySalt() publicGenerates and writes 'Security.salt'
Method Detail
_replaceCorePath()source 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
booleanSuccess
bake()source 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 $skeloptional null
- Path to copy from
- 
     string $skipoptional array('empty')
- array of directories to skip when copying
Returns
mixedcachePrefix()source public
cachePrefix( string $dir )Writes cache prefix using app's name
Parameters
- 
     string $dir
- Path to project
Returns
booleanSuccess
cakeAdmin()source public
cakeAdmin( string $name )Enables Configure::read('Routing.prefixes') in /app/Config/core.php
Parameters
- 
     string $name
- Name to use as admin routing
Returns
booleanSuccess
cakeOnIncludePath()source public
cakeOnIncludePath( )Checks PHP's include_path for CakePHP.
Returns
booleanIndicates whether or not CakePHP exists on include_path
consolePath()source 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
booleansuccess
corePath()source public
corePath( string $path , boolean $hardCode true )Generates and writes CAKE_CORE_INCLUDE_PATH
Parameters
- 
     string $path
- Project path
- 
     boolean $hardCodeoptional true
- Whether or not define calls should be hardcoded.
Returns
booleanSuccess
execute()source 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
mixedgetOptionParser()source public
getOptionParser( )Gets the option parser instance and configures it.
Returns
ConsoleOptionParsergetPrefix()source public
getPrefix( )Checks for Configure::read('Routing.prefixes') and forces user to input it if not enabled
Returns
stringAdmin route to use
securityCipherSeed()source public
securityCipherSeed( string $path )Generates and writes 'Security.cipherSeed'
Parameters
- 
     string $path
- Project path
Returns
booleanSuccess
securitySalt()source public
securitySalt( string $path )Generates and writes 'Security.salt'
Parameters
- 
     string $path
- Project path
Returns
booleanSuccess
Properties detail
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
 https://api.cakephp.org/2.10/class-ProjectTask.html