forked from pyrus/pearhunt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pyrus#2 from till/master
Related to pyrus#1
- Loading branch information
Showing
15 changed files
with
172 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
/config.inc.php | ||
config.inc.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
if (file_exists(__DIR__ . '/etc/config.inc.php')) { | ||
require_once __DIR__ . '/etc/config.inc.php'; | ||
} else { | ||
require_once __DIR__ . '/etc/config.sample.php'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
server { | ||
listen PORT_HERE; | ||
server_name SERVER.NAME.HERE; | ||
|
||
root PATH/TO/pearhunt/www; | ||
index index.php; | ||
|
||
try_files $uri @php_upstream; | ||
|
||
location @php_upstream { | ||
include fastcgi_params; | ||
|
||
fastcgi_pass unix:/tmp/.fastcgi.till/socket; | ||
fastcgi_index index.php; | ||
|
||
fastcgi_param SCRIPT_FILENAME PATH/TO/pearhunt/www$fastcgi_script_name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Simple Active Record implementation for pearhunt | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Utilities | ||
* @package pearhunt | ||
* @author Till Klampaeckel <till@php.net> | ||
* @copyright 2011 Till Klampaeckel | ||
* @license http://www1.unl.edu/wdn/wiki/Software_License BSD License | ||
* @link http://pear2.php.net/ | ||
*/ | ||
|
||
/** | ||
* Simple active record implementation for pearhunt. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Utilities | ||
* @package pearhunt | ||
* @author Till Klampaeckel <till@php.net> | ||
* @copyright 2011 Till Klampaeckel | ||
* @license http://www1.unl.edu/wdn/wiki/Software_License BSD License | ||
* @link http://pear2.php.net/ | ||
*/ | ||
class Database | ||
{ | ||
/** | ||
* Create the database. | ||
* | ||
* @return void | ||
* @throws RuntimeException When it didn't work. | ||
* | ||
* @uses Config::getDbSettings() | ||
* @uses Record::getDb() | ||
*/ | ||
public static function create() | ||
{ | ||
$settings = Config::getDbSettings(); | ||
$db = Record::getDb(false); | ||
|
||
$dbName = $db->real_escape_string($settings['dbname']); | ||
|
||
$sql = "CREATE DATABASE IF NOT EXISTS $dbName"; | ||
if ($db->query($sql) === true) { | ||
return; | ||
} | ||
throw new RuntimeException($db->error, $db->errno); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<?php | ||
foreach ($context as $package) { | ||
echo '"'.$package->name.'":'.json_encode($package->toArray()).','.PHP_EOL; | ||
} | ||
if (is_array($context) && !empty($context)) { | ||
foreach ($context as $package) { | ||
echo '"'.$package->name.'":'.json_encode($package->toArray()).','.PHP_EOL; | ||
} | ||
} |