<?php
// This is the configuration for yiic console application.
// Any writable CConsoleApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Console Application',
// application components
// 自动载入的模型和组件类
'import'=>array(
'application.models.*',//载入"application/models/"文件夹下的所有模型类
'application.components.*',//载入"application/components/"文件夹下的所有应用组件类
'application.extensions.*',//载入"application/extensions/"文件夹下的所有应用组件类
),
'components'=>array(
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=dbname',//连接mysql数据库
'emulatePrepare' => true,
'username' => 'root',//MySQL数据库用户名
'password' => '123456',//MySQL数据库用户密码
'charset' => 'utf8',//MySQL数据库编码
'tablePrefix' => 'zd_', //MySQL数据库表前缀
'enableProfiling'=>true,
'enableParamLogging'=>true,
),
//加载Email组件
'mailer' => array(
'class' => 'application.extensions.mailer.EMailer',
),
),
);
<?php
/**
* 自动运行文件
*/
class GoCommand extends CConsoleCommand
{
/**
* 死循环输出
*/
public function run(){
for($i=1;$i>0;$i++){
self::echoWord($i);
sleep(2);//休眠2秒
//跳出
if(i==500){
break;
}
}
}
/**
* 输出hollo word
*/
public function echoWord($i){
echo "hollo word --$i\n";
}
}
E:\project\app\protected>yiic Yii command runner (based on Yii v1.1.12) Usage: E:\zeee\zyd\protected\yiic.php <command-name> [parameters...] The following commands are available: - go - mailqueue - message - migrate - shell - webapp To see individual command help, use the following:
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有