示例#1
0
function setup_five()
{
    $kms_file = arr::get(kohana::modules(), 'kms') . 'config/.kms';
    file_put_contents($kms_file, 'KMS successfully installed on ' . date('Y-m-d H:i:s'));
    chmod($kms_file, 0777);
    ?>
<h2>Setup Complete!</h2>
<p>
	KMS has been successfully setup. You can now login to the administration section of your site using the link below
</p>
<p>
	<?php 
    echo html::anchor(Route::url('kms-admin', array('action' => 'login')), 'Login', array('class' => 'button'));
    ?>
</p>
<?php 
}
示例#2
0
文件: kms.php 项目: ngonchan/Kooshy
 /**
  * Gets a singleton KMS object instance
  * @param   type   KMS class to get
  * @param   mixed  optional parameters
  * @return  mixed
  */
 public static function instance($class, $params = NULL)
 {
     $install_file = arr::get(kohana::modules(), 'kms') . 'config/.kms';
     if (!file_exists($install_file) && !empty($_SERVER['REQUEST_URI']) && !preg_match('/kms-asset/', $_SERVER['REQUEST_URI'])) {
         require arr::get(kohana::modules(), 'kms') . 'install.php';
     }
     if (empty(self::$_instance)) {
         self::$_instance = new KMS();
         KMS::Session();
         // start session
     }
     $kmsclass = 'kms_' . strtolower($class);
     if (empty(self::$_instances[$kmsclass])) {
         self::$_instances[$kmsclass] = self::factory($class, $params);
     }
     return self::$_instances[$kmsclass];
 }