@@ -8,24 +8,24 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | return array( |
11 | - 'tracy' => [ |
|
12 | - 'enabled' => true, // flag whether to load tracy at all |
|
13 | - 'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array |
|
14 | - 'bar' => false, // bool = enabled|Toggle nette diagnostics bar. |
|
15 | - 'strict' => true, // bool = cause immediate death|int = matched against error severity |
|
16 | - 'log' => __DIR__.'/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
17 | - 'email' => null, // in production mode notifies the recipient |
|
18 | - 'email_snooze' => 900 // interval for sending email in seconds |
|
19 | - ], |
|
11 | + 'tracy' => [ |
|
12 | + 'enabled' => true, // flag whether to load tracy at all |
|
13 | + 'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array |
|
14 | + 'bar' => false, // bool = enabled|Toggle nette diagnostics bar. |
|
15 | + 'strict' => true, // bool = cause immediate death|int = matched against error severity |
|
16 | + 'log' => __DIR__.'/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
17 | + 'email' => null, // in production mode notifies the recipient |
|
18 | + 'email_snooze' => 900 // interval for sending email in seconds |
|
19 | + ], |
|
20 | 20 | |
21 | 21 | 'service_manager' => array( |
22 | 22 | 'invokables' => array( |
23 | 23 | 'Install/Listener/LanguageSetter' => 'Install\Listener\LanguageSetter', |
24 | 24 | ), |
25 | - 'factories' => array( |
|
26 | - 'mvctranslator' => \Zend\Mvc\I18n\TranslatorFactory::class, |
|
27 | - 'FilterManager' => \Zend\Filter\FilterPluginManagerFactory::class |
|
28 | - ), |
|
25 | + 'factories' => array( |
|
26 | + 'mvctranslator' => \Zend\Mvc\I18n\TranslatorFactory::class, |
|
27 | + 'FilterManager' => \Zend\Filter\FilterPluginManagerFactory::class |
|
28 | + ), |
|
29 | 29 | ), |
30 | 30 | |
31 | 31 | 'router' => array( |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | ), |
46 | 46 | |
47 | 47 | 'controllers' => array( |
48 | - 'abstract_factories' => [ |
|
49 | - \Install\Factory\Controller\LazyControllerFactory::class |
|
50 | - ], |
|
48 | + 'abstract_factories' => [ |
|
49 | + \Install\Factory\Controller\LazyControllerFactory::class |
|
50 | + ], |
|
51 | 51 | ), |
52 | 52 | |
53 | 53 | 'controller_plugins' => array( |
@@ -62,13 +62,13 @@ |
||
62 | 62 | $services = $application->getServiceManager(); |
63 | 63 | |
64 | 64 | $services->get('Install/Listener/LanguageSetter') |
65 | - ->attach($eventManager); |
|
65 | + ->attach($eventManager); |
|
66 | 66 | |
67 | - $tracyConfig = $services->get('Config')['tracy']; |
|
67 | + $tracyConfig = $services->get('Config')['tracy']; |
|
68 | 68 | |
69 | - if ($tracyConfig['enabled']) { |
|
70 | - (new TracyService())->register($tracyConfig); |
|
71 | - (new TracyListener())->attach($eventManager); |
|
72 | - } |
|
69 | + if ($tracyConfig['enabled']) { |
|
70 | + (new TracyService())->register($tracyConfig); |
|
71 | + (new TracyListener())->attach($eventManager); |
|
72 | + } |
|
73 | 73 | } |
74 | 74 | } |
@@ -26,18 +26,18 @@ |
||
26 | 26 | */ |
27 | 27 | public function register(array $config) |
28 | 28 | { |
29 | - try{ |
|
30 | - // enable logging of all error types globally |
|
31 | - Debugger::enable($config['mode'], $config['log'], $config['email']); |
|
32 | - Debugger::$strictMode = $config['strict']; |
|
33 | - Debugger::$showBar = $config['bar']; |
|
29 | + try{ |
|
30 | + // enable logging of all error types globally |
|
31 | + Debugger::enable($config['mode'], $config['log'], $config['email']); |
|
32 | + Debugger::$strictMode = $config['strict']; |
|
33 | + Debugger::$showBar = $config['bar']; |
|
34 | 34 | |
35 | - /** @var \Tracy\Logger $logger */ |
|
36 | - $logger = Debugger::getLogger(); |
|
37 | - $logger->emailSnooze = $config['email_snooze']; |
|
38 | - }catch (\Exception $e){ |
|
39 | - throw $e; |
|
40 | - } |
|
35 | + /** @var \Tracy\Logger $logger */ |
|
36 | + $logger = Debugger::getLogger(); |
|
37 | + $logger->emailSnooze = $config['email_snooze']; |
|
38 | + }catch (\Exception $e){ |
|
39 | + throw $e; |
|
40 | + } |
|
41 | 41 | |
42 | 42 | } |
43 | 43 | } |
@@ -23,31 +23,31 @@ |
||
23 | 23 | */ |
24 | 24 | class TracyListener implements ListenerAggregateInterface |
25 | 25 | { |
26 | - use ListenerAggregateTrait; |
|
26 | + use ListenerAggregateTrait; |
|
27 | 27 | |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - * @see \Zend\EventManager\ListenerAggregateInterface::attach() |
|
31 | - */ |
|
32 | - public function attach(EventManagerInterface $events, $priority = 1) |
|
33 | - { |
|
34 | - $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'handleError'], $priority); |
|
35 | - $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'handleError'], $priority); |
|
36 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + * @see \Zend\EventManager\ListenerAggregateInterface::attach() |
|
31 | + */ |
|
32 | + public function attach(EventManagerInterface $events, $priority = 1) |
|
33 | + { |
|
34 | + $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'handleError'], $priority); |
|
35 | + $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'handleError'], $priority); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param MvcEvent $e |
|
40 | - */ |
|
41 | - public function handleError(MvcEvent $e) |
|
42 | - { |
|
43 | - if ($e->getError() == \Zend\Mvc\Application::ERROR_EXCEPTION) { |
|
44 | - if (Debugger::$productionMode) { |
|
45 | - // log an exception in production environment (this will send email as well if email address is set) |
|
46 | - Debugger::log($e->getParam('exception'), Debugger::ERROR); |
|
47 | - } else { |
|
48 | - // just re-throw an exception in non-production environment to let tracy display so called blue screen |
|
49 | - throw $e->getParam('exception'); |
|
50 | - } |
|
51 | - } |
|
52 | - } |
|
38 | + /** |
|
39 | + * @param MvcEvent $e |
|
40 | + */ |
|
41 | + public function handleError(MvcEvent $e) |
|
42 | + { |
|
43 | + if ($e->getError() == \Zend\Mvc\Application::ERROR_EXCEPTION) { |
|
44 | + if (Debugger::$productionMode) { |
|
45 | + // log an exception in production environment (this will send email as well if email address is set) |
|
46 | + Debugger::log($e->getParam('exception'), Debugger::ERROR); |
|
47 | + } else { |
|
48 | + // just re-throw an exception in non-production environment to let tracy display so called blue screen |
|
49 | + throw $e->getParam('exception'); |
|
50 | + } |
|
51 | + } |
|
52 | + } |
|
53 | 53 | } |
@@ -22,55 +22,55 @@ |
||
22 | 22 | */ |
23 | 23 | class LazyControllerFactory implements AbstractFactoryInterface |
24 | 24 | { |
25 | - protected $aliases = [ |
|
26 | - FormElementManager::class => 'FormElementManager', |
|
27 | - ValidatorPluginManager::class => 'ValidatorManager', |
|
28 | - Translator::class => 'translator', |
|
29 | - ]; |
|
25 | + protected $aliases = [ |
|
26 | + FormElementManager::class => 'FormElementManager', |
|
27 | + ValidatorPluginManager::class => 'ValidatorManager', |
|
28 | + Translator::class => 'translator', |
|
29 | + ]; |
|
30 | 30 | |
31 | - public function canCreate( ContainerInterface $container, $requestedName ) |
|
32 | - { |
|
33 | - list( $module, ) = explode( '\\', __NAMESPACE__, 2 ); |
|
34 | - return strstr( $requestedName, $module . '\Controller') !== false; |
|
35 | - } |
|
31 | + public function canCreate( ContainerInterface $container, $requestedName ) |
|
32 | + { |
|
33 | + list( $module, ) = explode( '\\', __NAMESPACE__, 2 ); |
|
34 | + return strstr( $requestedName, $module . '\Controller') !== false; |
|
35 | + } |
|
36 | 36 | |
37 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
38 | - { |
|
39 | - $class = new \ReflectionClass($requestedName); |
|
40 | - $parentLocator = $container; |
|
41 | - if( $constructor = $class->getConstructor() ) |
|
42 | - { |
|
43 | - if( $params = $constructor->getParameters() ) |
|
44 | - { |
|
45 | - $parameter_instances = []; |
|
46 | - foreach( $params as $p ) |
|
47 | - { |
|
37 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
38 | + { |
|
39 | + $class = new \ReflectionClass($requestedName); |
|
40 | + $parentLocator = $container; |
|
41 | + if( $constructor = $class->getConstructor() ) |
|
42 | + { |
|
43 | + if( $params = $constructor->getParameters() ) |
|
44 | + { |
|
45 | + $parameter_instances = []; |
|
46 | + foreach( $params as $p ) |
|
47 | + { |
|
48 | 48 | |
49 | - if( $p->getClass() ) { |
|
50 | - $cn = $p->getClass()->getName(); |
|
51 | - if (array_key_exists($cn, $this->aliases)) { |
|
52 | - $cn = $this->aliases[$cn]; |
|
53 | - } |
|
49 | + if( $p->getClass() ) { |
|
50 | + $cn = $p->getClass()->getName(); |
|
51 | + if (array_key_exists($cn, $this->aliases)) { |
|
52 | + $cn = $this->aliases[$cn]; |
|
53 | + } |
|
54 | 54 | |
55 | - try { |
|
56 | - $parameter_instances[] = $parentLocator->get($cn); |
|
57 | - } |
|
58 | - catch (\Exception $x) { |
|
59 | - echo __CLASS__ |
|
60 | - . " couldn't create an instance of $cn to satisfy the constructor for $requestedName."; |
|
61 | - exit; |
|
62 | - } |
|
63 | - } |
|
64 | - else{ |
|
65 | - if( $p->isArray() && $p->getName() == 'config' ) |
|
66 | - $parameter_instances[] = $parentLocator->get('config'); |
|
67 | - } |
|
55 | + try { |
|
56 | + $parameter_instances[] = $parentLocator->get($cn); |
|
57 | + } |
|
58 | + catch (\Exception $x) { |
|
59 | + echo __CLASS__ |
|
60 | + . " couldn't create an instance of $cn to satisfy the constructor for $requestedName."; |
|
61 | + exit; |
|
62 | + } |
|
63 | + } |
|
64 | + else{ |
|
65 | + if( $p->isArray() && $p->getName() == 'config' ) |
|
66 | + $parameter_instances[] = $parentLocator->get('config'); |
|
67 | + } |
|
68 | 68 | |
69 | - } |
|
70 | - return $class->newInstanceArgs($parameter_instances); |
|
71 | - } |
|
72 | - } |
|
69 | + } |
|
70 | + return $class->newInstanceArgs($parameter_instances); |
|
71 | + } |
|
72 | + } |
|
73 | 73 | |
74 | - return new $requestedName; |
|
75 | - } |
|
74 | + return new $requestedName; |
|
75 | + } |
|
76 | 76 | } |
77 | 77 | \ No newline at end of file |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class Index extends AbstractActionController |
28 | 28 | { |
29 | - protected $installForm; |
|
29 | + protected $installForm; |
|
30 | 30 | |
31 | - public function __construct(FormElementManager $formElementManager) |
|
32 | - { |
|
33 | - $this->installForm = $formElementManager->get('Install/Installation'); |
|
34 | - } |
|
31 | + public function __construct(FormElementManager $formElementManager) |
|
32 | + { |
|
33 | + $this->installForm = $formElementManager->get('Install/Installation'); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
36 | + /** |
|
37 | 37 | * Hook for custom preDispatch event. |
38 | 38 | * |
39 | 39 | * @param MvcEvent $event |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $routeMatch->setParam('action', $p); |
51 | 51 | $response = $this->getResponse(); |
52 | 52 | $response->getHeaders() |
53 | - ->addHeaderLine('Content-Type', 'application/json') |
|
54 | - ->addHeaderLine('Content-Encoding', 'utf8'); |
|
53 | + ->addHeaderLine('Content-Type', 'application/json') |
|
54 | + ->addHeaderLine('Content-Encoding', 'utf8'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $form = $this->installForm; |
66 | 66 | $prereqs = $this->plugin('Install/Prerequisites')->check(); |
67 | 67 | |
68 | - return $this->createViewModel( |
|
69 | - array( |
|
70 | - 'prerequisites' => $prereqs, |
|
71 | - 'form' => $form, |
|
72 | - 'lang' => $this->params('lang'), |
|
73 | - ) |
|
74 | - ); |
|
68 | + return $this->createViewModel( |
|
69 | + array( |
|
70 | + 'prerequisites' => $prereqs, |
|
71 | + 'form' => $form, |
|
72 | + 'lang' => $this->params('lang'), |
|
73 | + ) |
|
74 | + ); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $form->setData($_POST); |
101 | 101 | |
102 | 102 | if (!$form->isValid()) { |
103 | - return $this->createJsonResponse( |
|
104 | - array( |
|
105 | - 'ok' => false, |
|
106 | - 'errors' => $form->getMessages(), |
|
107 | - ) |
|
108 | - ); |
|
103 | + return $this->createJsonResponse( |
|
104 | + array( |
|
105 | + 'ok' => false, |
|
106 | + 'errors' => $form->getMessages(), |
|
107 | + ) |
|
108 | + ); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $data = $form->getData(); |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function attachDefaultListeners() |
135 | 135 | { |
136 | - parent::attachDefaultListeners(); |
|
136 | + parent::attachDefaultListeners(); |
|
137 | 137 | |
138 | - $events = $this->getEventManager(); |
|
139 | - $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 ); |
|
138 | + $events = $this->getEventManager(); |
|
139 | + $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 ); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -26,57 +26,57 @@ discard block |
||
26 | 26 | |
27 | 27 | public function init() |
28 | 28 | { |
29 | - $this->setName('installation'); |
|
29 | + $this->setName('installation'); |
|
30 | 30 | |
31 | - $this->setAttributes( |
|
32 | - array( |
|
33 | - 'method' => 'post', |
|
34 | - ) |
|
35 | - ); |
|
31 | + $this->setAttributes( |
|
32 | + array( |
|
33 | + 'method' => 'post', |
|
34 | + ) |
|
35 | + ); |
|
36 | 36 | |
37 | - $this->add( |
|
38 | - array( |
|
39 | - 'type' => 'Text', |
|
40 | - 'name' => 'db_conn', |
|
41 | - 'options' => array( |
|
42 | - 'label' => /* @translate */ 'Database connection string', |
|
43 | - ), |
|
44 | - 'attributes' => array( |
|
45 | - 'placeholder' => 'mongodb://localhost:27017/YAWIK', |
|
46 | - ), |
|
37 | + $this->add( |
|
38 | + array( |
|
39 | + 'type' => 'Text', |
|
40 | + 'name' => 'db_conn', |
|
41 | + 'options' => array( |
|
42 | + 'label' => /* @translate */ 'Database connection string', |
|
43 | + ), |
|
44 | + 'attributes' => array( |
|
45 | + 'placeholder' => 'mongodb://localhost:27017/YAWIK', |
|
46 | + ), |
|
47 | 47 | |
48 | - ) |
|
49 | - ); |
|
48 | + ) |
|
49 | + ); |
|
50 | 50 | |
51 | - $this->add( |
|
52 | - array( |
|
53 | - 'type' => 'Text', |
|
54 | - 'name' => 'username', |
|
55 | - 'options' => array( |
|
56 | - 'label' => /* @translate */ 'Initial user name', |
|
57 | - ), |
|
58 | - ) |
|
59 | - ); |
|
51 | + $this->add( |
|
52 | + array( |
|
53 | + 'type' => 'Text', |
|
54 | + 'name' => 'username', |
|
55 | + 'options' => array( |
|
56 | + 'label' => /* @translate */ 'Initial user name', |
|
57 | + ), |
|
58 | + ) |
|
59 | + ); |
|
60 | 60 | |
61 | - $this->add( |
|
62 | - array( |
|
63 | - 'type' => 'Password', |
|
64 | - 'name' => 'password', |
|
65 | - 'options' => array( |
|
66 | - 'label' => /* @translate */ 'Password', |
|
67 | - ), |
|
68 | - ) |
|
69 | - ); |
|
61 | + $this->add( |
|
62 | + array( |
|
63 | + 'type' => 'Password', |
|
64 | + 'name' => 'password', |
|
65 | + 'options' => array( |
|
66 | + 'label' => /* @translate */ 'Password', |
|
67 | + ), |
|
68 | + ) |
|
69 | + ); |
|
70 | 70 | |
71 | - $this->add( |
|
72 | - array( |
|
73 | - 'type' => 'Text', |
|
74 | - 'name' => 'email', |
|
75 | - 'options' => array( |
|
76 | - 'label' => /* @translate */ 'Email address for system messages', |
|
77 | - ), |
|
78 | - ) |
|
79 | - ); |
|
71 | + $this->add( |
|
72 | + array( |
|
73 | + 'type' => 'Text', |
|
74 | + 'name' => 'email', |
|
75 | + 'options' => array( |
|
76 | + 'label' => /* @translate */ 'Email address for system messages', |
|
77 | + ), |
|
78 | + ) |
|
79 | + ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | public function getInputFilterSpecification() |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ), |
91 | 91 | 'validators' => array( |
92 | 92 | array('name' => MongoDbConnectionString::class, |
93 | - 'break_chain_on_failure' => true), |
|
93 | + 'break_chain_on_failure' => true), |
|
94 | 94 | array('name' => MongoDbConnection::class), |
95 | 95 | ), |
96 | 96 | ), |
@@ -22,22 +22,22 @@ |
||
22 | 22 | */ |
23 | 23 | class CvContext implements Context |
24 | 24 | { |
25 | - use CommonContextTrait; |
|
25 | + use CommonContextTrait; |
|
26 | 26 | |
27 | 27 | |
28 | - /** |
|
29 | - * @Given I go to manage my resume page |
|
30 | - */ |
|
31 | - public function iGoToManageResumePage() |
|
32 | - { |
|
33 | - $this->visit('/en/my/cv'); |
|
34 | - } |
|
28 | + /** |
|
29 | + * @Given I go to manage my resume page |
|
30 | + */ |
|
31 | + public function iGoToManageResumePage() |
|
32 | + { |
|
33 | + $this->visit('/en/my/cv'); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @When I click edit on my personal information |
|
38 | - */ |
|
39 | - public function iClickEditOnPersonalInformations() |
|
40 | - { |
|
41 | - $this->summaryFormContext->iClickEditOnForm('resumePersonalInformations'); |
|
42 | - } |
|
36 | + /** |
|
37 | + * @When I click edit on my personal information |
|
38 | + */ |
|
39 | + public function iClickEditOnPersonalInformations() |
|
40 | + { |
|
41 | + $this->summaryFormContext->iClickEditOnForm('resumePersonalInformations'); |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | \ No newline at end of file |
@@ -23,39 +23,39 @@ |
||
23 | 23 | */ |
24 | 24 | class OrganizationContext implements Context |
25 | 25 | { |
26 | - use CommonContextTrait; |
|
26 | + use CommonContextTrait; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @Given I go to my organization page |
|
30 | - */ |
|
31 | - public function iGoToMyOrganizationPage() |
|
32 | - { |
|
33 | - $url = $this->coreContext->generateUrl('/en/my/organization'); |
|
34 | - $this->coreContext->iVisit($url); |
|
35 | - } |
|
28 | + /** |
|
29 | + * @Given I go to my organization page |
|
30 | + */ |
|
31 | + public function iGoToMyOrganizationPage() |
|
32 | + { |
|
33 | + $url = $this->coreContext->generateUrl('/en/my/organization'); |
|
34 | + $this->coreContext->iVisit($url); |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * @When I hover over name form |
|
39 | - */ |
|
40 | - public function iMouseOverOrganizationNameForm() |
|
41 | - { |
|
42 | - $locator = '#sf-nameForm .sf-summary'; |
|
43 | - $this->coreContext->iHoverOverTheElement($locator); |
|
44 | - } |
|
37 | + /** |
|
38 | + * @When I hover over name form |
|
39 | + */ |
|
40 | + public function iMouseOverOrganizationNameForm() |
|
41 | + { |
|
42 | + $locator = '#sf-nameForm .sf-summary'; |
|
43 | + $this->coreContext->iHoverOverTheElement($locator); |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * @Given I go to create new organization page |
|
48 | - */ |
|
49 | - public function iGoToCreateNewOrganizationPage() |
|
50 | - { |
|
51 | - $this->visit('/en/organizations/edit'); |
|
52 | - } |
|
46 | + /** |
|
47 | + * @Given I go to create new organization page |
|
48 | + */ |
|
49 | + public function iGoToCreateNewOrganizationPage() |
|
50 | + { |
|
51 | + $this->visit('/en/organizations/edit'); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @Given I go to organization overview page |
|
56 | - */ |
|
57 | - public function iGoToOrganizationOverviewPage() |
|
58 | - { |
|
59 | - $this->visit('/en/organizations'); |
|
60 | - } |
|
54 | + /** |
|
55 | + * @Given I go to organization overview page |
|
56 | + */ |
|
57 | + public function iGoToOrganizationOverviewPage() |
|
58 | + { |
|
59 | + $this->visit('/en/organizations'); |
|
60 | + } |
|
61 | 61 | } |
62 | 62 | \ No newline at end of file |