Class ProjectTask
Task class for creating new project apps and plugins
- AppShell
- ProjectTask
Copyright: Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Console/Command/Task/ProjectTask.php
Properties summary
-
$configPath
publicstring
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. A default home page will be added, and the tmp file storage will be chmod'ed to 0777.
-
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 -
createHome() public
Writes a file with a default home page to the project. -
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
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. A default home page will be added, and the tmp file storage will be chmod'ed to 0777.
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
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
Success
cakeOnIncludePath() public ¶
cakeOnIncludePath( )
Checks PHP's include_path for CakePHP.
Returns
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
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
- Wether or not define calls should be hardcoded.
Returns
Success
createHome() public ¶
createHome( string $dir )
Writes a file with a default home page to the project.
Parameters
- string $dir
- Path to project
Returns
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
getPrefix() public ¶
getPrefix( )
Checks for Configure::read('Routing.prefixes') and forces user to input it if not enabled
Returns
Admin route to use
securityCipherSeed() public ¶
securityCipherSeed( string $path )
Generates and writes 'Security.cipherSeed'
Parameters
- string $path
- Project path
Returns
Success
securitySalt() public ¶
securitySalt( string $path )
Generates and writes 'Security.salt'
Parameters
- string $path
- Project path
Returns
Success