PHP code example of ezsystems / profiler-bundle

1. Go to this page and download the library: Download ezsystems/profiler-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ezsystems / profiler-bundle example snippets


   new eZ\Publish\ProfilerBundle\EzPublishProfilerBundle(),

    $articleType = new ContentType(
        'article',
        [
            'title' => new Field\TextLine(),
            'body' => new Field\XmlText( new DataProvider\XmlText() ),
            'author' => new Field\Author( new DataProvider\User( 'editor' ) ),
            // …
        ],
        [$defaultLanguage, 'ger-DE', 'fra-FR'], // Languages of content
        8 // Average number of versions
    );

    $createTask = new Task(
        new Actor\Create(
            1, $folderType,
            new Actor\Create(
                12, $folderType,
                new Actor\Create(
                    50, $articleType,
                    new Actor\Create(
                        5, $commentType
                    ),
                    $articles = new Storage\LimitedRandomized()
                )
            )
        )
    );

    $viewTask = new Task(
        new Actor\SubtreeView(
            $articles
        )
    );

    $executor->run(
        array(
            new Constraint\Ratio( $createTask, 1/10 ),
            new Constraint\Ratio( $viewTask, 1 ),
            new Constraint\Ratio( $simpleSearchTask, 1/3 ),
            new Constraint\Ratio( $sortedSearchTask, 1/5 ),
        ),
        new Aborter\Count(200)
    );