🐘 ClearCaches.php (Php) 1.1 KB 2016-05-21
PHP module for ClearCaches
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Filesystem;
use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class ClearCaches extends ConsoleCommand
{
protected function configure()
{
$this->setName('core:clear-caches');
$this->setAliases(array('cache:clear'));
$this->setDescription('Cleares all caches. This command can be useful for instance after updating Piwik files manually.');
}
/**
* Execute command like: ./console core:clear-caches
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
// Note: the logic for this command must be refactored in this helper function below.
Filesystem::deleteAllCacheOnUpdate();
$this->writeSuccessMessage($output, array('Caches cleared'));
}
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "ClearCaches.php",
"description": "PHP module for ClearCaches",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.1 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/ClearCaches.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 CoreArchiver.php (Php) 7.6 KB 2016-05-21
PHP module for CoreArchiver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\CronArchive;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Site;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class CoreArchiver extends ConsoleCommand
{
protected function configure()
{
$this->configureArchiveCommand($this);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$archiver = self::makeArchiver($input->getOption('url'), $input);
$archiver->main();
}
// also used by another console command
public static function makeArchiver($url, InputInterface $input)
{
$archiver = new CronArchive();
$archiver->disableScheduledTasks = $input->getOption('disable-scheduled-tasks');
$archiver->acceptInvalidSSLCertificate = $input->getOption("accept-invalid-ssl-certificate");
$archiver->shouldArchiveAllSites = (bool) $input->getOption("force-all-websites");
$archiver->shouldStartProfiler = (bool) $input->getOption("xhprof");
$archiver->shouldArchiveSpecifiedSites = self::getSitesListOption($input, "force-idsites");
$archiver->shouldSkipSpecifiedSites = self::getSitesListOption($input, "skip-idsites");
$archiver->forceTimeoutPeriod = $input->getOption("force-timeout-for-periods");
$archiver->shouldArchiveAllPeriodsSince = $input->getOption("force-all-periods");
$archiver->restrictToDateRange = $input->getOption("force-date-range");
$archiver->phpCliConfigurationOptions = $input->getOption("php-cli-options");
$restrictToPeriods = $input->getOption("force-periods");
$restrictToPeriods = explode(',', $restrictToPeriods);
$archiver->restrictToPeriods = array_map('trim', $restrictToPeriods);
$archiver->dateLastForced = $input->getOption('force-date-last-n');
... [truncated, 73 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "CoreArchiver.php",
"description": "PHP module for CoreArchiver",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "7.6 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/CoreArchiver.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 DevelopmentEnable.php (Php) 1.6 KB 2016-05-21
PHP module for DevelopmentEnable
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Config;
use Piwik\Filesystem;
use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class DevelopmentEnable extends ConsoleCommand
{
protected function configure()
{
$this->setName('development:enable');
$this->setAliases(array('development:disable'));
$this->setDescription('Enable or disable development mode. See config/global.ini.php in section [Development] for more information');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$commandName = $input->getFirstArgument();
$enable = (false !== strpos($commandName, 'enable'));
$config = Config::getInstance();
$development = $config->Development;
if ($enable) {
$development['enabled'] = 1;
$development['disable_merged_assets'] = 1;
$message = 'Development mode enabled';
} else {
$development['enabled'] = 0;
$development['disable_merged_assets'] = 0;
$message = 'Development mode disabled';
}
$config->Development = $development;
$config->forceSave();
... [truncated, 7 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "DevelopmentEnable.php",
"description": "PHP module for DevelopmentEnable",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.6 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/DevelopmentEnable.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 DevelopmentManageTestFiles.php (Php) 1.9 KB 2016-05-21
PHP module for DevelopmentManageTestFiles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Development;
use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class DevelopmentManageTestFiles extends ConsoleCommand
{
public function isEnabled()
{
return Development::isEnabled();
}
protected function configure()
{
$this->setName('development:test-files');
$this->setDescription("Manage test files.");
$this->addArgument('operation', InputArgument::REQUIRED, 'The operation to apply. Supported operations include: '
. '"copy"');
$this->addOption('file', null, InputOption::VALUE_REQUIRED, "The file (or files) to apply the operation to.");
// TODO: allow copying by regex pattern
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$operation = $input->getArgument('operation');
if ($operation == 'copy') {
$this->copy($input, $output);
} else {
throw new \Exception("Invalid operation '$operation'.");
}
}
private function copy($input, $output)
{
$file = $input->getOption('file');
... [truncated, 16 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "DevelopmentManageTestFiles.php",
"description": "PHP module for DevelopmentManageTestFiles",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.9 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/DevelopmentManageTestFiles.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 DevelopmentSyncProcessedSystemTests.php (Php) 2.8 KB 2016-05-21
PHP module for DevelopmentSyncProcessedSystemTests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\Decompress\Tar;
use Piwik\Development;
use Piwik\Http;
use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class DevelopmentSyncProcessedSystemTests extends ConsoleCommand
{
private $targetDir = 'tests/PHPUnit/System/processed';
public function isEnabled()
{
return Development::isEnabled();
}
protected function configure()
{
$this->setName('development:sync-system-test-processed');
$this->setDescription('For Piwik core devs. Copies processed system tests from travis artifacts to ' . $this->targetDir);
$this->addArgument('buildnumber', InputArgument::REQUIRED, 'Travis build number you want to sync, eg "14820".');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$buildNumber = $input->getArgument('buildnumber');
$targetDir = PIWIK_INCLUDE_PATH . '/' . dirname($this->targetDir);
$tmpDir = StaticContainer::get('path.tmp');
$this->validate($buildNumber, $targetDir, $tmpDir);
if (Common::stringEndsWith($buildNumber, '.1')) {
// eg make '14820.1' to '14820' to be backwards compatible
$buildNumber = substr($buildNumber, 0, -2);
}
... [truncated, 35 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "DevelopmentSyncProcessedSystemTests.php",
"description": "PHP module for DevelopmentSyncProcessedSystemTests",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.8 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/DevelopmentSyncProcessedSystemTests.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateAngularDirective.php (Php) 4.9 KB 2016-05-21
PHP module for GenerateAngularDirective
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateAngularDirective extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:angular-directive')
->setDescription('Generates a template for an AngularJS directive')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin')
->addOption('directive', null, InputOption::VALUE_REQUIRED, 'The name of the directive you want to create.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$directive = $this->getDirectiveName($input, $output);
$pluginPath = $this->getPluginPath($pluginName);
$directiveLower = $this->getDirectiveComponentName($directive);
$targetDir = $pluginPath . '/angularjs/' . $directiveLower;
if (is_dir($targetDir) || file_exists($targetDir)) {
throw new \Exception('The AngularJS directive ' . $directiveLower . ' already exists in plugin ' . $pluginName);
}
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array(
'ExamplePlugin' => $pluginName,
'directive-component' => $directiveLower,
'componentClass' => lcfirst($directive),
'componentAs' => lcfirst($directive),
'component' => $directiveLower,
'Component' => $directive
);
... [truncated, 81 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateAngularDirective.php",
"description": "PHP module for GenerateAngularDirective",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "4.9 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateAngularDirective.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateApi.php (Php) 1.9 KB 2016-05-21
PHP module for GenerateApi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateApi extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:api')
->setDescription('Adds an API to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have an API yet');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array('ExamplePlugin' => $pluginName);
$whitelistFiles = array('/API.php');
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('API.php for %s generated.', $pluginName),
'You can now start adding API methods',
'Enjoy!'
));
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return array
* @throws \RuntimeException
*/
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateApi.php",
"description": "PHP module for GenerateApi",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.9 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateApi.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateArchiver.php (Php) 2.0 KB 2016-05-21
PHP module for GenerateArchiver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateArchiver extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:archiver')
->setDescription('Adds an Archiver to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have an Archiver yet');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array('ExamplePlugin' => $pluginName, 'EXAMPLEPLUGIN' => strtoupper($pluginName));
$whitelistFiles = array('/Archiver.php');
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('Archiver.php for %s generated.', $pluginName),
'You can now start implementing Archiver methods',
'Enjoy!'
));
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return array
* @throws \RuntimeException
*/
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateArchiver.php",
"description": "PHP module for GenerateArchiver",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateArchiver.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateCommand.php (Php) 3.5 KB 2016-05-21
PHP module for GenerateCommand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateCommand extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:command')
->setDescription('Adds a command to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin')
->addOption('command', null, InputOption::VALUE_REQUIRED, 'The name of the command you want to create');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$commandName = $this->getCommandName($input, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExampleCommand';
$replace = array(
'ExampleCommandDescription' => $commandName,
'ExampleCommand' => $pluginName,
'examplecommand:helloworld' => strtolower($pluginName) . ':' . $this->buildCommandName($commandName),
'examplecommand' => strtolower($pluginName),
'HelloWorld' => $commandName,
'helloworld' => strtolower($commandName)
);
$whitelistFiles = array('/Commands', '/Commands/HelloWorld.php');
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('Command %s for plugin %s generated', $commandName, $pluginName)
... [truncated, 55 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateCommand.php",
"description": "PHP module for GenerateCommand",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "3.5 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateCommand.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateController.php (Php) 2.0 KB 2016-05-21
PHP module for GenerateController
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateController extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:controller')
->setDescription('Adds a Controller to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have a Controller yet');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array('ExamplePlugin' => $pluginName);
$whitelistFiles = array('/Controller.php', '/templates', '/templates/index.twig');
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('Controller for %s generated.', $pluginName),
'You can now start adding Controller actions',
'Enjoy!'
));
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return array
* @throws \RuntimeException
*/
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateController.php",
"description": "PHP module for GenerateController",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateController.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateDimension.php (Php) 10.2 KB 2016-05-21
PHP module for GenerateDimension
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Common;
use Piwik\DbHelper;
use Piwik\Plugin\Report;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class GenerateDimension extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:dimension')
->setDescription('Adds a new dimension to an existing plugin. This allows you to persist new values during tracking.')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have a menu defined yet')
->addOption('type', null, InputOption::VALUE_REQUIRED, 'Whether you want to create a "Visit", an "Action" or a "Conversion" dimension')
->addOption('dimensionname', null, InputOption::VALUE_REQUIRED, 'A human readable name of the dimension which will be for instance visible in the UI')
->addOption('columnname', null, InputOption::VALUE_REQUIRED, 'The name of the column in the MySQL database the dimension will be stored under')
->addOption('columntype', null, InputOption::VALUE_REQUIRED, 'The MySQL type for your dimension, for instance "VARCHAR(255) NOT NULL".');
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @throws \InvalidArgumentException
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$type = $this->getDimensionType($input, $output);
$dimensionName = $this->getDimensionName($input, $output);
if ('non-tracking-dimension' === $type) {
$columnName = '';
$columType = '';
} else {
$columnName = $this->getColumnName($input, $output, $type);
$columType = $this->getColumnType($input, $output);
... [truncated, 210 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateDimension.php",
"description": "PHP module for GenerateDimension",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "10.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateDimension.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateMenu.php (Php) 1.9 KB 2016-05-21
PHP module for GenerateMenu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateMenu extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:menu')
->setDescription('Adds a plugin menu class to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have a menu defined yet');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array('ExamplePlugin' => $pluginName);
$whitelistFiles = array('/Menu.php');
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('Menu.php for %s generated.', $pluginName),
'You can now start defining your plugin menu',
'Enjoy!'
));
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return array
* @throws \RuntimeException
*/
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateMenu.php",
"description": "PHP module for GenerateMenu",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.9 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateMenu.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GeneratePlugin.php (Php) 7.0 KB 2016-05-21
PHP module for GeneratePlugin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Filesystem;
use Piwik\Plugins\ExamplePlugin\ExamplePlugin;
use Piwik\Version;
use Piwik\Plugin;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GeneratePlugin extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:plugin')
->setAliases(array('generate:theme'))
->setDescription('Generates a new plugin/theme including all needed files')
->addOption('name', null, InputOption::VALUE_REQUIRED, 'Plugin name ([a-Z0-9_-])')
->addOption('description', null, InputOption::VALUE_REQUIRED, 'Plugin description, max 150 characters')
->addOption('pluginversion', null, InputOption::VALUE_OPTIONAL, 'Plugin version')
->addOption('overwrite', null, InputOption::VALUE_NONE, 'Generate even if plugin directory already exists.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$isTheme = $this->isTheme($input);
$pluginName = $this->getPluginName($input, $output);
$description = $this->getPluginDescription($input, $output);
$version = $this->getPluginVersion($input, $output);
$this->generatePluginFolder($pluginName);
$plugin = new ExamplePlugin();
$info = $plugin->getInformation();
$exampleDescription = $info['description'];
if ($isTheme) {
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExampleTheme';
... [truncated, 161 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GeneratePlugin.php",
"description": "PHP module for GeneratePlugin",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "7.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GeneratePlugin.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GeneratePluginBase.php (Php) 11.8 KB 2016-05-21
PHP module for GeneratePluginBase
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Development;
use Piwik\Filesystem;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugin\Dependency;
use Piwik\Version;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
abstract class GeneratePluginBase extends ConsoleCommand
{
public function isEnabled()
{
return Development::isEnabled();
}
public function getPluginPath($pluginName)
{
return PIWIK_INCLUDE_PATH . $this->getRelativePluginPath($pluginName);
}
private function getRelativePluginPath($pluginName)
{
return '/plugins/' . $pluginName;
}
private function createFolderWithinPluginIfNotExists($pluginNameOrCore, $folder)
{
if ($pluginNameOrCore === 'core') {
$pluginPath = $this->getPathToCore();
} else {
$pluginPath = $this->getPluginPath($pluginNameOrCore);
}
if (!file_exists($pluginPath . $folder)) {
Filesystem::mkdir($pluginPath . $folder);
}
}
protected function createFileWithinPluginIfNotExists($pluginNameOrCore, $fileName, $content)
... [truncated, 297 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GeneratePluginBase.php",
"description": "PHP module for GeneratePluginBase",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "11.8 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GeneratePluginBase.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateReport.php (Php) 10.7 KB 2016-05-21
PHP module for GenerateReport
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Columns\Dimension;
use Piwik\Plugin\Manager;
use Piwik\Plugin\Report;
use Piwik\Translate;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class GenerateReport extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:report')
->setDescription('Adds a new report to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have a menu defined yet')
->addOption('reportname', null, InputOption::VALUE_REQUIRED, 'The name of the report you want to create')
->addOption('category', null, InputOption::VALUE_REQUIRED, 'The name of the category the report belongs to')
->addOption('dimension', null, InputOption::VALUE_OPTIONAL, 'The name of the dimension in case your report has a dimension')
->addOption('documentation', null, InputOption::VALUE_REQUIRED, 'A documentation that explains what your report is about');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$reportName = $this->getReportName($input, $output);
$category = $this->getCategory($input, $output, $pluginName);
$documentation = $this->getDocumentation($input, $output);
list($dimension, $dimensionClass) = $this->getDimension($input, $output, $pluginName);
$order = $this->getOrder($category);
$apiName = $this->getApiName($reportName);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExampleReport';
$replace = array('GetExampleReport' => ucfirst($apiName),
'getExampleReport' => lcfirst($apiName),
'getApiReport' => lcfirst($apiName),
'ExampleCategory' => $category,
... [truncated, 251 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateReport.php",
"description": "PHP module for GenerateReport",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "10.7 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateReport.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateScheduledTask.php (Php) 2.0 KB 2016-05-21
PHP module for GenerateScheduledTask
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateScheduledTask extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:scheduledtask')
->setDescription('Adds a tasks class to an existing plugin which allows you to specify scheduled tasks')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have any tasks defined yet');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array('ExamplePlugin' => $pluginName);
$whitelistFiles = array('/Tasks.php');
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('Tasks.php for %s generated.', $pluginName),
'You can now start specifying your scheduled tasks',
'Enjoy!'
));
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return array
* @throws \RuntimeException
*/
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateScheduledTask.php",
"description": "PHP module for GenerateScheduledTask",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateScheduledTask.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateSettings.php (Php) 2.0 KB 2016-05-21
PHP module for GenerateSettings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateSettings extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:settings')
->setDescription('Adds a plugin setting class to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin which does not have settings yet');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExampleSettingsPlugin';
$replace = array('ExampleSettingsPlugin' => $pluginName);
$whitelistFiles = array('/Settings.php');
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('Settings.php for %s generated.', $pluginName),
'You can now start defining your plugin settings',
'Enjoy!'
));
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return array
* @throws \RuntimeException
*/
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateSettings.php",
"description": "PHP module for GenerateSettings",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateSettings.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateTest.php (Php) 6.4 KB 2016-05-21
PHP module for GenerateTest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Common;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateTest extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:test')
->setDescription('Adds a test to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin')
->addOption('testname', null, InputOption::VALUE_REQUIRED, 'The name of the test to create')
->addOption('testtype', null, InputOption::VALUE_REQUIRED, 'Whether you want to create a "unit", "integration", "system", or "ui" test');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$testType = $this->getTestType($input, $output);
$testName = $this->getTestName($input, $output, $testType);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array(
'ExamplePlugin' => $pluginName,
'SimpleTest' => $testName,
'SimpleSystemTest' => $testName,
'SimpleUITest_spec.js' => $testName . '_spec.js',
'SimpleUITest' => $testName,
);
$whitelistFiles = $this->getTestFilesWhitelist($testType);
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$messages = array(
sprintf('Test %s for plugin %s generated.', $testName, $pluginName),
);
... [truncated, 147 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateTest.php",
"description": "PHP module for GenerateTest",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "6.4 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateTest.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateUpdate.php (Php) 3.8 KB 2016-05-21
PHP module for GenerateUpdate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Plugin;
use Piwik\Updater;
use Piwik\Version;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class GenerateUpdate extends GeneratePluginBase
{
protected function configure()
{
$this->setName('generate:update')
->setDescription('Adds a new update to an existing plugin or "core"')
->addOption('component', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin or "core"');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$component = $this->getComponent($input, $output);
$version = $this->getVersion($component);
$namespace = $this->getNamespace($component);
$className = $this->getUpdateClassName($component, $version);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array('Piwik\Plugins\ExamplePlugin\Updates' => $namespace,
'ExamplePlugin' => $component,
'Updates_0_0_2' => $className,
'0.0.2' => $version);
$whitelistFiles = array('/Updates', '/Updates/0.0.2.php');
$this->copyTemplateToPlugin($exampleFolder, $component, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
sprintf('Updates/%s.php for %s generated.', $version, $component),
'You should have a look at the method update() or getSql() now.',
'Enjoy!'
));
}
... [truncated, 73 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateUpdate.php",
"description": "PHP module for GenerateUpdate",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "3.8 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateUpdate.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateVisualizationPlugin.php (Php) 3.6 KB 2016-05-21
PHP module for GenerateVisualizationPlugin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GenerateVisualizationPlugin extends GeneratePlugin
{
protected function configure()
{
$this->setName('generate:visualizationplugin')
->setDescription('Generates a new visualization plugin including all needed files')
->addOption('name', null, InputOption::VALUE_REQUIRED, 'Plugin name ([a-Z0-9_-])')
->addOption('visualizationname', null, InputOption::VALUE_REQUIRED, 'Visualization name ([a-Z0-9])')
->addOption('description', null, InputOption::VALUE_REQUIRED, 'Plugin description, max 150 characters')
->addOption('pluginversion', null, InputOption::VALUE_OPTIONAL, 'Plugin version')
->addOption('full', null, InputOption::VALUE_OPTIONAL, 'If a value is set, an API and a Controller will be created as well. Option is only available for creating plugins, not for creating themes.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginName = $this->getPluginName($input, $output);
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
$description = $this->getPluginDescription($input, $output);
$version = $this->getPluginVersion($input, $output);
$visualizationName = $this->getVisualizationName($input, $output);
$this->generatePluginFolder($pluginName);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExampleVisualization';
$replace = array(
'SimpleTable' => $visualizationName,
'simpleTable' => lcfirst($visualizationName),
'Simple Table' => $this->makeTranslationIfPossible($pluginName, $visualizationName),
'ExampleVisualization' => $pluginName,
'ExampleVisualizationDescription' => $description
);
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles = array());
... [truncated, 45 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateVisualizationPlugin.php",
"description": "PHP module for GenerateVisualizationPlugin",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "3.6 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateVisualizationPlugin.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GenerateWidget.php (Php) 4.0 KB 2016-05-21
PHP module for GenerateWidget
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GenerateWidget.php",
"description": "PHP module for GenerateWidget",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "4.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GenerateWidget.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GitCommit.php (Php) 4.5 KB 2016-05-21
PHP module for GitCommit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Development;
use Piwik\Plugin\ConsoleCommand;
use Piwik\SettingsPiwik;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GitCommit extends ConsoleCommand
{
public function isEnabled()
{
return Development::isEnabled() && SettingsPiwik::isGitDeployment();
}
protected function configure()
{
$this->setName('git:commit')
->setDescription('Commit')
->addOption('message', 'm', InputOption::VALUE_REQUIRED, 'Commit Message');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$submodules = $this->getSubmodulePaths();
foreach ($submodules as $submodule) {
if (empty($submodule)) {
continue;
}
$status = $this->getStatusOfSubmodule($submodule);
if (false !== strpos($status, '?? ')) {
$output->writeln(sprintf('<error>%s has untracked files or folders. Delete or add them and try again.</error>', $submodule));
$output->writeln('<error>Status:</error>');
$output->writeln(sprintf('<comment>%s</comment>', $status));
return;
}
... [truncated, 99 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GitCommit.php",
"description": "PHP module for GitCommit",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "4.5 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GitCommit.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GitPull.php (Php) 1.6 KB 2016-05-21
PHP module for GitPull
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Plugin\ConsoleCommand;
use Piwik\SettingsPiwik;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GitPull extends ConsoleCommand
{
public function isEnabled()
{
return SettingsPiwik::isGitDeployment();
}
protected function configure()
{
$this->setName('git:pull');
$this->setDescription('Pull Piwik repo and all submodules');
}
protected function getBranchName()
{
$cmd = sprintf('cd %s && git rev-parse --abbrev-ref HEAD', PIWIK_DOCUMENT_ROOT);
$branch = shell_exec($cmd);
return trim($branch);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
if ('master' != $this->getBranchName()) {
$output->writeln('<info>Doing nothing because you are not on the master branch in super repo.</info>');
return;
}
$cmd = sprintf('cd %s && git checkout master && git pull && git submodule update --init --recursive --remote', PIWIK_DOCUMENT_ROOT);
$this->passthru($cmd, $output);
$cmd = 'git submodule foreach "(git checkout master; git pull)&"';
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GitPull.php",
"description": "PHP module for GitPull",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.6 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GitPull.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 GitPush.php (Php) 1.2 KB 2016-05-21
PHP module for GitPush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Development;
use Piwik\Plugin\ConsoleCommand;
use Piwik\SettingsPiwik;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class GitPush extends ConsoleCommand
{
public function isEnabled()
{
return Development::isEnabled() && SettingsPiwik::isGitDeployment();
}
protected function configure()
{
$this->setName('git:push');
$this->setDescription('Push Piwik repo and all submodules');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$cmd = sprintf('cd %s && git push --recurse-submodules=on-demand', PIWIK_DOCUMENT_ROOT);
$output->writeln('Executing command: ' . $cmd);
passthru($cmd);
}
private function hasUnpushedCommits()
{
$cmd = sprintf('cd %s && git log @{u}..',PIWIK_DOCUMENT_ROOT);
$hasUnpushedCommits = shell_exec($cmd);
$hasUnpushedCommits = trim($hasUnpushedCommits);
return !empty($hasUnpushedCommits);
}
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GitPush.php",
"description": "PHP module for GitPush",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/GitPush.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 ManagePlugin.php (Php) 3.7 KB 2016-05-21
PHP module for ManagePlugin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugins\CorePluginsAdmin\Commands\ActivatePlugin;
use Piwik\Plugins\CorePluginsAdmin\Commands\DeactivatePlugin;
use Piwik\Plugins\CorePluginsAdmin\Commands\ListPlugins;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
* core:plugin console command.
*
* @deprecated This command has been replaced with `plugin:*` commands.
*/
class ManagePlugin extends ConsoleCommand
{
private $operations = array();
protected function configure()
{
$this->setName('core:plugin');
$this->setDescription("Perform various actions regarding one or more plugins.");
$this->addArgument("operation", InputArgument::REQUIRED, "Operation to apply (can be 'activate' or 'deactivate' or 'list').");
$this->addArgument("plugins", InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Plugin name(s) to activate.');
$this->addOption('domain', null, InputOption::VALUE_REQUIRED, "The domain to activate the plugin for.");
$this->operations['activate'] = 'activatePlugin';
$this->operations['deactivate'] = 'deactivatePlugin';
$this->operations['list'] = 'listPlugins';
}
/**
* Execute command like: ./console core:plugin activate CustomAlerts --piwik-domain=testcustomer.piwik.pro
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$operation = $input->getArgument("operation");
$plugins = $input->getArgument('plugins');
... [truncated, 58 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "ManagePlugin.php",
"description": "PHP module for ManagePlugin",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "3.7 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/ManagePlugin.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}
🐘 WatchLog.php (Php) 933 bytes 2016-05-21
PHP module for WatchLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Container\StaticContainer;
use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
*/
class WatchLog extends ConsoleCommand
{
protected function configure()
{
$this->setName('log:watch');
$this->setDescription('Outputs the last parts of the log files and follows as the log file grows. Does not work on Windows');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$path = StaticContainer::get('path.tmp') . '/logs/';
$cmd = sprintf('tail -f %s*.log', $path);
$output->writeln('Executing command: ' . $cmd);
passthru($cmd);
}
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "WatchLog.php",
"description": "PHP module for WatchLog",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "933 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/Commands/WatchLog.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/plugins/CoreConsole/"
}