Exemplo n.º 1
0
 /**
  *  Ethna_Sessionクラスのコンストラクタ
  *
  *  @access public
  */
 public function __construct(ContainerInterface $container, string $sessionName)
 {
     $this->logger = $container->getLogger();
     $config = $container->getConfig()->get('session');
     if ($config) {
         $this->config = array_merge($this->config, $config);
     }
     $this->session_save_dir = $this->config['path'];
     if (($dir = $container->getDirectory($this->config['path'])) !== null) {
         $this->session_save_dir = $dir;
     }
     $this->session_name = $sessionName;
     // set session handler
     ini_set('session.save_handler', $this->config['handler']);
     session_save_path($this->session_save_dir);
     session_name($this->session_name);
     session_cache_limiter($this->config['cache_limiter']);
     session_cache_expire($this->config['cache_expire']);
     $this->session_start = false;
 }
Exemplo n.º 2
0
 /**
  *  プラグインのクラス名、ディレクトリ、ファイル名を決定
  *
  *  @access public
  *  @param  string  $type   プラグインの種類
  *  @param  string  $name   プラグインの名前 (nullのときは親クラス)
  *  @param  string  $appid  アプリケーションID (廃止予定)
  *  @return array   プラグインのクラス名、ディレクトリ、ファイル名の配列
  */
 public function getPluginNaming($type, $name, $appid = 'Ethna')
 {
     $ext = $this->container->getExt('php');
     $plugin_class_name = array($appid, 'Plugin', $type);
     if ($appid == 'Ethna') {
         $baseDir = ETHNA_BASE . "/src/Plugin";
     } else {
         $baseDir = $this->container->getDirectory('plugin');
     }
     if ($name !== null) {
         $plugin_class_name[] = $name;
         $dir = $baseDir . "/{$type}";
         $basename = "{$name}.{$ext}";
     } else {
         //親クラス
         $dir = $baseDir;
         $basename = "{$type}.{$ext}";
     }
     $class = implode('_', $plugin_class_name);
     return array($class, $dir, $basename);
 }