本文整理汇总了PHP中Shell::startup方法的典型用法代码示例。如果您正苦于以下问题:PHP Shell::startup方法的具体用法?PHP Shell::startup怎么用?PHP Shell::startup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shell
的用法示例。
在下文中一共展示了Shell::startup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startup
/**
* Override startup of the Shell
*
*/
public function startup()
{
parent::startup();
if (isset($this->params['connection'])) {
$this->connection = $this->params['connection'];
}
if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) {
$out = "--------------------------------------------------\n";
$out .= __('Error: Your current Cake configuration is set to') . "\n";
$out .= __('an ACL implementation other than DB. Please change') . "\n";
$out .= __('your core config to reflect your decision to use') . "\n";
$out .= __('DbAcl before attempting to use this script') . ".\n";
$out .= "--------------------------------------------------\n";
$out .= __('Current ACL Classname: %s', Configure::read('Acl.classname')) . "\n";
$out .= "--------------------------------------------------\n";
$this->err($out);
$this->_stop();
}
if ($this->command) {
if (!config('database')) {
$this->out(__('Your database configuration was not found. Take a moment to create one.'), true);
$this->args = null;
return $this->DbConfig->execute();
}
require_once CONFIGS . 'database.php';
if (!in_array($this->command, array('initdb'))) {
$collection = new ComponentCollection();
$this->Acl = new AclComponent($collection);
$controller = null;
$this->Acl->startup($controller);
}
}
}
示例2: startup
/**
* Create the configuration object used in other classes.
*
*/
public function startup()
{
parent::startup();
AssetConfig::clearAllCachedKeys();
$this->_Config = AssetConfig::buildFromIniFile($this->params['config']);
$this->AssetBuild->setThemes($this->_findThemes());
$this->out();
}
示例3: startup
/**
*
*/
public function startup()
{
parent::startup();
if (!empty($this->params['y']) && !is_bool($this->params['y'])) {
array_unshift($this->args, $this->params['y']);
$this->interactive = false;
}
}
示例4: startup
/**
* Start up And load Acl Component / Aco model
*
* @return void
**/
public function startup()
{
parent::startup();
$collection = new ComponentCollection();
$this->Acl = new AclComponent($collection);
$controller = null;
$this->Acl->startup($controller);
$this->Aco = $this->Acl->Aco;
}
示例5: startup
/**
* Shell startup, prints info message about dry run.
*
* @return void
*/
public function startup() {
parent::startup();
if ($this->params['dry-run']) {
$this->out(__d('cake_console', '<warning>Dry-run mode enabled!</warning>'), 1, Shell::QUIET);
}
if ($this->params['git'] && !is_dir('.git')) {
$this->out(__d('cake_console', '<warning>No git repository detected!</warning>'), 1, Shell::QUIET);
}
}
示例6: startup
/**
* Create the configuration object used in other classes.
*
*/
public function startup()
{
parent::startup();
$config = null;
if (isset($this->params['config'])) {
$config = $this->params['config'];
}
AssetConfig::clearAllCachedKeys();
$this->_Config = AssetConfig::buildFromIniFile($config);
}
示例7: startup
/**
* Assign $this->connection to the active task if a connection param is set.
*
*/
public function startup()
{
parent::startup();
$task = Inflector::classify($this->command);
if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig'))) {
if (isset($this->params['connection'])) {
$this->{$task}->connection = $this->params['connection'];
}
}
}
示例8: startup
/**
* Loads database settings, disables console colors if requested, and
* prevents re-entry if the current command is locked.
*
* @return void
*/
function startup()
{
if (empty($this->Setting)) {
App::uses('ClassRegistry', 'Utility');
$this->Setting = ClassRegistry::init('Setting');
}
$this->Setting->load();
$this->_checkColors();
$this->_checkLock();
parent::startup();
}
示例9: startup
/**
* Assign $this->connection to the active task if a connection param is set.
*
* @return void
*/
public function startup()
{
parent::startup();
Configure::write('debug', 2);
Configure::write('Cache.disable', 1);
$task = Inflector::classify($this->command);
if (isset($this->{$task}) && !in_array($task, array('DbConfig'))) {
if (isset($this->params['connection'])) {
$this->{$task}->connection = $this->params['connection'];
}
}
}
示例10: startup
public function startup()
{
parent::startup();
if (!empty($this->params['directory'])) {
$this->directory = $this->params['directory'];
} else {
$this->directory = APP . 'config' . DS . 'schema' . DS . 'data';
}
$this->directory .= DS;
if (!empty($this->params['connection'])) {
$connection = $this->params['connection'];
}
if (empty($this->params['name']) && !empty($this->args[0])) {
$this->params['name'] = $this->args[0];
}
}
示例11: startup
/**
* Startup script
*
* @return void
* @access public
*/
function startup()
{
$this->_paramsParsing();
$this->_startDBConfig();
$this->_readPathInfo();
if (empty($this->_versions)) {
$last = __d('migrations', 'Nothing installed.', true);
} else {
$last = end($this->_versions);
$this->lastVersion = $last['SchemaMigration']['version'];
$last = date(__d('migrations', 'm/d/Y H:i:s', true), $last['SchemaMigration']['version']);
}
parent::startup();
$this->out(__d('migrations', 'Migrations Shell', true));
$this->hr();
$this->out(String::insert(__d('migrations', 'Path to migrations classes: :path', true), array('path' => $this->path)));
$this->out(String::insert(__d('migrations', 'Connection to the database: :connection', true), array('connection' => $this->connection)));
$this->out(String::insert(__d('migrations', 'Last migration installed: :date', true), array('date' => $last)));
$this->hr();
}
示例12: startup
/**
* startup method
*
* @return void
**/
function startup()
{
App::import('Model', 'Model', false);
parent::startup();
}
示例13: startup
/**
* Startup
*
* @access public
* @return void
*/
function startup()
{
$this->verbose = isset($this->params['verbose']);
$this->quiet = isset($this->params['quiet']);
parent::startup();
}
示例14: startup
/**
* startup
*
*/
public function startup()
{
parent::startup();
}
示例15: startup
/**
* Start up And load Acl Component / Aco model
*
* @return void
**/
public function startup()
{
parent::startup();
$this->_UsersOperator->startup();
$this->stdout->styles('ok', array('text' => 'green', 'blink' => true));
}