2017 © Pedro Peláez
 

yii2-extension yii2-project-scanner

Yii2 Project Scanner Extension

image

lajax/yii2-project-scanner

Yii2 Project Scanner Extension

  • Tuesday, September 6, 2016
  • by lajax
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2 Project Scanner

Yii2 Project Scanner Extension, (*1)

Installation

composer

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

composer require lajax/yii2-project-scanner

or add, (*4)

"lajax/yii2-project-scanner": "^1.0.0"

to the require section of your composer.json file., (*5)

Usage

Configs

Minimal configs

[
    'components' => [
        // ...
        'scanner' =>  lajax\projectscanner\Scanner::className(),
        // ...
    ],
],

Full configs

[
    'components' => [
        // ...
        'scanner' =>  [
            'class' => lajax\projectscanner\Scanner::className(),
            'scanTimeLimit' => null,
            'ignoredCategories' => [],
            'ignoredItems' => [
                '.svn',
                '.git',
                '.gitignore',
                '.gitattributes',
                '.gitkeep',
                '.hgignore',
                '.hgkeep',
                '/messages',
                '/BaseYii.php',
                'runtime',
                'bower',
                'nikic',
            ],
            'roots' => [
                '@backend',
                '@common',
                '@console',
                '@frontend',
                '@vendor',
            ],
            'scanners' => [
                'dbScanner' => [
                    'class' => lajax\projectscanner\scanners\DbScanner::className(),
                    'category' => 'database',
                    'tables' => [
                        [
                            'connection' => 'db',
                            'table' => 'language',
                            'columns' => ['name', 'name_ascii'],
                            'category' => 'tableName',
                        ],
                        [
                            'connection' => 'db',
                            'table' => 'tag',
                            'columns' => ['name'],
                            'category' => 'tableName',
                        ],
                        [
                            'connection' => 'db',
                            'table' => 'category',
                            'columns' => ['name', 'description'],
                        ],
                    ],
                ],
                'jsScanner' => [
                    'class' => lajax\projectscanner\scanners\JsScanner::className(),
                    'extension' => '*.js',
                    'translators' => ['lajax.t'],
                    'category' => 'javascript',

                ],
                'phpArrayScanner' => [
                    'class' => lajax\projectscanner\scanners\PhpArrayScanner::className(),
                    'extension' => '*.php',
                    'category' => 'array',
                    'patternArrayTranslator' => '#\@translate[^\$]+(?P<translator>[\w\d\s_]+[^\(\[]+)#s',

                ],
                'phpFunctionScanner' => [
                    'class' => lajax\projectscanner\scanners\PhpFunctionScanner::className(),
                    'extension' => '*.php',
                    'translators' => ['::t'],
                ],
            ],
        ],
        // ...
    ],
],

##Scanning project

```php
$scannerResult = \Yii::$app->scanner->execute();

result

$scannerResult->languageElements;       *Array* List of language elements.
                                        [
                                            ['category' => 'messageCategory', 'message' => 'languageElement'],
                                            ['category' => 'messageCategory', 'message' => 'languageElement'],
                                            // ...
                                        ]
$scannerResult->numberOfLanguageElements;  *Integer* Number of language elements.

$scannerResult->filteredLanguageElements;   *Array* List of language elements.
                                        [
                                            'messageCategory' => [
                                                'languageElement' => true
                                            ]
                                        ]
                                        [
                                            'messageCategory' => [
                                                'languageElement' => true
                                            ]
                                        ]
                                        [
                                            'messageCategory' => [
                                                'languageElement' => true
                                            ]
                                        ]

The Versions

06/09 2016

dev-master

9999999-dev

Yii2 Project Scanner Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Lajos Molnar

filesystem extension yii2 scanner project-scanner

06/09 2016

1.0.0

1.0.0.0

Yii2 Project Scanner Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Lajos Molnar

filesystem extension yii2 scanner project-scanner