Issues (14)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

app/Application.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
4
use Symfony\Component\Console\Application as BaseApplication;
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Input\InputOption;
8
use Symfony\Component\Console\Output\OutputInterface;
9
use Symfony\Component\HttpKernel\KernelInterface;
10
use Symfony\Component\HttpKernel\Kernel;
11
use Symfony\Bundle\WebServerBundle\WebServerBundle;
12
use Translation\Bundle\TranslationBundle;
13
use AppBundle\AppBundle;
14
15
/**
16
 * Application.
17
 *
18
 * @author Fabien Potencier <[email protected]>
19
 * @author Tobias Nyholm <[email protected]>
20
 */
21
class Application extends BaseApplication
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
22
{
23
    private $kernel;
24
    private $commandsRegistered = false;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param KernelInterface $kernel A KernelInterface instance
30
     */
31
    public function __construct(KernelInterface $kernel)
32
    {
33
        $this->kernel = $kernel;
34
35
        parent::__construct('Translation', '@package_version@');
36
37
        $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The environment name', $kernel->getEnvironment()));
38
        $this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode'));
39
    }
40
41
    /**
42
     * Gets the Kernel associated with this Console.
43
     *
44
     * @return KernelInterface A KernelInterface instance
45
     */
46
    public function getKernel()
47
    {
48
        return $this->kernel;
49
    }
50
51
    /**
52
     * Runs the current application.
53
     *
54
     * @param InputInterface  $input  An Input instance
55
     * @param OutputInterface $output An Output instance
56
     *
57
     * @return int 0 if everything went fine, or an error code
58
     */
59
    public function doRun(InputInterface $input, OutputInterface $output)
60
    {
61
        $this->kernel->boot();
62
63
        $container = $this->kernel->getContainer();
64
65
        foreach ($this->all() as $command) {
66
            if ($command instanceof ContainerAwareInterface) {
67
                $command->setContainer($container);
68
            }
69
        }
70
71
        $this->setDispatcher($container->get('event_dispatcher'));
72
73
        return parent::doRun($input, $output);
74
    }
75
76
    /**
77
     * {@inheritdoc}
78
     */
79
    public function find($name)
80
    {
81
        $this->registerCommands();
82
83
        return parent::find($name);
84
    }
85
86
    /**
87
     * {@inheritdoc}
88
     */
89
    public function get($name)
90
    {
91
        $this->registerCommands();
92
93
        return parent::get($name);
94
    }
95
96
    /**
97
     * {@inheritdoc}
98
     */
99
    public function all($namespace = null)
100
    {
101
        $this->registerCommands();
102
103
        return parent::all($namespace);
104
    }
105
106
    /**
107
     * {@inheritdoc}
108
     */
109
    public function getLongVersion()
110
    {
111
        return parent::getLongVersion().sprintf(' (kernel: <comment>%s</>, env: <comment>%s</>, debug: <comment>%s</>)', $this->kernel->getName(), $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
112
    }
113
114
    public function add(Command $command)
115
    {
116
        $this->registerCommands();
117
118
        $name = $command->getName();
119
        if (substr($name, 0, 12) === 'translation:') {
120
            $command->setName(substr($name, 12));
121
        }
122
123
        return parent::add($command);
124
    }
125
126
    protected function registerCommands()
127
    {
128
        if ($this->commandsRegistered) {
129
            return;
130
        }
131
132
        $this->commandsRegistered = true;
133
134
        $this->kernel->boot();
135
136
        $container = $this->kernel->getContainer();
137
138
        foreach ($this->kernel->getBundles() as $bundle) {
139
            if ($bundle instanceof WebServerBundle || $bundle instanceof TranslationBundle || $bundle instanceof AppBundle) {
140
                $bundle->registerCommands($this);
141
            }
142
        }
143
144
        if ($container->hasParameter('console.command.ids')) {
145
            foreach ($container->getParameter('console.command.ids') as $id) {
146
                $this->add($container->get($id));
147
            }
148
        }
149
    }
150
}
151