diff --git a/CoreVersions/0.2.0/Distrib.php b/CoreVersions/0.2.0/Distrib.php
index 70e12d6..7643ebd 100755
--- a/CoreVersions/0.2.0/Distrib.php
+++ b/CoreVersions/0.2.0/Distrib.php
@@ -25,4 +25,5 @@
#################################################################
define("BAIKAL_VERSION", "0.2.0");
-define("BAIKAL_HOMEPAGE", "http://baikal.codr.fr");
\ No newline at end of file
+define("BAIKAL_HOMEPAGE", "http://baikal.codr.fr");
+define("PROJECT_PACKAGE", "regular");
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/Baikal/Core/Tools.php b/CoreVersions/0.2.0/Frameworks/Baikal/Core/Tools.php
index fce5221..0e328fe 100755
--- a/CoreVersions/0.2.0/Frameworks/Baikal/Core/Tools.php
+++ b/CoreVersions/0.2.0/Frameworks/Baikal/Core/Tools.php
@@ -61,17 +61,17 @@ class Tools {
# Asserting DB file exists
if(!file_exists(PROJECT_SQLITE_FILE)) {
- throw new \Exception("DB file does not exist. To create it, please copy 'Core/Resources/db.empty.sqlite' to 'Specific/db/.ht.db.sqlite'");
+ throw new \Exception("DB file does not exist. To create it, please copy 'Core/Resources/db.empty.sqlite' to '" . PROJECT_SQLITE_FILE . "'");
}
# Asserting DB file is readable
if(!is_readable(PROJECT_SQLITE_FILE)) {
- throw new \Exception("DB file is not readable. Please give read permissions to httpd user on file 'Specific/db/.ht.db.sqlite'.");
+ throw new \Exception("DB file is not readable. Please give read permissions to httpd user on file '" . PROJECT_SQLITE_FILE . "'.");
}
# Asserting DB file is writable
if(!is_writable(PROJECT_SQLITE_FILE)) {
- throw new \Exception("DB file is not writable. Please give write permissions to httpd user on file 'Specific/db/.ht.db.sqlite'.");
+ throw new \Exception("DB file is not writable. Please give write permissions to httpd user on file '" . PROJECT_SQLITE_FILE . "'.");
}
# Asserting config file exists
diff --git a/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php b/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php
index 59d1508..2dfa880 100755
--- a/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php
+++ b/CoreVersions/0.2.0/Frameworks/Baikal/Framework.php
@@ -44,7 +44,7 @@ class Framework extends \Flake\Core\Framework {
# Registering Baikal classloader
define("BAIKAL_PATH_FRAMEWORKROOT", dirname(__FILE__) . "/");
- require_once(BAIKAL_PATH_FRAMEWORKROOT . '/Core/ClassLoader.php');
+ require_once(BAIKAL_PATH_FRAMEWORKROOT . 'Core/ClassLoader.php');
\Baikal\Core\ClassLoader::register();
\Baikal\Core\Tools::assertEnvironmentIsOk();
diff --git a/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/System.php b/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/System.php
index 4bdcdcc..7e83385 100755
--- a/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/System.php
+++ b/CoreVersions/0.2.0/Frameworks/Baikal/Model/Config/System.php
@@ -47,6 +47,9 @@ class System extends \Baikal\Model\Config {
"BAIKAL_STANDALONE_PORT" => array(
"type" => "integer",
),
+ "PROJECT_SQLITE_FILE" => array(
+ "type" => "litteral",
+ ),
);
protected $aData = array(
@@ -56,6 +59,7 @@ class System extends \Baikal\Model\Config {
"BAIKAL_CAL_BASEURI" => "",
"BAIKAL_STANDALONE_ALLOWED" => "",
"BAIKAL_STANDALONE_PORT" => "",
+ "PROJECT_SQLITE_FILE" => "",
);
public function formMorphologyForThisModelInstance() {
@@ -83,19 +87,6 @@ class System extends \Baikal\Model\Config {
)
)));
- $oMorpho->add(new \Formal\Element\Text(array(
- "prop" => "BAIKAL_PATH_SABREDAV",
- "label" => "Path to SabreDAV",
- "validation" => "required",
- "inputclass" => "input-xxlarge",
- "help" => "The absolute server path to SabreDAV API",
- "popover" => array(
- "title" => "Path to SabreDAV",
- "content" => "If Baïkal is hosted in a subfolder, this path should reflect it.
Whatever happens, it should begin and end with a slash.",
- "position" => "top"
- )
- )));
-
$oMorpho->add(new \Formal\Element\Text(array(
"prop" => "BAIKAL_AUTH_REALM",
"label" => "Auth realm",
@@ -118,6 +109,27 @@ class System extends \Baikal\Model\Config {
"label" => "Standalone Baïkal port"
)));
}
+
+ $oMorpho->add(new \Formal\Element\Text(array(
+ "prop" => "BAIKAL_PATH_SABREDAV",
+ "label" => "Path to SabreDAV",
+ "validation" => "required",
+ "inputclass" => "input-xxlarge",
+ "help" => "The absolute server path to SabreDAV API",
+ "popover" => array(
+ "title" => "Path to SabreDAV",
+ "content" => "If Baïkal is hosted in a subfolder, this path should reflect it.
Whatever happens, it should begin and end with a slash.",
+ "position" => "top"
+ )
+ )));
+
+ $oMorpho->add(new \Formal\Element\Text(array(
+ "prop" => "PROJECT_SQLITE_FILE",
+ "label" => "SQLite file path",
+ "validation" => "required",
+ "inputclass" => "input-xxlarge",
+ "help" => "The absolute server path to the SQLite file",
+ )));
return $oMorpho;
}
diff --git a/CoreVersions/0.2.0/Frameworks/Baikal/Scripts/package-flat.sh b/CoreVersions/0.2.0/Frameworks/Baikal/Scripts/package-flat.sh
index 0654dfc..d71c574 100755
--- a/CoreVersions/0.2.0/Frameworks/Baikal/Scripts/package-flat.sh
+++ b/CoreVersions/0.2.0/Frameworks/Baikal/Scripts/package-flat.sh
@@ -59,5 +59,8 @@ mv html/* .
mv html/.htaccess .
rm -Rf html
+# Tagging Distrib
+cat Core/Distrib.php | sed -e "s/\"regular\"/\"flat\"/g" > Core/Distrib.php
+
# Displaying result
echo "# "$TEMPDIR
diff --git a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php
index 54040ae..8100935 100755
--- a/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php
+++ b/CoreVersions/0.2.0/Frameworks/BaikalAdmin/Controller/Install/Initialize.php
@@ -41,6 +41,8 @@ class Initialize extends \Flake\Core\Controller {
}
$this->createDefaultConfigFilesIfNeeded();
+ $this->createHtaccessFilesIfNeeded();
+
$this->oModel = new \Baikal\Model\Config\Standard(PROJECT_PATH_SPECIFIC . "config.php");
# Assert that config file is writable
@@ -103,6 +105,25 @@ PHP;
file_put_contents(PROJECT_PATH_SPECIFIC . "config.php", $sContent);
}
+ protected function createHtaccessFilesIfNeeded() {
+
+ if(!file_exists(PROJECT_PATH_DOCUMENTROOT . ".htaccess")) {
+ @copy(PROJECT_PATH_CORERESOURCES . "htaccess-documentroot", PROJECT_PATH_DOCUMENTROOT . ".htaccess");
+ }
+
+ if(!file_exists(PROJECT_PATH_DOCUMENTROOT . ".htaccess")) {
+ throw new \Exception("Unable to create " . PROJECT_PATH_DOCUMENTROOT . ".htaccess; you may try to create it manually by copying " . PROJECT_PATH_CORERESOURCES . "htaccess-documentroot");
+ }
+
+ if(!file_exists(PROJECT_PATH_SPECIFIC . ".htaccess")) {
+ @copy(PROJECT_PATH_CORERESOURCES . "htaccess-specific", PROJECT_PATH_SPECIFIC . ".htaccess");
+ }
+
+ if(!file_exists(PROJECT_PATH_SPECIFIC . ".htaccess")) {
+ throw new \Exception("Unable to create " . PROJECT_PATH_SPECIFIC . ".htaccess; you may try to create it manually by copying " . PROJECT_PATH_CORERESOURCES . "htaccess-specific");
+ }
+ }
+
protected function createDefaultConfigFilesIfNeeded() {
# Create empty config.php if needed
@@ -180,6 +201,10 @@ define("BAIKAL_CARD_BASEURI", PROJECT_BASEURI . "card.php/");
# Should begin and end with a "/"
define("BAIKAL_CAL_BASEURI", PROJECT_BASEURI . "cal.php/");
+
+# Define path to Baïkal Database SQLite file
+define("PROJECT_SQLITE_FILE", PROJECT_PATH_SPECIFIC . "db/db.sqlite");
+
CODE;
$sCode = trim($sCode);
return $sCode;
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Core/Auth.php b/CoreVersions/0.2.0/Frameworks/Flake/Core/Auth.php
deleted file mode 100755
index 8381cd2..0000000
--- a/CoreVersions/0.2.0/Frameworks/Flake/Core/Auth.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-# All rights reserved
-#
-# http://flake.codr.fr
-#
-# This script is part of the Flake project. The Flake
-# project is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# The GNU General Public License can be found at
-# http://www.gnu.org/copyleft/gpl.html.
-#
-# This script is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# This copyright notice MUST APPEAR in all copies of the script!
-#################################################################
-
-namespace Flake\Core;
-
-class Auth extends \Flake\Core\FLObject {
- public static function isAdmin() {
- $sUrl = \Flake\Util\Tools::getCurrentUrl();
- $aParts = explode("/", $sUrl);
- return in_array("edit", $aParts);
- }
-}
\ No newline at end of file
diff --git a/CoreVersions/0.2.0/Frameworks/Flake/Framework.php b/CoreVersions/0.2.0/Frameworks/Flake/Framework.php
index 488c3d0..16dc5b5 100755
--- a/CoreVersions/0.2.0/Frameworks/Flake/Framework.php
+++ b/CoreVersions/0.2.0/Frameworks/Flake/Framework.php
@@ -101,33 +101,24 @@ class Framework extends \Flake\Core\Framework {
# not using realpath here to avoid symlinks resolution
define("PROJECT_PATH_CORE", PROJECT_PATH_ROOT . "Core/");
+ define("PROJECT_PATH_CORERESOURCES", PROJECT_PATH_CORE . "Resources/");
define("PROJECT_PATH_SPECIFIC", PROJECT_PATH_ROOT . "Specific/");
define("PROJECT_PATH_FRAMEWORKS", PROJECT_PATH_CORE . "Frameworks/");
define("PROJECT_PATH_WWWROOT", PROJECT_PATH_CORE . "WWWRoot/");
- # Define path to Baïkal SQLite file
- define("PROJECT_SQLITE_FILE", PROJECT_PATH_SPECIFIC . "db/.ht.db.sqlite");
-
# Activate Flake class loader
require_once(FLAKE_PATH_ROOT . 'Core/ClassLoader.php');
\Flake\Core\ClassLoader::register();
-
- # Asserting DB file exists
- if(!file_exists(PROJECT_SQLITE_FILE)) {
- die("