当前位置: 首页>>代码示例>>PHP>>正文


PHP Console::output方法代码示例

本文整理汇总了PHP中yii\helpers\Console::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Console::output方法的具体用法?PHP Console::output怎么用?PHP Console::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\helpers\Console的用法示例。


在下文中一共展示了Console::output方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendMessageAsync

 /**
  *
  * @param \talview\sesmailer\Message $message
  *
  * @return bool
  */
 protected function sendMessageAsync($message)
 {
     try {
         return $this->client->sendRawEmailAsync(['RawMessage' => ['Data' => base64_encode($message->getSwiftMessage())]]);
     } catch (SesException $e) {
         Console::output($e->getMessage());
         Yii::error($e->getMessage());
     }
     return false;
 }
开发者ID:talview,项目名称:yii2-sesmailer,代码行数:16,代码来源:Mailer.php

示例2: actionInit

 public function actionInit()
 {
     $auth = Yii::$app->authManager;
     $user = $auth->createRole(User::ROLE_USER);
     $auth->add($user);
     Console::output('Success! RBAC roles has been added.');
 }
开发者ID:vitalik74,项目名称:gosman-test-app,代码行数:7,代码来源:RbacController.php

示例3: actionInit

 public function actionInit()
 {
     $auth = Yii::$app->authManager;
     $auth->removeAll();
     $user = $auth->createRole(User::ROLE_USER);
     $user->description = 'User';
     $auth->add($user);
     // own model rule
     $ownModelRule = new OwnModelRule();
     $auth->add($ownModelRule);
     $manager = $auth->createRole(User::ROLE_MANAGER);
     $manager->description = 'Manager';
     $auth->add($manager);
     $auth->addChild($manager, $user);
     $loginToBackend = $auth->createPermission('loginToBackend');
     $loginToBackend->description = 'Login to backend';
     $auth->add($loginToBackend);
     $auth->addChild($manager, $loginToBackend);
     $admin = $auth->createRole(User::ROLE_ADMINISTRATOR);
     $admin->description = 'Administrator';
     $auth->add($admin);
     $auth->addChild($admin, $manager);
     $auth->assign($admin, 1);
     Console::output('Success! RBAC roles has been added.');
 }
开发者ID:beaten-sect0r,项目名称:yii2-core,代码行数:25,代码来源:RbacController.php

示例4: initRbac

 /**
  * 初始默认角色数据
  */
 public function initRbac()
 {
     Console::output('初始化RBAC数据 ....');
     $auth = Yii::$app->authManager;
     /* ================= 权限 ================= */
     $visitAdmin = $auth->createPermission('visitAdmin');
     $visitAdmin->description = '访问后台管理界面权限';
     $auth->add($visitAdmin);
     /* ================= 身份 ================= */
     $guest = $auth->createRole('guest');
     // 匿名用户
     $guest->description = '匿名用户';
     $auth->add($guest);
     $user = $auth->createRole('user');
     //普通用户
     $user->description = '普通用户';
     $auth->add($user, $guest);
     //普通用户 > 匿名用户
     $admin = $auth->createRole('admin');
     // 管理员
     $admin->description = '管理员';
     $auth->add($admin);
     $auth->addChild($admin, $user);
     // 管理员 > 普通用户
     $auth->addChild($admin, $visitAdmin);
     // 管理员可以访问后台
     $founder = $auth->createRole('founder');
     // 创始人
     $founder->description = '创始人';
     $auth->add($founder);
     $auth->addChild($founder, $admin);
     // 创始人 > 管理员
     Console::output('初始化RBAC数据完成 ....');
 }
开发者ID:rocketyang,项目名称:huajuan,代码行数:37,代码来源:m150106_020316_initRbacTable.php

示例5: actionInit

 public function actionInit()
 {
     $auth = Yii::$app->authManager;
     $auth->removeAll();
     $user = $auth->createRole(User::ROLE_USER);
     $auth->add($user);
     // own model rule
     $ownModelRule = new OwnModelRule();
     $auth->add($ownModelRule);
     $manager = $auth->createRole(User::ROLE_MANAGER);
     $auth->add($manager);
     $auth->addChild($manager, $user);
     $loginToBackend = $auth->createPermission('loginToBackend');
     $auth->add($loginToBackend);
     $auth->addChild($manager, $loginToBackend);
     $publisher = $auth->createRole(User::ROLE_PUBLISHER);
     $auth->add($publisher);
     $auth->addChild($publisher, $loginToBackend);
     $advertiser = $auth->createRole(User::ROLE_ADVERTISER);
     $auth->add($advertiser);
     $auth->addChild($advertiser, $loginToBackend);
     $admin = $auth->createRole(User::ROLE_ADMINISTRATOR);
     $auth->add($admin);
     $auth->addChild($admin, $manager);
     $auth->assign($admin, 1);
     $auth->assign($manager, 2);
     $auth->assign($user, 3);
     $auth->assign($publisher, 4);
     $auth->assign($advertiser, 5);
     Console::output('Success! RBAC roles has been added.');
 }
开发者ID:Sywooch,项目名称:AVSProduct,代码行数:31,代码来源:RbacController.php

示例6: actionInit

 public function actionInit()
 {
     $auth = Yii::$app->authManager;
     $auth->removeAll();
     $user = $auth->createRole(User::ROLE_USER);
     $auth->add($user);
     // own model rule
     $ownModelRule = new OwnModelRule();
     $auth->add($ownModelRule);
     $submissionRule = new SubmissionRule();
     $auth->add($submissionRule);
     $updateOwnResearch = $auth->createPermission('updateOwnResearch');
     $updateOwnResearch->description = 'update research by status';
     $updateOwnResearch->ruleName = $submissionRule->name;
     $auth->add($updateOwnResearch);
     $auth->addChild($user, $updateOwnResearch);
     $manager = $auth->createRole(User::ROLE_MANAGER);
     $auth->add($manager);
     $auth->addChild($manager, $user);
     $loginToBackend = $auth->createPermission('loginToBackend');
     $auth->add($loginToBackend);
     $auth->addChild($manager, $loginToBackend);
     $admin = $auth->createRole(User::ROLE_ADMINISTRATOR);
     $auth->add($admin);
     $auth->addChild($admin, $manager);
     $auth->assign($admin, 1);
     $auth->assign($manager, 2);
     $auth->assign($user, 3);
     Console::output('Success! RBAC roles has been added.');
 }
开发者ID:khonkaen-hospital,项目名称:KIRB,代码行数:30,代码来源:RbacController.php

示例7: actionInit

 public function actionInit()
 {
     $auth = Yii::$app->authManager;
     $auth->removeAll();
     Console::output('Removing All! RBAC.....');
     $manageUser = $auth->createRole('ManageUser');
     $manageUser->description = 'สำหรับจัดการข้อมูลผู้ใช้งาน';
     $auth->add($manageUser);
     $author = $auth->createRole('Author');
     $author->description = 'สำหรับการเขียนบทความ';
     $auth->add($author);
     $management = $auth->createRole('Management');
     $management->description = 'สำหรับจัดการข้อมูลผู้ใช้งานและบทความ';
     $auth->add($management);
     $admin = $auth->createRole('Admin');
     $admin->description = 'สำหรับการดูแลระบบ';
     $auth->add($admin);
     $auth->addChild($management, $manageUser);
     $auth->addChild($management, $author);
     $auth->addChild($admin, $management);
     $auth->assign($admin, 1);
     $auth->assign($management, 2);
     $auth->assign($author, 3);
     Console::output('Success! RBAC roles has been added.');
 }
开发者ID:veegithub,项目名称:yii2basic,代码行数:25,代码来源:RbacController.php

示例8: setExecutable

 public function setExecutable($paths)
 {
     foreach ($paths as $executable) {
         $executable = Yii::getAlias($executable);
         Console::output("Setting executable: {$executable}");
         @chmod($executable, 0755);
     }
 }
开发者ID:richardcj,项目名称:walle-web,代码行数:8,代码来源:RunController.php

示例9: dropTableIfExist

 public function dropTableIfExist($table)
 {
     if ($this->tableExist($table)) {
         return $this->dropTable($table);
     } else {
         Console::output('Table "' . $table . '" not found');
     }
 }
开发者ID:NullRefExcep,项目名称:yii2-core,代码行数:8,代码来源:MigrationTrait.php

示例10: actionCron

 public function actionCron()
 {
     $time = new \DateTime('now');
     foreach ($this->getScheduler()->all() as $task) {
         if ($this->getScheduler()->handle($task, $time)) {
             Console::output("Executed " . $task->getKey());
         }
     }
 }
开发者ID:understeam,项目名称:yii2-command-scheduler,代码行数:9,代码来源:SchedulerController.php

示例11: export

 /**
  * @inheritdoc
  */
 public function export()
 {
     foreach ($this->messages as $message) {
         if ($message[1] == Logger::LEVEL_ERROR) {
             Console::error($this->formatMessage($message));
         } else {
             Console::output($this->formatMessage($message));
         }
     }
 }
开发者ID:wirwolf,项目名称:yii2-consolelog,代码行数:13,代码来源:ConsoleTarget.php

示例12: actionList

 public function actionList()
 {
     Console::output("Currently waiting exports:");
     /** @var ActiveQuery $exportRequests */
     $requestsQuery = ExportRequest::find()->where(['is_exported' => 0])->orderBy(['created_at' => SORT_ASC]);
     foreach ($requestsQuery->each() as $exportRequest) {
         /** @var ExportRequest $exportRequest */
         Console::output("[#" . $exportRequest->id . ": " . $exportRequest->created_at . "] - " . $exportRequest->data_raw);
     }
 }
开发者ID:omnilight,项目名称:yz2-admin-export,代码行数:10,代码来源:ExportController.php

示例13: actionModule

 /**
  * Установка модуля
  * 
  * - запуск миграций
  * - запуск установщика модуля
  * 
  * @param string $module ID модуля
  */
 public function actionModule($packageName, $installationPath = null)
 {
     if (!is_dir($installationPath)) {
         $installationPath = FileHelper::normalizePath(Yii::getAlias('@vendor' . '/' . $packageName), '/');
     }
     $installationFile = $installationPath . '/Install.php';
     $basePath = dirname(Yii::getAlias('@vendor'));
     $io = new Console();
     if (file_exists($installationFile)) {
         $io->output("> installation file: " . $installationFile);
         $installerClass = (require_once $installationFile);
         $installer = new $installerClass(array('yiiConsoleApp' => Yii::$app, 'path' => $installationPath, 'name' => $packageName, 'io' => $io, 'migrationPath' => InstallHelper::getMigrationPath($basePath), 'configPath' => InstallHelper::getYiipConfigPath($basePath) . $packageName));
         $installer->install();
         $io->output("---");
         $io->output("");
     } else {
         $io->output("> no installation file");
         $io->output("");
     }
 }
开发者ID:podvincev-n,项目名称:yii2-app-base,代码行数:28,代码来源:InstallController.php

示例14: initUserMenu

 /**
  * 初始化后台用户菜单
  */
 public function initUserMenu()
 {
     Console::output('注册用户模块后台管理菜单 ....');
     //用户
     Menu::set('user', ['label' => '用户管理', 'url' => ['/admin/user/index'], 'icon' => 'fa-user', 'priority' => 100]);
     //rbac
     Menu::set('rbac', ['label' => '角色权限', 'icon' => 'fa-group', 'priority' => 100]);
     Menu::set('rbac.roles', ['label' => '角色列表', 'url' => ['/admin/role/index'], 'priority' => 101]);
     Menu::set('rbac.permissions', ['label' => '权限列表', 'url' => ['/admin/permission/index'], 'priority' => 102]);
     Console::output('注册用户模块后台管理菜单完成 ....');
 }
开发者ID:rocketyang,项目名称:huajuan,代码行数:14,代码来源:m150113_144206_initAdmin.php

示例15: install

 public function install()
 {
     parent::install();
     if (Console::confirm('Create upload folder?')) {
         try {
             $this->createFolder('@webroot/uploads');
             Console::output('Folder @webroot/uploads was created');
         } catch (\Exception $e) {
             Console::output($e->getMessage());
         }
     }
 }
开发者ID:NullRefExcep,项目名称:yii2-cms,代码行数:12,代码来源:Installer.php


注:本文中的yii\helpers\Console::output方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。