| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function eventCoreIndexStart($args) |
||
| 36 | { |
||
| 37 | // check once per user session if xsitemap exists |
||
| 38 | $sessionVar = 'xsitemapChecked'; |
||
| 39 | $retVal = true; |
||
| 40 | if (empty($_SESSION[$sessionVar])) { |
||
| 41 | if (!file_exists(dirname(__DIR__) . "/xsitemap.xml")) { |
||
| 42 | require_once dirname(__DIR__) . "/include/functions.php"; |
||
| 43 | //Create the xsitemap.xml file in the site root |
||
| 44 | $xsitemap_show = xsitemap_generate_sitemap(); |
||
| 45 | $retVal = xsitemap_save($xsitemap_show) ? true : false; |
||
| 46 | } |
||
| 47 | $_SESSION[$sessionVar] = 1; |
||
| 48 | } |
||
| 49 | return $retVal; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.