Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Update installer: active APC caching by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 5, 2016
1 parent fc40146 commit a671ec6
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 35 deletions.
24 changes: 21 additions & 3 deletions core/src/plugins/boot.conf/BootConfLoader.php
Expand Up @@ -149,9 +149,15 @@ public function printFormFromServerSettings($fullManifest)
$uri = $_SERVER["REQUEST_URI"];
if (strpos($uri, '.php') !== false) $uri = PathUtils::forwardSlashDirname($uri);
if (empty($uri)) $uri = "/";
$tryFullLocale = setlocale(LC_CTYPE, 0);
$locale = TextEncoder::getEncoding();
if(strpos($tryFullLocale, ".") !== false)$locale = $tryFullLocale;
if(defined('AJXP_LOCALE')) $locale = AJXP_LOCALE;
$apcCache = function_exists('apc_fetch') || function_exists('apcu_fetch');
$loadedValues = array(
"ENCODING" => (defined('AJXP_LOCALE') ? AJXP_LOCALE : TextEncoder::getEncoding()),
"SERVER_URI" => $uri
"ENCODING" => $locale,
"SERVER_URI" => $uri,
"APC_CACHE_ENABLE" => $apcCache ? "true" : "false"
);
foreach ($loadedValues as $pName => $pValue) {
$vNodes = $xPath->query("server_settings/global_param[@name='$pName']");
Expand Down Expand Up @@ -328,7 +334,19 @@ public function createBootstrapConf($data)
"group_switch_value" => "auth.sql",
"SQL_DRIVER" => array("core_driver" => "core", "group_switch_value" => "core")
));
$coreCache["UNIQUE_INSTANCE_CONFIG"] = array_merge($coreCache["UNIQUE_INSTANCE_CONFIG"], array());
if($data["APC_CACHE_ENABLE"]){
$coreCache["UNIQUE_INSTANCE_CONFIG"] = array_merge($coreCache["UNIQUE_INSTANCE_CONFIG"], array(
"instance_name" => "cache.doctrine",
"group_switch_value" => "cache.doctrine",
"CACHE_PREFIX" => StringHelper::slugify("pydio-".$data["SERVER_URI"]),
"DRIVER" => [
"group_switch_value" => "apc",
"driver" => "apc",
]
));
}else{
$coreCache["UNIQUE_INSTANCE_CONFIG"] = array_merge($coreCache["UNIQUE_INSTANCE_CONFIG"], array());
}

// DETECT REQUIRED SQL TABLES AND INSTALL THEM
$registry = PluginsService::getInstance(Context::emptyContext())->getDetectedPlugins();
Expand Down
2 changes: 2 additions & 0 deletions core/src/plugins/boot.conf/i18n/conf/de.php
Expand Up @@ -75,4 +75,6 @@
"Detected Server Path" => "Server-Pfad",
"Make sure this is correct, as it's used to rewrite the htaccess file" => " Stellen Sie sicher, dass dieser Pfad korrekt ist. Er wird zum generieren der htaccess-Datei verwendet.",
"Select a language activated by default( users will still be able to switch)" => "Wählen Sie die standardmäßig aktivierte Sprache aus. Die Benutzer können die Sprache trotzdem ändern.",
"Enable cache (recommended)" => "Enable cache (recommended)",
"Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache." => "Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache."
);
2 changes: 2 additions & 0 deletions core/src/plugins/boot.conf/i18n/conf/en.php
Expand Up @@ -75,4 +75,6 @@
"Detected Server Path" => "Detected Server Path",
"Make sure this is correct, as it's used to rewrite the htaccess file" => "Make sure this is correct, as it's used to rewrite the htaccess file",
"Select a language activated by default( users will still be able to switch)" => "Select a language activated by default( users will still be able to switch)",
"Enable cache (recommended)" => "Enable cache (recommended)",
"Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache." => "Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache."
);
19 changes: 19 additions & 0 deletions core/src/plugins/boot.conf/i18n/conf/fr.php
Expand Up @@ -58,5 +58,24 @@
"Mail address of the user" => "Adresse courriel de l'utilsateur",
"Display name" => "Nom à afficher",
"Password" => "Mot de passe",
"Main options" => "Options Principales",
"Set up application title and create a connexion identifier for the super-administrator user. Make sure to use a strong password, as this user will have full access to the server." => "Choisir le nom de l'application et créer des identifiants de connexion pour le super-administrateur. Veillez à utiliser un mot de passe fort, car cet utilisateur a accès au serveur.",
"Application Title" => "Titre de l'application",
"Your system title" => "Le titre de la plateform tel qu'il apparait aux utilisateurs.",
"Welcome Message" => "Message de bienvenue",
"An additional message displayed at startup, on the splash screen and the login screen." => "Message supplémentaire affiché sur la page d'accueil et dans l'écran de chargement.",
"User-friendly name of the user" => "Nom de l'utilisateur",
"Welcome to Pydio" => "Bienvenue sur Pydio",
"Database Connexion" => "Base de données",
"Driver type (do not touch)" => "Type de driver (ne pas changer)",
"Advanced Options" => "Options Avancées",
"Please review these technical parameters. Encoding and URI should be auto-detected, but please make sure they reflect your actual server configuration." => "Veuillez valider ces paramètres complémentaires. L'encodage et l'URI doivent être détectés automatiquement, mais assurez vous qu'ils correspondent à votre serveur.",
"Detected Encoding" => "Encodage détecté",
"Please make sure to set the encoding corresponding to your server configuration, something like ln_LN.CHARSET, e.g en_US.UTF-8" => "Utilisez la valeur de l'encodage de votre système de fichier sur le serveur, au format ln_LN.CHARSET, par exemple fr_FR.UTF-8",
"Detected Server Path" => "Chemin d'accès détecté",
"Make sure this is correct, as it's used to rewrite the htaccess file" => "Chemin depuis le DocumentRoot de votre serveur web, utilisé dans la réécriture des redirections.",
"Select a language activated by default( users will still be able to switch)" => "Selectionnez un langage par défaut (les utilisateurs pourront le changer)",
"Enable cache (recommended)" => "Activer le cache (recommandé)",
"Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache." => "Utiliser un cache de type clé/valeur pour stocker des données serveurs en mémoire. Is APC/APCu est détecté, ça sera activé par défaut, vous pouvez le changer pour utiliser un serveur à part avec Redis ou Memcache."

);
20 changes: 19 additions & 1 deletion core/src/plugins/boot.conf/i18n/conf/it.php
Expand Up @@ -58,5 +58,23 @@
"Mail address of the user" => "Indirizzo mail dell'utente",
"Display name" => "Nome Visualizzato",
"Password" => "Password",

"Main options" => "Main options",
"Set up application title and create a connexion identifier for the super-administrator user. Make sure to use a strong password, as this user will have full access to the server." => "Set up application title and create a connexion identifier for the super-administrator user. Make sure to use a strong password, as this user will have full access to the server.",
"Application Title" => "Application Title",
"Your system title" => "Your system title",
"Welcome Message" => "Welcome Message",
"An additional message displayed at startup, on the splash screen and the login screen." => "An additional message displayed at startup, on the splash screen and the login screen.",
"User-friendly name of the user" => "User-friendly name of the user",
"Welcome to Pydio" => "Welcome to Pydio",
"Database Connexion" => "Database Connexion",
"Driver type (do not touch)" => "Driver type (do not touch)",
"Advanced Options" => "Advanced Options",
"Please review these technical parameters. Encoding and URI should be auto-detected, but please make sure they reflect your actual server configuration." => "Please review these technical parameters. Encoding and URI should be auto-detected, but please make sure they reflect your actual server configuration.",
"Detected Encoding" => "Detected Encoding",
"Please make sure to set the encoding corresponding to your server configuration, something like ln_LN.CHARSET, e.g en_US.UTF-8" => "Please make sure to set the encoding corresponding to your server configuration, something like ln_LN.CHARSET, e.g en_US.UTF-8",
"Detected Server Path" => "Detected Server Path",
"Make sure this is correct, as it's used to rewrite the htaccess file" => "Make sure this is correct, as it's used to rewrite the htaccess file",
"Select a language activated by default( users will still be able to switch)" => "Select a language activated by default( users will still be able to switch)",
"Enable cache (recommended)" => "Enable cache (recommended)",
"Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache." => "Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache."
);
1 change: 1 addition & 0 deletions core/src/plugins/boot.conf/manifest.xml
Expand Up @@ -23,6 +23,7 @@
<global_param group="CONF_MESSAGE[Advanced Options]" name="AdvancedLegend" type="legend" label="" description="CONF_MESSAGE[Please review these technical parameters. Encoding and URI should be auto-detected, but please make sure they reflect your actual server configuration.]"/>
<global_param group="CONF_MESSAGE[Advanced Options]" name="ENCODING" type="string" label="CONF_MESSAGE[Detected Encoding]" description="CONF_MESSAGE[Please make sure to set the encoding corresponding to your server configuration, something like ln_LN.CHARSET, e.g en_US.UTF-8]" default="" mandatory="true"/>
<global_param group="CONF_MESSAGE[Advanced Options]" name="SERVER_URI" type="string" label="CONF_MESSAGE[Detected Server Path]" description="CONF_MESSAGE[Make sure this is correct, as it's used to rewrite the htaccess file]" default="/" mandatory="true"/>
<global_param group="CONF_MESSAGE[Advanced Options]" name="APC_CACHE_ENABLE" type="boolean" label="CONF_MESSAGE[Enable cache (recommended)]" description="CONF_MESSAGE[Use key/value store to cache server data in-memory. If APC/APCu is detected, it will be enabled by default, you can change this setting later to use a dedicated server like Redis or Memcache.]" default="false" mandatory="true"/>
<global_param group="CONF_MESSAGE[Advanced Options]" name="MAILER_ENABLE" type="group_switch:mailer" label="CONF_MESSAGE[Enable emails]" description="CONF_MESSAGE[Set up system to send emails]" default="no" mandatory="true"/>
<global_param group_switch_name="mailer" group_switch_value="no" group_switch_label="CONF_MESSAGE[No (you can enable mails later)]" name="status" type="hidden" label="No" description="s" default="no"/>
<global_param group_switch_name="mailer" group_switch_value="yes" group_switch_label="CONF_MESSAGE[Yes (requires a correct PHP configuration)]" name="status" type="hidden" label="Yes" description="s" default="yes"/>
Expand Down
6 changes: 5 additions & 1 deletion core/src/plugins/cache.doctrine/DoctrineCacheDriver.php
Expand Up @@ -123,8 +123,12 @@ private function initCacheWithNamespace($namespace){
$driverOptions = $this->getContextualOption($emptyContext, "DRIVER");
$cachePrefix = $this->getContextualOption($emptyContext, "CACHE_PREFIX");

if(!is_array($driverOptions) || !isset($driverOptions['driver'])){
if(!is_array($driverOptions) || (!isset($driverOptions["driver"]) && !isSet($driverOptions["group_switch_value"]))){
return null;
}else{
if(!isSet($driverOptions["driver"]) && isSet($driverOptions["group_switch_value"])){
$driverOptions["driver"] = $driverOptions["group_switch_value"];
}
}

switch ($driverOptions['driver']) {
Expand Down
3 changes: 3 additions & 0 deletions core/src/plugins/core.cache/AbstractCacheDriver.php
Expand Up @@ -275,6 +275,9 @@ public function listNamespaces(){
*/
public function getStats($namespace){
$cacheDriver = $this->getCacheDriver($namespace);
if(empty($cacheDriver) || !method_exists($cacheDriver, "getStats")){
return null;
}
return $cacheDriver->getStats();
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/gui.ajax/res/themes/orbit/css/allz.css

Large diffs are not rendered by default.

@@ -1,8 +1,8 @@
@tooltip_background_color:rgba(69, 77, 85, 0.86);
@tooltip_background_color:rgba(69, 77, 85, 0.72);
@tooltip_border_color:rgba(0,0,0,0);
@tooltip_font_color:@white;
@tooltip_font_size:13px;
@tooltip_title_font_size:1.1em;
@tooltip_font_size:12px;
@tooltip_title_font_size:14px;

.tooltipped
{
Expand All @@ -11,18 +11,20 @@
.simple_tooltip
{
position: absolute;
width: 150px;
width: 210px;
z-index: 10000;
font-weight: 300;
line-height: 19px;
font-size: @tooltip_font_size;
padding: 5px 10px;
padding: 8px 11px;
&_observer {
cursor: help;
}
&_title{
padding-top: 2px;
padding-bottom: 1px;
text-transform: uppercase;
font-weight: bold;
padding-top: 1px;
padding-bottom: 6px;
border-bottom: 1px solid rgba(255, 255, 255, 0.7);
margin-bottom: 6px;
font-size: @tooltip_title_font_size;
}
}
Expand Down
34 changes: 18 additions & 16 deletions core/src/plugins/gui.ajax/res/themes/orbit/css/pydio.css
Expand Up @@ -1750,24 +1750,26 @@ div.shadow_class {
}
.simple_tooltip {
position: absolute;
width: 150px;
width: 210px;
z-index: 10000;
font-size: 13px;
padding: 5px 10px;
font-weight: 300;
line-height: 19px;
font-size: 12px;
padding: 8px 11px;
}
.simple_tooltip_observer {
cursor: help;
}
.simple_tooltip_title {
padding-top: 2px;
padding-bottom: 1px;
text-transform: uppercase;
font-weight: bold;
font-size: 1.1em;
padding-top: 1px;
padding-bottom: 6px;
border-bottom: 1px solid rgba(255, 255, 255, 0.7);
margin-bottom: 6px;
font-size: 14px;
}
.down_arrow_tip,
.top_arrow_tip {
background: rgba(69, 77, 85, 0.86);
background: rgba(69, 77, 85, 0.72);
color: #ffffff;
border: 0;
border-radius: 2px;
Expand All @@ -1781,7 +1783,7 @@ div.shadow_class {
position: absolute;
pointer-events: none;
border-color: rgba(0, 0, 0, 0);
border-top-color: rgba(69, 77, 85, 0.86);
border-top-color: rgba(69, 77, 85, 0.72);
border-width: 5px;
left: 50%;
margin-left: -5px;
Expand All @@ -1800,7 +1802,7 @@ div.shadow_class {
}
.top_arrow_tip:after {
border-color: rgba(111, 123, 136, 0);
border-bottom-color: rgba(69, 77, 85, 0.86);
border-bottom-color: rgba(69, 77, 85, 0.72);
border-width: 5px;
left: 50%;
margin-left: -5px;
Expand All @@ -1811,7 +1813,7 @@ div.shadow_class {
.right_arrow_tip {
color: #ffffff;
border-radius: 4px;
background-color: rgba(69, 77, 85, 0.86);
background-color: rgba(69, 77, 85, 0.72);
border: 0;
}
.right_arrow_tip:after,
Expand All @@ -1826,22 +1828,22 @@ div.shadow_class {
}
.right_arrow_tip:after {
border-color: rgba(0, 0, 0, 0);
border-left-color: rgba(69, 77, 85, 0.86);
border-left-color: rgba(69, 77, 85, 0.72);
border-width: 5px;
top: 50%;
margin-top: -5px;
}
.right_arrow_tip:before {
border-color: rgba(0, 0, 0, 0);
border-left-color: rgba(69, 77, 85, 0.86);
border-left-color: rgba(69, 77, 85, 0.72);
border-width: 5px;
top: 50%;
margin-top: -5px;
}
.left_arrow_tip {
color: #ffffff;
border-radius: 4px;
background-color: rgba(69, 77, 85, 0.86);
background-color: rgba(69, 77, 85, 0.72);
border: 0;
}
.left_arrow_tip:after,
Expand All @@ -1856,7 +1858,7 @@ div.shadow_class {
}
.left_arrow_tip:before {
border-color: rgba(0, 0, 0, 0);
border-right-color: rgba(69, 77, 85, 0.86);
border-right-color: rgba(69, 77, 85, 0.72);
border-width: 5px;
top: 50%;
left: -10px;
Expand Down
Expand Up @@ -171,11 +171,11 @@
@tabs_horizontal_selected_tab_color:@applicationSecondaryColor;

/* tooltips */
@tooltip_background_color:rgba(69, 77, 85, 0.86);
@tooltip_background_color:rgba(69, 77, 85, 0.72);
@tooltip_border_color:rgba(0,0,0,0);
@tooltip_font_color:@white;
@tooltip_font_size:13px;
@tooltip_title_font_size:1.1em;
@tooltip_font_size:12px;
@tooltip_title_font_size:14px;

/* tree */
@tree_item_selected_bg:#666;
Expand Down

0 comments on commit a671ec6

Please sign in to comment.