<commit_before>#!/usr/bin/env php
<?php
/*
 * Symfony2 structure project installer
 *
 * (c) <NAME>
 *
 */

/**
 * @author <NAME> <<EMAIL>>
 */

$ds = DIRECTORY_SEPARATOR;
$with_controller = false;

// ----------------- FILES
$deny_htaccess = 'deny from all';

$web_htaccess = <<<'EOF'
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
EOF;

$web_robots = <<<'EOF'
User-agent: *
Allow: /
EOF;

$app_cache = <<<'EOF'
<?php

require_once __DIR__.'/AppKernel.php';

use Symfony\Framework\Cache\Cache;

class AppCache extends Cache
{
}
EOF;

$app_kernel = <<<'EOF'
<?php

require_once __DIR__.'/../src/autoload.php';

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\DependencyInjection\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),

            // enable third-party bundles
            new Symfony\Bundle\ZendBundle\ZendBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
%class%
            new Application\%app%Bundle\%app%Bundle(),
        );

        if ($this->isDebug()) {
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        }

        return $bundles;
    }

    public function registerRootDir()
    {
        return __DIR__;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        // use YAML for configuration
        // comment to use another configuration format
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');

        // uncomment to use XML for configuration
        //$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.xml');

        // uncomment to use PHP for configuration
        //$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.php');
    }
}
EOF;

$app_console = <<<'EOF'
#!/usr/bin/env php
<?php

require_once __DIR__.'/AppKernel.php';

use Symfony\Bundle\FrameworkBundle\Console\Application;

$kernel = new AppKernel('dev', true);

$application = new Application($kernel);
$application->run();
EOF;


$app_phpunit = <<<'EOF'
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="true"
         stopOnFailure="false"
         syntaxCheck="false"
         bootstrap="../src/autoload.php"
>
  <testsuites>
      <testsuite name="Project Test Suite">
          <directory>../src/Application/*/Tests</directory>
      </testsuite>
  </testsuites>

  <!--
  <php>
      <server name="KERNEL_DIR" value="/path/to/your/app/" />
  </php>
  //-->

  <filter>
      <whitelist>
          <directory>../src/Application</directory>
          <exclude>
              <directory>../src/Application/*/Resources</directory>
              <directory>../src/Application/*/Tests</directory>
          </exclude>
      </whitelist>
  </filter>
</phpunit>
EOF;



$app_bundle = <<<'EOF'
<?php
namespace Application\%app%Bundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class %app%Bundle extends Bundle
{
    /**
     * {@inheritdoc}
     */
    public function getNamespace()
    {
        return __NAMESPACE__;
    }

    /**
     * {@inheritdoc}
     */
    public function getPath()
    {
        return strtr(__DIR__, '\\', '/');
    }
}
EOF;


$config_yml = <<<'EOF'
app.config:
    charset:       UTF-8
    error_handler: null
    csrf_secret:
        enabled: true
        secret: xxxxxxxxxx
    router:        { resource: "%kernel.root_dir%/config/routing.yml" }
    validation:    { enabled: true, annotations: true }
    templating:
        engines:   ['%engine%']
        #assets_version: SomeVersionScheme
    session:
        default_locale: en
        lifetime:       3600
        auto_start:     %start%
        name:           %sessionname%

twig.config:
    debug:            %kernel.debug%
    strict_variables: %kernel.debug%
%configdb%
## Swiftmailer Configuration
#swiftmailer.config:
#    transport:  smtp
#    encryption: ssl
#    auth_mode:  login
#    host:       smtp.gmail.com
#    username:   xxxxxxxx
#    password:   <PASSWORD>
EOF;

$config_db_yml = <<<'EOF'

## Doctrine Configuration
#doctrine.dbal:
#    dbname:   xxxxxxxx
#    user:     xxxxxxxx
#    password: ~
#    logging:  %kernel.debug%
#doctrine.orm:
#    auto_generate_proxy_classes: %kernel.debug%
#    mappings:
#        %app%Bundle: ~

EOF;

$config_dev_yml = <<<'EOF'
imports:
    - { resource: config.yml }

app.config:
    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
    profiler: { only_exceptions: false }

webprofiler.config:
    toolbar: true
    intercept_redirects: true

zend.config:
    logger:
        priority: debug
        path:     %kernel.logs_dir%/%kernel.environment%.log
EOF;

$config_prod_yml = <<<'EOF'
imports:
    - { resource: config.yml }
EOF;

$config_test_yml = <<<'EOF'
imports:
    - { resource: config_dev.yml }

app.config:
    error_handler: false
    test: ~

webprofiler.config:
    toolbar: false
    intercept_redirects: false

zend.config:
    logger:
        priority: debug
EOF;


$routing_yml = <<<'EOF'
homepage:
    pattern:  /
    defaults: { _controller: FrameworkBundle:Default:index }

#%app%:
#    resource: @%app%Bundle/Resources/config/routing.yml
EOF;

$routing_with_controller_yml = <<<'EOF'
homepage:
    pattern:  /
    defaults: { _controller: FrameworkBundle:Default:index }

%app%:
    resource: @%app%Bundle/Resources/config/routing.yml
EOF;


$routing_dev_yml = <<<'EOF'
_main:
    resource: routing.yml

_profiler:
    resource: @WebProfilerBundle/Resources/config/routing/profiler.xml
    prefix:   /_profiler
EOF;

$autoload = <<<'EOF'
<?php

$vendorDir = __DIR__.'/vendor';

require_once $vendorDir.'/symfony/src/Symfony/Component/HttpKernel/UniversalClassLoader.php';

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
%loader%
));
$loader->registerPrefixes(array(
    'Swift_'           => $vendorDir.'/swiftmailer/lib/classes',
    'Twig_Extensions_' => $vendorDir.'/twig-extensions/lib',
    'Twig_'            => $vendorDir.'/twig/lib',
));
$loader->register();
EOF;

$layout_php = <<<'EOF'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><commit_msg>Changed UniversalClassLoader.php to bootstrap.php<commit_after>#!/usr/bin/env php
<?php
/*
 * Symfony2 structure project installer
 *
 * (c) <NAME>
 *
 */

/**
 * @author <NAME> <<EMAIL>>
 */

$ds = DIRECTORY_SEPARATOR;
$with_controller = false;

// ----------------- FILES
$deny_htaccess = 'deny from all';

$web_htaccess = <<<'EOF'
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
EOF;

$web_robots = <<<'EOF'
User-agent: *
Allow: /
EOF;

$app_cache = <<<'EOF'
<?php

require_once __DIR__.'/AppKernel.php';

use Symfony\Framework\Cache\Cache;

class AppCache extends Cache
{
}
EOF;

$app_kernel = <<<'EOF'
<?php

require_once __DIR__.'/../src/autoload.php';

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\DependencyInjection\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),

            // enable third-party bundles
            new Symfony\Bundle\ZendBundle\ZendBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
%class%
            new Application\%app%Bundle\%app%Bundle(),
        );

        if ($this->isDebug()) {
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        }

        return $bundles;
    }

    public function registerRootDir()
    {
        return __DIR__;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        // use YAML for configuration
        // comment to use another configuration format
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');

        // uncomment to use XML for configuration
        //$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.xml');

        // uncomment to use PHP for configuration
        //$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.php');
    }
}
EOF;

$app_console = <<<'EOF'
#!/usr/bin/env php
<?php

require_once __DIR__.'/AppKernel.php';

use Symfony\Bundle\FrameworkBundle\Console\Application;

$kernel = new AppKernel('dev', true);

$application = new Application($kernel);
$application->run();
EOF;


$app_phpunit = <<<'EOF'
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="true"
         stopOnFailure="false"
         syntaxCheck="false"
         bootstrap="../src/autoload.php"
>
  <testsuites>
      <testsuite name="Project Test Suite">
          <directory>../src/Application/*/Tests</directory>
      </testsuite>
  </testsuites>

  <!--
  <php>
      <server name="KERNEL_DIR" value="/path/to/your/app/" />
  </php>
  //-->

  <filter>
      <whitelist>
          <directory>../src/Application</directory>
          <exclude>
              <directory>../src/Application/*/Resources</directory>
              <directory>../src/Application/*/Tests</directory>
          </exclude>
      </whitelist>
  </filter>
</phpunit>
EOF;



$app_bundle = <<<'EOF'
<?php
namespace Application\%app%Bundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class %app%Bundle extends Bundle
{
    /**
     * {@inheritdoc}
     */
    public function getNamespace()
    {
        return __NAMESPACE__;
    }

    /**
     * {@inheritdoc}
     */
    public function getPath()
    {
        return strtr(__DIR__, '\\', '/');
    }
}
EOF;


$config_yml = <<<'EOF'
app.config:
    charset:       UTF-8
    error_handler: null
    csrf_secret:
        enabled: true
        secret: xxxxxxxxxx
    router:        { resource: "%kernel.root_dir%/config/routing.yml" }
    validation:    { enabled: true, annotations: true }
    templating:
        engines:   ['%engine%']
        #assets_version: SomeVersionScheme
    session:
        default_locale: en
        lifetime:       3600
        auto_start:     %start%
        name:           %sessionname%

twig.config:
    debug:            %kernel.debug%
    strict_variables: %kernel.debug%
%configdb%
## Swiftmailer Configuration
#swiftmailer.config:
#    transport:  smtp
#    encryption: ssl
#    auth_mode:  login
#    host:       smtp.gmail.com
#    username:   xxxxxxxx
#    password:   <PASSWORD>
EOF;

$config_db_yml = <<<'EOF'

## Doctrine Configuration
#doctrine.dbal:
#    dbname:   xxxxxxxx
#    user:     xxxxxxxx
#    password: ~
#    logging:  %kernel.debug%
#doctrine.orm:
#    auto_generate_proxy_classes: %kernel.debug%
#    mappings:
#        %app%Bundle: ~

EOF;

$config_dev_yml = <<<'EOF'
imports:
    - { resource: config.yml }

app.config:
    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
    profiler: { only_exceptions: false }

webprofiler.config:
    toolbar: true
    intercept_redirects: true

zend.config:
    logger:
        priority: debug
        path:     %kernel.logs_dir%/%kernel.environment%.log
EOF;

$config_prod_yml = <<<'EOF'
imports:
    - { resource: config.yml }
EOF;

$config_test_yml = <<<'EOF'
imports:
    - { resource: config_dev.yml }

app.config:
    error_handler: false
    test: ~

webprofiler.config:
    toolbar: false
    intercept_redirects: false

zend.config:
    logger:
        priority: debug
EOF;


$routing_yml = <<<'EOF'
homepage:
    pattern:  /
    defaults: { _controller: FrameworkBundle:Default:index }

#%app%:
#    resource: @%app%Bundle/Resources/config/routing.yml
EOF;

$routing_with_controller_yml = <<<'EOF'
homepage:
    pattern:  /
    defaults: { _controller: FrameworkBundle:Default:index }

%app%:
    resource: @%app%Bundle/Resources/config/routing.yml
EOF;


$routing_dev_yml = <<<'EOF'
_main:
    resource: routing.yml

_profiler:
    resource: @WebProfilerBundle/Resources/config/routing/profiler.xml
    prefix:   /_profiler
EOF;

$autoload = <<<'EOF'
<?php

$vendorDir = __DIR__.'/vendor';

require_once $vendorDir.'/symfony/src/Symfony/Component/HttpKernel/bootstrap.php';

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
%loader%
));
$loader->registerPrefixes(array(
    'Swift_'           => $vendorDir.'/swiftmailer/lib/classes',
    'Twig_Extensions_' => $vendorDir.'/twig-extensions/lib',
    'Twig_'            => $vendorDir.'/twig/lib',
));
$loader->register();
EOF;

$layout_php = <<<'EOF'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{'fraction_non_alphanumeric': 0.1498773325403316, 'fraction_numerical': 0.002230317448516839, 'mean_word_length': 2.876657060518732, 'pattern_counts': {'":': 0, '<': 183, '<?xml version=': 2, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1636423', 'n_tokens_mistral': 4519, 'n_tokens_neox': 4414, 'n_words': 796}