Skip to content

Commit

Permalink
Renamed blank configuration file
Browse files Browse the repository at this point in the history
It’s now called „config-EDIT.php“ and has to be renamed to „config.php“
by the user. This prevents the unintentional overwriting of a user’s
configuration while upgrading the PAPI.
  • Loading branch information
stefangrund committed Nov 2, 2014
1 parent f6314f0 commit 4c647e7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_store
inc/config.php
12 changes: 6 additions & 6 deletions inc/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The URL under which your Personal API will be available
// including http:// and / at the end, e.g. http://api.stefangrund.de/ or http://localhost:8888/PersonalAPI/
define('BASEURL', 'INSERT_HERE');
define('BASEURL', 'http://personalapi.dev/');

// The root folder of your Personal API
define('ROOT', $_SERVER['DOCUMENT_ROOT'] . '/');
Expand All @@ -16,11 +16,11 @@
*/

// Configuration of your MySQL database
define('DB_HOST', 'INSERT_HERE'); // Hostname
define('DB_NAME', 'INSERT_HERE'); // Database Name
define('DB_USER', 'INSERT_HERE'); // Username
define('DB_PASS', 'INSERT_HERE'); // Password
define('DB_PORT', 'INSERT_HERE'); // Port, default: 3306
define('DB_HOST', '127.0.0.1'); // Hostname
define('DB_NAME', 'personalapi'); // Database Name
define('DB_USER', 'local'); // Username
define('DB_PASS', 'user'); // Password
define('DB_PORT', '3306'); // Port, default: 3306


// Required files; DO NOT CHANGE!
Expand Down
34 changes: 34 additions & 0 deletions inc/config_EDIT.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/* RENAME THIS FILE TO config.php WHEN YOU'RE READY TO INSTALL! */

// The URL under which your Personal API will be available
// including http:// and / at the end, e.g. http://api.stefangrund.de/ or http://localhost:8888/PersonalAPI/
define('BASEURL', 'INSERT_HERE');

// The root folder of your Personal API
define('ROOT', $_SERVER['DOCUMENT_ROOT'] . '/');

/*
If you run your API under a subdomain this would be the ROOT definiton:
define('ROOT', $_SERVER['DOCUMENT_ROOT'] . '/');
If you run it in a specific folder, e.g. in 'localhost/PersonalAPI', this would do it:
define('ROOT', $_SERVER['DOCUMENT_ROOT'] . '/PersonalAPI');
*/

// Configuration of your MySQL database
define('DB_HOST', 'INSERT_HERE'); // Hostname
define('DB_NAME', 'INSERT_HERE'); // Database Name
define('DB_USER', 'INSERT_HERE'); // Username
define('DB_PASS', 'INSERT_HERE'); // Password
define('DB_PORT', 'INSERT_HERE'); // Port, default: 3306

// Required files; DO NOT CHANGE!
function __autoload($className) {
require_once "class_" . $className . ".php";
}

require_once 'global_functions.php';

?>
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The Personal API runs under PHP and MySQL. I tested it with PHP 5.5.3 and MySQL

1. Again: Be sure you know what you're doing. Personal API isn't finished yet and it's not recommended to use it in production environments right now!
2. Download a [(pre-)release](https://github.com/stefangrund/PersonalAPI/releases).
3. Edit `inc/config.php` and add your database information.
3. Open `inc/config-EDIT.php` and add your database information. Then *rename it* to `config.php`.
4. Upload the Personal API files to the desired location on your web server. It's recommended to install your Personal API under a subdomain like _api.yourname.com_. If you do so, you're almost done. Otherwise you'll have to edit the Personal API paths in `config.php` and `.htaccess`.
5. Run the installation script by accessing the Personal API's URL in a web browser and follow the instructions.

Expand Down

0 comments on commit 4c647e7

Please sign in to comment.