Trim trailing blank space.
This commit is contained in:
parent
96358f0bc0
commit
3d1217a1be
7 changed files with 28 additions and 28 deletions
|
@ -17,7 +17,7 @@ before_install:
|
||||||
install:
|
install:
|
||||||
# Install nginx, php5-fpm and configure them
|
# Install nginx, php5-fpm and configure them
|
||||||
- sudo ./tests/setup_test_env.sh $TRAVIS_BUILD_DIR
|
- sudo ./tests/setup_test_env.sh $TRAVIS_BUILD_DIR
|
||||||
|
|
||||||
# Create the database schema for shimmie.
|
# Create the database schema for shimmie.
|
||||||
- if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi
|
- if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi
|
||||||
- if [[ "$DB" == "pgsql" ]]; then psql -c "CREATE DATABASE shimmie;" -U postgres; fi
|
- if [[ "$DB" == "pgsql" ]]; then psql -c "CREATE DATABASE shimmie;" -U postgres; fi
|
||||||
|
|
|
@ -33,7 +33,7 @@ class AliasEditorTheme extends Themelet {
|
||||||
foreach($aliases as $old => $new) {
|
foreach($aliases as $old => $new) {
|
||||||
$h_old = html_escape($old);
|
$h_old = html_escape($old);
|
||||||
$h_new = "<a href='".make_link("post/list/".url_escape($new)."/1")."'>".html_escape($new)."</a>";
|
$h_new = "<a href='".make_link("post/list/".url_escape($new)."/1")."'>".html_escape($new)."</a>";
|
||||||
|
|
||||||
$h_aliases .= "<tr><td>$h_old</td><td>$h_new</td>";
|
$h_aliases .= "<tr><td>$h_old</td><td>$h_new</td>";
|
||||||
if($can_manage) {
|
if($can_manage) {
|
||||||
$h_aliases .= "
|
$h_aliases .= "
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* PMs; or one could replace it with a blog module; or one could have a blog
|
* PMs; or one could replace it with a blog module; or one could have a blog
|
||||||
* which links to images on an image board, with no wiki or messaging, and so
|
* which links to images on an image board, with no wiki or messaging, and so
|
||||||
* on and so on...
|
* on and so on...
|
||||||
*
|
*
|
||||||
* Dijkstra will kill me for personifying my architecture, but I can't think
|
* Dijkstra will kill me for personifying my architecture, but I can't think
|
||||||
* of a better way without going into all the little details.
|
* of a better way without going into all the little details.
|
||||||
* There are a bunch of Extension subclasses, they talk to each other by sending
|
* There are a bunch of Extension subclasses, they talk to each other by sending
|
||||||
|
@ -32,9 +32,9 @@
|
||||||
* \li \ref unittests
|
* \li \ref unittests
|
||||||
*
|
*
|
||||||
* \page scglobals SCore Globals
|
* \page scglobals SCore Globals
|
||||||
*
|
*
|
||||||
* There are four global variables which are pretty essential to most extensions:
|
* There are four global variables which are pretty essential to most extensions:
|
||||||
*
|
*
|
||||||
* \li $config -- some variety of Config subclass
|
* \li $config -- some variety of Config subclass
|
||||||
* \li $database -- a Database object used to get raw SQL access
|
* \li $database -- a Database object used to get raw SQL access
|
||||||
* \li $page -- a Page to holds all the loose bits of extension output
|
* \li $page -- a Page to holds all the loose bits of extension output
|
||||||
|
|
26
install.php
26
install.php
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Shimmie Installer
|
* Shimmie Installer
|
||||||
*
|
*
|
||||||
* @package Shimmie
|
* @package Shimmie
|
||||||
* @author Shish et al. <webmaster at shishnet.org>
|
* @author Shish et al. <webmaster at shishnet.org>
|
||||||
* @link http://code.shishnet.org/shimmie2/
|
* @link http://code.shishnet.org/shimmie2/
|
||||||
|
@ -49,7 +49,7 @@ assert_options(ASSERT_ACTIVE, 1);
|
||||||
assert_options(ASSERT_BAIL, 1);
|
assert_options(ASSERT_BAIL, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compute the path to the folder containing "install.php" and
|
* Compute the path to the folder containing "install.php" and
|
||||||
* store it as the 'Shimmie Root' folder for later on.
|
* store it as the 'Shimmie Root' folder for later on.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
|
@ -225,7 +225,7 @@ function ask_questions() { // {{{
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h3>Help</h3>
|
<h3>Help</h3>
|
||||||
|
|
||||||
<p class="dbconf mysql pgsql">
|
<p class="dbconf mysql pgsql">
|
||||||
Please make sure the database you have chosen exists and is empty.<br>
|
Please make sure the database you have chosen exists and is empty.<br>
|
||||||
The username provided must have access to create tables within the database.
|
The username provided must have access to create tables within the database.
|
||||||
|
@ -238,7 +238,7 @@ function ask_questions() { // {{{
|
||||||
Drivers can generally be downloaded with your OS package manager;
|
Drivers can generally be downloaded with your OS package manager;
|
||||||
for Debian / Ubuntu you want php5-pgsql, php5-mysql, or php5-sqlite.
|
for Debian / Ubuntu you want php5-pgsql, php5-mysql, or php5-sqlite.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
EOD;
|
EOD;
|
||||||
} // }}}
|
} // }}}
|
||||||
|
@ -251,14 +251,14 @@ function install_process() { // {{{
|
||||||
create_tables();
|
create_tables();
|
||||||
insert_defaults();
|
insert_defaults();
|
||||||
write_config();
|
write_config();
|
||||||
|
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
} // }}}
|
} // }}}
|
||||||
|
|
||||||
function create_tables() { // {{{
|
function create_tables() { // {{{
|
||||||
try {
|
try {
|
||||||
$db = new Database();
|
$db = new Database();
|
||||||
|
|
||||||
if ( $db->count_tables() > 0 ) {
|
if ( $db->count_tables() > 0 ) {
|
||||||
print <<<EOD
|
print <<<EOD
|
||||||
<div id="installer">
|
<div id="installer">
|
||||||
|
@ -271,7 +271,7 @@ function create_tables() { // {{{
|
||||||
EOD;
|
EOD;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->create_table("aliases", "
|
$db->create_table("aliases", "
|
||||||
oldtag VARCHAR(128) NOT NULL PRIMARY KEY,
|
oldtag VARCHAR(128) NOT NULL PRIMARY KEY,
|
||||||
newtag VARCHAR(128) NOT NULL,
|
newtag VARCHAR(128) NOT NULL,
|
||||||
|
@ -353,13 +353,13 @@ EOD;
|
||||||
EOD;
|
EOD;
|
||||||
exit($e->getMessage());
|
exit($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // }}}
|
} // }}}
|
||||||
|
|
||||||
function insert_defaults() { // {{{
|
function insert_defaults() { // {{{
|
||||||
try {
|
try {
|
||||||
$db = new Database();
|
$db = new Database();
|
||||||
|
|
||||||
$db->execute("INSERT INTO users(name, pass, joindate, class) VALUES(:name, :pass, now(), :class)", Array("name" => 'Anonymous', "pass" => null, "class" => 'anonymous'));
|
$db->execute("INSERT INTO users(name, pass, joindate, class) VALUES(:name, :pass, now(), :class)", Array("name" => 'Anonymous', "pass" => null, "class" => 'anonymous'));
|
||||||
$db->execute("INSERT INTO config(name, value) VALUES(:name, :value)", Array("name" => 'anon_id', "value" => $db->get_last_insert_id('users_id_seq')));
|
$db->execute("INSERT INTO config(name, value) VALUES(:name, :value)", Array("name" => 'anon_id', "value" => $db->get_last_insert_id('users_id_seq')));
|
||||||
|
|
||||||
|
@ -408,7 +408,7 @@ function build_dirs() { // {{{
|
||||||
|
|
||||||
// Clear file status cache before checking again.
|
// Clear file status cache before checking again.
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
if(
|
if(
|
||||||
!file_exists("images") || !file_exists("thumbs") || !file_exists("data") ||
|
!file_exists("images") || !file_exists("thumbs") || !file_exists("data") ||
|
||||||
!is_writable("images") || !is_writable("thumbs") || !is_writable("data")
|
!is_writable("images") || !is_writable("thumbs") || !is_writable("data")
|
||||||
|
@ -432,11 +432,11 @@ function write_config() { // {{{
|
||||||
$file_content = '<' . '?php' . "\n" .
|
$file_content = '<' . '?php' . "\n" .
|
||||||
"define('DATABASE_DSN', '".DATABASE_DSN."');\n" .
|
"define('DATABASE_DSN', '".DATABASE_DSN."');\n" .
|
||||||
'?' . '>';
|
'?' . '>';
|
||||||
|
|
||||||
if(!file_exists("data/config")) {
|
if(!file_exists("data/config")) {
|
||||||
mkdir("data/config", 0755, true);
|
mkdir("data/config", 0755, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!file_put_contents("data/config/shimmie.conf.php", $file_content, LOCK_EX)) {
|
if(!file_put_contents("data/config/shimmie.conf.php", $file_content, LOCK_EX)) {
|
||||||
$h_file_content = htmlentities($file_content);
|
$h_file_content = htmlentities($file_content);
|
||||||
print <<<EOD
|
print <<<EOD
|
||||||
|
@ -449,7 +449,7 @@ function write_config() { // {{{
|
||||||
before the "<?php" or after the "?>"
|
before the "<?php" or after the "?>"
|
||||||
|
|
||||||
<p><textarea cols="80" rows="2">$file_content</textarea>
|
<p><textarea cols="80" rows="2">$file_content</textarea>
|
||||||
|
|
||||||
<p>Once done, <a href="index.php">Continue</a>
|
<p>Once done, <a href="index.php">Continue</a>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,7 +31,7 @@ server {
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
root $1;
|
root $1;
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
index index.php;
|
index index.php;
|
||||||
# For the Nice URLs in Shimmie.
|
# For the Nice URLs in Shimmie.
|
||||||
|
@ -40,7 +40,7 @@ server {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php\$ {
|
location ~ \.php\$ {
|
||||||
try_files \$uri =404;
|
try_files \$uri =404;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* SimpleTest integration with Travis CI for Shimmie
|
* SimpleTest integration with Travis CI for Shimmie
|
||||||
*
|
*
|
||||||
* @package Shimmie
|
* @package Shimmie
|
||||||
* @author jgen <jeffgenovy@gmail.com>
|
* @author jgen <jeffgenovy@gmail.com>
|
||||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* SimpleTest integration with Travis CI for Shimmie
|
* SimpleTest integration with Travis CI for Shimmie
|
||||||
*
|
*
|
||||||
* @package Shimmie
|
* @package Shimmie
|
||||||
* @author jgen <jeffgenovy@gmail.com>
|
* @author jgen <jeffgenovy@gmail.com>
|
||||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
|
@ -31,20 +31,20 @@ class ShimmieInstallerTest extends WebTestCase {
|
||||||
{
|
{
|
||||||
$db = constant("_TRAVIS_DATABASE");
|
$db = constant("_TRAVIS_DATABASE");
|
||||||
$host = constant("_TRAVIS_WEBHOST");
|
$host = constant("_TRAVIS_WEBHOST");
|
||||||
|
|
||||||
// Make sure that we know where the host is.
|
// Make sure that we know where the host is.
|
||||||
$this->assertFalse(empty($host));
|
$this->assertFalse(empty($host));
|
||||||
// Make sure that we know what database to use.
|
// Make sure that we know what database to use.
|
||||||
$this->assertFalse(empty($db));
|
$this->assertFalse(empty($db));
|
||||||
|
|
||||||
$this->get($host);
|
$this->get($host);
|
||||||
$this->assertResponse(200);
|
$this->assertResponse(200);
|
||||||
$this->assertTitle("Shimmie Installation");
|
$this->assertTitle("Shimmie Installation");
|
||||||
$this->assertText("Database Install");
|
$this->assertText("Database Install");
|
||||||
|
|
||||||
$this->setField("database_type", $db);
|
$this->setField("database_type", $db);
|
||||||
$this->assertField("database_host", "localhost");
|
$this->assertField("database_host", "localhost");
|
||||||
|
|
||||||
if ($db === "mysql") {
|
if ($db === "mysql") {
|
||||||
$this->setField("database_user", "root");
|
$this->setField("database_user", "root");
|
||||||
$this->setField("database_password", "");
|
$this->setField("database_password", "");
|
||||||
|
@ -54,10 +54,10 @@ class ShimmieInstallerTest extends WebTestCase {
|
||||||
} else {
|
} else {
|
||||||
die("Unsupported Database Option");
|
die("Unsupported Database Option");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertField("database_name", "shimmie");
|
$this->assertField("database_name", "shimmie");
|
||||||
$this->clickSubmit("Go!");
|
$this->clickSubmit("Go!");
|
||||||
|
|
||||||
if (!$this->assertText("Installation Succeeded!")) {
|
if (!$this->assertText("Installation Succeeded!")) {
|
||||||
$this->showSource();
|
$this->showSource();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue