- DocumentRoot "/var/www/html/${PROJECTFOLDER}/public"
-
- AllowOverride All
- Require all granted
-
-
-EOF
-)
-echo "${VHOST}" > /etc/apache2/sites-available/000-default.conf
-
-# enable mod_rewrite
-sudo a2enmod rewrite
-
-# restart apache
-service apache2 restart
-
-# remove default apache index.html
-sudo rm "/var/www/html/index.html"
-
-# install git
-sudo apt-get -y install git
-
-# git clone MINI
-sudo git clone https://github.com/panique/mini3 "/var/www/html/${PROJECTFOLDER}"
-
-# install Composer
-curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
-
-# go to project folder, create the PSR4 autoloader with Composer
-cd "/var/www/html/${PROJECTFOLDER}"
-composer install
-
-# run SQL statements from MINI3 folder
-sudo mysql -h "localhost" -u "root" "-p${PASSWORD}" < "/var/www/html/${PROJECTFOLDER}/_install/01-create-database.sql"
-sudo mysql -h "localhost" -u "root" "-p${PASSWORD}" < "/var/www/html/${PROJECTFOLDER}/_install/02-create-table-song.sql"
-sudo mysql -h "localhost" -u "root" "-p${PASSWORD}" < "/var/www/html/${PROJECTFOLDER}/_install/03-insert-demo-data-into-table-song.sql"
-
-# put the password into the application's config. This is quite hardcore, but why not :)
-sudo sed -i "s/12345678/${PASSWORD}/" "/var/www/html/${PROJECTFOLDER}/application/config/config.php"
-
-# final feedback
-echo "Voila!"
diff --git a/application/Core/Application.php b/application/Core/Application.php
index f6976ed..e6cb686 100644
--- a/application/Core/Application.php
+++ b/application/Core/Application.php
@@ -37,7 +37,7 @@ public function __construct()
$this->url_controller = new $controller();
// check for method: does such a method exist in the controller ?
- if (method_exists($this->url_controller, $this->url_action)) {
+ if (method_exists($this->url_controller, (string) $this->url_action)) {
if (!empty($this->url_params)) {
// Call the method and pass arguments to it
@@ -48,7 +48,7 @@ public function __construct()
}
} else {
- if (strlen($this->url_action) == 0) {
+ if (empty($this->url_action)) {
// no action defined: call the default index() method of a selected controller
$this->url_controller->index();
} else {
diff --git a/application/libs/helper.php b/application/libs/helper.php
deleted file mode 100644
index 3897934..0000000
--- a/application/libs/helper.php
+++ /dev/null
@@ -1,57 +0,0 @@
- $value) {
-
- // check if named parameters (':param') or anonymous parameters ('?') are used
- if (is_string($key)) {
- $keys[] = '/' . $key . '/';
- } else {
- $keys[] = '/[?]/';
- }
-
- // bring parameter into human-readable format
- if (is_string($value)) {
- $values[$key] = "'" . $value . "'";
- } elseif (is_array($value)) {
- $values[$key] = implode(',', $value);
- } elseif (is_null($value)) {
- $values[$key] = 'NULL';
- }
- }
-
- /*
- echo "
[DEBUG] Keys:";
- print_r($keys);
-
- echo "\n[DEBUG] Values: ";
- print_r($values);
- echo "
";
- */
-
- $raw_sql = preg_replace($keys, $values, $raw_sql, 1, $count);
-
- return $raw_sql;
- }
-
-}
diff --git a/application/view/_templates/footer.php b/application/view/_templates/footer.php
index 34d8820..86def1c 100644
--- a/application/view/_templates/footer.php
+++ b/application/view/_templates/footer.php
@@ -1,12 +1,13 @@
-
+