Пример #1
0
 /**
  * Tests
  */
 public function testConfigShouldBeInTestEnvironment()
 {
     NeechyConfig::init();
     $this->assertEquals('test', NeechyConfig::environment());
     $this->assertNotNull(NeechyConfig::get('test-loaded'));
     $this->assertNull(NeechyConfig::get('app-loaded'));
 }
Пример #2
0
 private function validate_environment()
 {
     if (NeechyConfig::environment() == 'app') {
         return true;
     } elseif (NeechyConfig::environment() == 'test') {
         $this->setup_dev_environment();
         return true;
     } else {
         $format = 'Config file missing. Please see %s for install help.';
         $link = '<a href="https://github.com/klenwell/neechy">Neechy README file</a>';
         throw new NeechyConfigError(sprintf($format, $link));
     }
 }
Пример #3
0
 protected function assert_app_config_not_present()
 {
     if (NeechyConfig::environment() == 'app') {
         throw new NeechyInstallError('App config file is already installed.');
     }
 }
Пример #4
0
<?php

$t = $this;
# templater object
$auth = new AppAuthService();
?>
    <?php 
if (NeechyConfig::stage() == 'dev') {
    ?>
      <div class="dev-footer">
        <h4>App Engine Dev Server</h4>
        <p>Using <?php 
    echo NeechyConfig::environment();
    ?>
 config settings.</p>
        <?php 
    if ($auth->user) {
        ?>
        <p>Logged in as <?php 
        echo $auth->user_is_admin() ? 'admin' : 'user';
        ?>
.</p>
        <?php 
    } else {
        ?>
        <p>Not logged in.</p>
        <?php 
    }
    ?>
      </div>
    <?php