Hi,
I started a new project using dev-tols.
And noticed that indexAction was running twice (saving the record in the database twice).
This was being triggered by the favicon address in layout.
This is the baseUri defined in config.php created by dev-tols (create-project command)
'baseUri' => preg_replace('/public([\/\\])index.php$/', '', $_SERVER["PHP_SELF"]),
Im my setup $_SERVER["PHP_SELF"] point to "/index.php"
Because "public" does not exist in [$_SERVER["PHP_SELF"] the baseUri returned is "/index.php"
Then the urls are generated this way
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->url->get('img/favicon.ico')?>"/>
<link rel="shortcut icon" type="image/x-icon" href="/index.php/img/favicon.ico"/>
The workaround was to remove "public" or leave a static value ""
'baseUri' => preg_replace('/([\/\\])index.php$/', '', $_SERVER["PHP_SELF"]),
or
'baseUri' => "/",
This produces
<link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico"/>
But was the question whether this is a specific case in my setup? Or should I open a pull request to change de code generated?
My setup:
Xampp fresh install
PHP 7.2.5
Phalcon 3.4.0
Structure of directories generated by dev-tool unchanged