public function actionIndex()
 {
     $files = [];
     $dir = \Gbox::$components->debug->getPath();
     if ($handle = opendir($dir)) {
         while (false !== ($entry = readdir($handle))) {
             if ($entry != '.' && $entry != '..' && strpos($entry, 'debug') === 0) {
                 $data = Json::decode(file_get_contents(\Gbox::$components->debug->getFile($entry)));
                 if ($data[0]['session'] == session_id()) {
                     // $files[] = $entry;
                     $files[filemtime($dir . $entry)] = $entry;
                 }
             }
         }
         closedir($handle);
         krsort($files);
     }
     Session::set('files-debug', $files);
     if (!($current = \Gbox::getRequest()->get('id'))) {
         reset($files);
         $current = current($files);
         Session::set('files-debug-current', $current);
     }
     Session::set('files-debug-current', $current);
     return $this->render('index', ['files' => $files]);
 }
Example #2
0
 public function __construct($config = [])
 {
     static::$config = $config;
     static::setAlias('web', $config['web']);
     static::setAlias('path', $config['path']);
     static::setAlias('gbox', static::getAlias('path') . '/gbox');
     static::setAlias('controllers', static::getAlias('gbox') . '/controllers');
     static::setAlias('components', static::getAlias('gbox') . '/components');
     static::setAlias('plugins', static::getAlias('gbox') . '/plugins');
     static::setAlias('modules', static::getAlias('gbox') . '/modules');
     static::setAlias('models', static::getAlias('gbox') . '/models');
     static::setAlias('views', static::getAlias('gbox') . '/views');
     static::setAlias('tmp', static::getAlias('gbox') . '/tmp');
     static::setAlias('layouts', static::getAlias('views') . '/layouts');
     static::setAlias('uploads-path', static::getAlias('path') . '/uploads');
     static::setAlias('uploads', static::getAlias('web') . '/uploads');
     static::setAlias('images', static::getAlias('web') . '/assets' . '/images');
     static::setAlias('fonts', static::getAlias('web') . '/assets' . '/fonts');
     static::setAlias('css', static::getAlias('web') . '/assets' . '/css');
     static::setAlias('js', static::getAlias('web') . '/assets' . '/js');
     session_save_path(realpath(Url::to('@tmp')));
     Session::init();
     if (property_exists(static::getConfig(), 'timezone')) {
         date_default_timezone_set(static::getConfig()->timezone);
     } else {
         date_default_timezone_set('America/Montevideo');
     }
 }
 public function actionSignOut()
 {
     if (Gbox::$components->user->isGuest) {
         return $this->redirect('@web');
     }
     $model = new FormAccountSignIn();
     $model->logout();
     Session::destroy('_business_id');
     return $this->redirect('@web', ['action' => 'signout']);
 }
Example #4
0
    $this->title = 'Gbox Framework';
}
if (!$this->description) {
    $this->description = 'DescripciĆ³n de Gbox Framework';
}
SiteAssets::register($this);
?>
<!DOCTYPE html>
<html>
<head>
	<?php 
echo $this->renderHead();
?>
</head>
<body>
	<?php 
echo AppMenu::Show();
?>
	<div class="container">
		<?php 
if ($response = Session::get('response')) {
    echo Bootstrap::Alert($response['msg'], array_key_exists('type', $response) ? $response['type'] : 'danger', true);
    Session::destroy('response');
}
?>
		<?php 
echo $content;
?>
	</div>
</body>
</html>
Example #5
0
	          <ul class="dropdown-menu">
	          	<?php 
$i = 0;
?>
	            <?php 
foreach (\Gbox\base\Session::get('files-debug', []) as $file) {
    ?>
	            	<?php 
    if ($i < 10) {
        $i++;
    } else {
        break;
    }
    ?>
		            <li class="<?php 
    echo $file == \Gbox\base\Session::get('files-debug-current') ? 'active' : '';
    ?>
"><a href="<?php 
    echo Url::to('@web-module', ['id' => $file]);
    ?>
"><?php 
    echo $file;
    ?>
</a></li>
		        <?php 
}
?>
	          </ul>
	        </li>
	      </ul>
	    </div><!-- /.navbar-collapse -->
Example #6
0
">
					<h4 class="panel-title">
						<a role="button" data-toggle="collapse" data-parent="#accordion-debug-summary-parse" href="#collapse-summary-parse-<?php 
echo $i;
?>
" aria-expanded="true" aria-controls="collapse-summary-parse-<?php 
echo $i;
?>
">
							Parse summary
						</a>
					</h4>
				</div>
				<div id="collapse-summary-parse-<?php 
echo $i;
?>
" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-summary-parse-<?php 
echo $i;
?>
">
					<div class="panel-body">
						<pre><?php 
print_r(\Gbox::$components->debug->getData(Session::get('files-debug-current')));
?>
</pre>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
Example #7
0
 public function logout()
 {
     $this->_identity = null;
     $this->isGuest = false;
     $this->id = null;
     Session::destroy('__' . $this->alias());
     Session::destroy('__' . $this->alias() . '_auth_key');
     Gbox::getResponse()->getCookies()->remove('__' . $this->alias());
     Gbox::getResponse()->getCookies()->remove('__' . $this->alias() . '_auth_key');
     return true;
 }