承接 contao-community-alliance/console 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

contao-community-alliance/console

Composer 安装命令:

composer require contao-community-alliance/console

包简介

CLI console application for Contao Open Source CMS

README 文档

README

Register you console command classes in $GLOBALS['CONSOLE_CMD'] within your config.php.

config.php

<?php

$GLOBALS['CONSOLE_CMD'][] = 'Acme\Command\GreetCommand';

GreetCommand.php

<?php

namespace = Acme\Command;

class GreetCommand extends \Symfony\Component\Console\Command\Command
{
	protected function configure()
	{
		$this
			->setName('demo:greet')
			->setDescription('Greet someone')
			->addArgument(
				'name',
				InputArgument::OPTIONAL,
				'Who do you want to greet?'
			)
			->addOption(
				'yell',
				null,
				InputOption::VALUE_NONE,
				'If set, the task will yell in uppercase letters'
			)
		;
	}

	protected function execute(InputInterface $input, OutputInterface $output)
	{
		$name = $input->getArgument('name');
		if ($name) {
			$text = 'Hello '.$name;
		} else {
			$text = 'Hello';
		}

		if ($input->getOption('yell')) {
			$text = strtoupper($text);
		}

		$output->writeln($text);
	}
}

If you need a more complex setup routine, use the initializeConsole hook.

config.php

<?php

$GLOBALS['TL_HOOKS']['initializeConsole'][] = array('Acme\Console', 'myInitializeConsole');

Console.php

<?php

namespace Acme;

use Symfony\Component\Console\Application;
use Acme\Command\GreetCommand;

class Console
{
	public function myInitializeConsole(Application $application)
	{
		$application->add(new GreetCommand());
	}
}

For details see http://symfony.com/doc/2.3/components/console/introduction.html

统计信息

  • 总下载量: 3.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2014-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固