API
2 years ago
Access
2 years ago
Application
2 years ago
Archive
2 years ago
ArchiveProcessor
2 years ago
Archiver
2 years ago
AssetManager
2 years ago
Auth
2 years ago
Category
2 years ago
Changes
2 years ago
CliMulti
2 years ago
Columns
2 years ago
Concurrency
2 years ago
Config
2 years ago
Container
2 years ago
CronArchive
2 years ago
DataAccess
2 years ago
DataFiles
2 years ago
DataTable
2 years ago
Db
2 years ago
DeviceDetector
2 years ago
Email
2 years ago
Exception
2 years ago
Http
2 years ago
Intl
2 years ago
Log
2 years ago
Mail
2 years ago
Measurable
2 years ago
Menu
2 years ago
Metrics
2 years ago
Notification
2 years ago
Period
2 years ago
Plugin
2 years ago
ProfessionalServices
2 years ago
Report
2 years ago
ReportRenderer
2 years ago
Scheduler
2 years ago
Segment
2 years ago
Session
2 years ago
Settings
2 years ago
Tracker
2 years ago
Translation
2 years ago
Twig
2 years ago
UpdateCheck
2 years ago
Updater
2 years ago
Updates
2 years ago
Validators
2 years ago
View
2 years ago
ViewDataTable
2 years ago
Visualization
2 years ago
Widget
2 years ago
.htaccess
2 years ago
Access.php
2 years ago
Archive.php
2 years ago
ArchiveProcessor.php
2 years ago
AssetManager.php
2 years ago
Auth.php
2 years ago
AuthResult.php
2 years ago
BaseFactory.php
2 years ago
Cache.php
2 years ago
CacheId.php
2 years ago
CliMulti.php
2 years ago
Common.php
2 years ago
Config.php
2 years ago
Console.php
2 years ago
Context.php
2 years ago
Cookie.php
2 years ago
CronArchive.php
2 years ago
DI.php
2 years ago
DataArray.php
2 years ago
DataTable.php
2 years ago
Date.php
2 years ago
Db.php
2 years ago
DbHelper.php
2 years ago
Development.php
2 years ago
ErrorHandler.php
2 years ago
EventDispatcher.php
2 years ago
ExceptionHandler.php
2 years ago
FileIntegrity.php
2 years ago
Filechecks.php
2 years ago
Filesystem.php
2 years ago
FrontController.php
2 years ago
Http.php
2 years ago
IP.php
2 years ago
Log.php
2 years ago
LogDeleter.php
2 years ago
Mail.php
2 years ago
Metrics.php
2 years ago
NoAccessException.php
2 years ago
Nonce.php
2 years ago
Notification.php
2 years ago
NumberFormatter.php
2 years ago
Option.php
2 years ago
Period.php
2 years ago
Piwik.php
2 years ago
Plugin.php
2 years ago
Profiler.php
2 years ago
ProxyHeaders.php
2 years ago
ProxyHttp.php
2 years ago
QuickForm2.php
2 years ago
RankingQuery.php
2 years ago
ReportRenderer.php
2 years ago
Request.php
2 years ago
Segment.php
2 years ago
Sequence.php
2 years ago
Session.php
2 years ago
SettingsPiwik.php
2 years ago
SettingsServer.php
2 years ago
Singleton.php
2 years ago
Site.php
2 years ago
SiteContentDetector.php
2 years ago
SupportedBrowser.php
2 years ago
TCPDF.php
2 years ago
Theme.php
2 years ago
Timer.php
2 years ago
Tracker.php
2 years ago
Twig.php
2 years ago
Unzip.php
2 years ago
UpdateCheck.php
2 years ago
Updater.php
2 years ago
UpdaterErrorException.php
2 years ago
Updates.php
2 years ago
Url.php
2 years ago
UrlHelper.php
2 years ago
Version.php
2 years ago
View.php
2 years ago
bootstrap.php
2 years ago
dispatch.php
2 years ago
testMinimumPhpVersion.php
2 years ago
bootstrap.php
59 lines
| 1 | <?php |
| 2 | |
| 3 | namespace { |
| 4 | /** |
| 5 | * Matomo - free/libre analytics platform |
| 6 | * |
| 7 | * @link https://matomo.org |
| 8 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 9 | * |
| 10 | * Bootstraps the Piwik application. |
| 11 | * |
| 12 | * This file cannot be a class because it needs to be compatible with PHP 4. |
| 13 | */ |
| 14 | if (!\defined('PIWIK_USER_PATH')) { |
| 15 | \define('PIWIK_USER_PATH', \PIWIK_DOCUMENT_ROOT); |
| 16 | } |
| 17 | \error_reporting(\E_ALL); |
| 18 | @\ini_set('display_errors', \defined('PIWIK_DISPLAY_ERRORS') ? \PIWIK_DISPLAY_ERRORS : @\ini_get('display_errors')); |
| 19 | @\ini_set('xdebug.show_exception_trace', 0); |
| 20 | if (!\defined('PIWIK_VENDOR_PATH')) { |
| 21 | if (\is_dir(\PIWIK_INCLUDE_PATH . '/vendor')) { |
| 22 | \define('PIWIK_VENDOR_PATH', \PIWIK_INCLUDE_PATH . '/vendor'); |
| 23 | // Piwik is the main project |
| 24 | } else { |
| 25 | \define('PIWIK_VENDOR_PATH', \PIWIK_INCLUDE_PATH . '/../..'); |
| 26 | // Piwik is installed as a Composer dependency |
| 27 | } |
| 28 | } |
| 29 | // NOTE: the code above must be PHP 4 compatible |
| 30 | require_once \PIWIK_INCLUDE_PATH . '/core/testMinimumPhpVersion.php'; |
| 31 | if (\session_status() !== \PHP_SESSION_ACTIVE && !\headers_sent()) { |
| 32 | \session_cache_limiter('nocache'); |
| 33 | } |
| 34 | \define('PIWIK_DEFAULT_TIMEZONE', @\date_default_timezone_get()); |
| 35 | @\date_default_timezone_set('UTC'); |
| 36 | \disableEaccelerator(); |
| 37 | require_once \PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php'; |
| 38 | // Composer autoloader |
| 39 | require_once \PIWIK_VENDOR_PATH . '/autoload.php'; |
| 40 | require_once \PIWIK_INCLUDE_PATH . '/libs/upgradephp/dev.php'; |
| 41 | require_once \PIWIK_INCLUDE_PATH . '/DIObject.php'; |
| 42 | \Piwik\Plugin\Manager::initPluginDirectories(); |
| 43 | /** |
| 44 | * Eaccelerator does not support closures and is known to be not compatible with Piwik. Therefore we are disabling |
| 45 | * it automatically. At this point it looks like Eaccelerator is no longer under development and the bug has not |
| 46 | * been fixed within a year. |
| 47 | * |
| 48 | * @link https://github.com/piwik/piwik/issues/4439#comment:8 |
| 49 | * @link https://github.com/eaccelerator/eaccelerator/issues/12 |
| 50 | */ |
| 51 | function disableEaccelerator() |
| 52 | { |
| 53 | $isEacceleratorUsed = \ini_get('eaccelerator.enable'); |
| 54 | if (!empty($isEacceleratorUsed)) { |
| 55 | @\ini_set('eaccelerator.enable', 0); |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 |