public static function start_session()
 {
     $session_name = md5(sprintf('%s.neechy', NeechyConfig::get('title', 'neechy')));
     session_name($session_name);
     session_start();
     return null;
 }
 public function testShouldLoadTestConfigFile()
 {
     NeechyConfig::init();
     $this->assertNull(NeechyConfig::get('unset-value'));
     $this->assertTrue(NeechyConfig::get('is-testing'));
     $this->assertEquals('NeechyTest', NeechyConfig::get('title'));
 }
 private function query($sql, $params = array())
 {
     $dsn = sprintf('mysql:host=%s;dbname=%s', NeechyConfig::get('mysql_host'), $this->test_db_name);
     $pdo = new PDO($dsn, NeechyConfig::get('mysql_user'), NeechyConfig::get('mysql_password'));
     $query = $pdo->prepare($sql);
     $query->execute($params);
     return $query;
 }
Exemple #4
0
 private function setup_dev_environment()
 {
     $handler_path = NeechyPath::join(NEECHY_HANDLER_CORE_PATH, 'install', 'handler.php');
     require_once $handler_path;
     if (NeechyDatabase::database_exists(NeechyConfig::get('mysql_database'))) {
         error_log('Test database found.');
     } else {
         error_log('Setting up dev environment using test configuration file.');
         # Buffer console output.
         ob_start();
         $handler = new InstallHandler($this->request);
         $handler->setup_dev();
         ob_end_clean();
     }
 }
<?php

#
# Default New User Page
# This gets saved as user's page upon successfuly registration
#
$t = $this;
# templater object
?>
## Welcome to the <?php 
echo NeechyConfig::get('title');
?>
 Wiki

### This is your wiki page!

To deter spammers, this page will **not** be visible to search engines. When you registered, an email was sent to you. As soon as you click the link in that email, you will be able to edit this page.

It will be the only page you can edit until an administrator upgrades you. In the meantime, feel free look around, learn more about [markdown](/?page=NeechyFormatting) (the formatting syntax this wiki uses), and rewrite this page to your heart's content.

Welcome aboard!
 private function validate_config_settings()
 {
     $db_name = NeechyConfig::get('mysql_database');
     if (!$db_name || $db_name == 'NULL') {
         throw new NeechyError(sprintf('please update database settings in your config file: %s', NeechyConfig::path()));
     } else {
         return true;
     }
 }
 protected static function verify_host_is_configured()
 {
     $host = NeechyConfig::get('mysql_host');
     if (is_null($host) || $host == 'NULL') {
         throw new NeechyDatabaseError('mysql_host set to null');
     } else {
         return true;
     }
 }
          <th>Database</th>
          <th>Host</th>
          <th>User</th>
          <th>Connection Status</th>
        </tr>
        <tr>
          <td><?php 
echo NeechyConfig::get('mysql_database');
?>
</td>
          <td><?php 
echo NeechyConfig::get('mysql_host');
?>
</td>
          <td><?php 
echo NeechyConfig::get('mysql_user');
?>
</td>
          <td><?php 
echo NeechyDatabase::connection_status();
?>
</td>
        </tr>
      </table>

      <div class="form-group database-actions">
        <?php 
echo $t->open_form('', 'post', array('class' => 'form-inline'));
?>
          <?php 
if ($t->data('database_installed')) {
 public static function init_database()
 {
     NeechyDatabase::destroy_database();
     $pdo = NeechyDatabase::create_database();
     $pdo->query(sprintf('USE %s', NeechyConfig::get('mysql_database')));
 }
$t = $this;
?>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title><?php 
echo NeechyConfig::get('title');
?>
</title>
    <meta name="keywords" content="<?php 
echo NeechyConfig::get('keywords');
?>
" />
    <meta name="description" content="<?php 
echo NeechyConfig::get('description');
?>
" />
    <link rel="icon" type="image/x-icon"
		  href="themes/bootstrap/images/favicon.ico"  />
    <link rel="shortcut icon" type="image/x-icon"
		  href="themes/bootstrap/images/favicon.ico"  />

    <!-- Stylesheets -->
    <link rel="stylesheet"
      href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
    <link rel="stylesheet" href="themes/bootstrap/css/bootstrap-override.css" />

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>