diff --git a/composer.phar b/composer.phar new file mode 100755 index 0000000..fa2a122 Binary files /dev/null and b/composer.phar differ diff --git a/database/seeds/BlogTablesSeeder.php b/database/seeds/BlogTablesSeeder.php index 0163889..9c9fb7a 100644 --- a/database/seeds/BlogTablesSeeder.php +++ b/database/seeds/BlogTablesSeeder.php @@ -21,7 +21,7 @@ public function run() // update tables instead of overwriting (think timestamps, original...) $parser = new DocumentParser; - $it = new RecursiveDirectoryIterator(realpath("./storage/app/blog")); + $it = new RecursiveDirectoryIterator(realpath(dirname(dirname(dirname(__FILE__)))."/storage/app/blog")); $display = Array ( 'md' ); foreach(new RecursiveIteratorIterator($it) as $file) { diff --git a/database/seeds/PagesTableSeeder.php b/database/seeds/PagesTableSeeder.php index 487f860..20a91b3 100644 --- a/database/seeds/PagesTableSeeder.php +++ b/database/seeds/PagesTableSeeder.php @@ -14,7 +14,7 @@ public function run() // update tables instead of overwriting (think timestamps, original...) $parser = new DocumentParser; - $it = new RecursiveDirectoryIterator(realpath("./storage/app/pages")); + $it = new RecursiveDirectoryIterator(realpath(dirname(dirname(dirname(__FILE__)))."/storage/app/pages")); $display = Array ( 'md' ); foreach(new RecursiveIteratorIterator($it) as $file) { diff --git a/database/seeds/ProjectsTableSeeder.php b/database/seeds/ProjectsTableSeeder.php index 6ad0501..b39d3cb 100644 --- a/database/seeds/ProjectsTableSeeder.php +++ b/database/seeds/ProjectsTableSeeder.php @@ -14,7 +14,7 @@ public function run() // update tables instead of overwriting (think timestamps, original...) $parser = new DocumentParser; - $it = new RecursiveDirectoryIterator(realpath("./storage/app/projects")); + $it = new RecursiveDirectoryIterator(realpath(dirname(dirname(dirname(__FILE__)))."/storage/app/projects")); $display = Array ( 'md' ); foreach(new RecursiveIteratorIterator($it) as $file) { diff --git a/scripts/setupB3.sh b/scripts/setupB3.sh index 8e41bbb..380c3e3 100644 --- a/scripts/setupB3.sh +++ b/scripts/setupB3.sh @@ -168,6 +168,12 @@ transparent: false | true Testings EOM +# Install composer +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" +php composer-setup.php +php -r "unlink('composer-setup.php');" + # Populate DB bash $DIR/populate-db.sh @@ -176,7 +182,7 @@ cat ~/.ssh/id_rsa.pub | ssh $1 'cat >> .ssh/authorized_keys' # Set up git hooks and scripts on server and client HOOK="#!/bin/sh -git --work-tree=$WEBROOT --git-dir=$SERVERROOT/repo/site.git checkout -f +git --work-tree=$WEBROOT --git-dir=$SERVERROOT/repo/site.git checkout -f master bash $WEBROOT/scripts/populate-db.sh" ssh $1 "mkdir repo && cd repo && mkdir site.git && cd site.git && git init --bare && cd hooks && echo '$HOOK' > post-receive && chmod +x post-receive" @@ -188,7 +194,7 @@ RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC] RewriteRule ^ %1 [L,NE,R=302] RewriteRule ^((?!public/).*)$ public/$1 [L,NC]" -ssh $1 "echo '$ACCESS' > $SERVERROOT/.htaccess" +ssh $1 "echo '$ACCESS' > $WEBROOT/.htaccess" # Add first commit git add -A && git commit -m "Set up repo"