Exemplo n.º 1
0
#!/usr/bin/php
<?php 
use fajr\FajrConfig;
// register our autoloader
require_once __DIR__ . '/../src/libfajr/libfajr.php';
Loader::register();
Loader::searchForClasses(__DIR__ . '/../src', true);
if (!FajrConfig::isConfigured()) {
    echo 'Chyba: Fajr nie je nakonfigurovany' . "\n";
    return;
}
if (!FajrConfig::get('Template.Cache')) {
    echo 'Info: Template cache je vypnuta, nema zmysel ju mazat' . "\n";
    return;
}
$path = FajrConfig::getDirectory('Template.Cache.Path');
echo 'Info: Template cache je ' . $path . "\n";
foreach (new DirectoryIterator($path) as $fileInfo) {
    if (!$fileInfo->isDot() && $fileInfo->isFile()) {
        unlink($fileInfo->getPathname());
    }
}
Exemplo n.º 2
0
<?php

require_once 'PHPUnit/Framework.php';
require_once 'libfajr/libfajr.php';
Loader::register();
Loader::searchForClasses(".", true);
Exemplo n.º 3
0
use fajr\libfajr\connection;
use fajr\libfajr\login\CosignLogin;
use fajr\libfajr\login\AIS2CookieLogin;
use fajr\libfajr\window\VSES017_administracia_studia as VSES017;
// *
if (!defined('_FAJR')) {
    die('<html><head>' . '<title>Varovanie</title>' . '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . '</head><body>' . '<h1>Varovanie</h1>' . '<p>Máte zle nastavený server, tento súbor by nemal byť ' . 'priamo prístupný. Prosím nastavte server tak, aby sa dalo ' . 'dostať len k podadresáru <code>web</code> a použite ' . '<code>index.php</code> v ňom</p>' . '</body></html>');
}
error_reporting(E_ALL | E_STRICT);
date_default_timezone_set('Europe/Bratislava');
mb_internal_encoding("UTF-8");
// Pretoze v session ukladam objekty libfajru, treba nacitat definicie
// tried skor, ako sa nacitava session
require_once 'libfajr/libfajr.php';
Loader::register();
Loader::searchForClasses(dirname(__FILE__), true);
require_once 'libfajr/Assert.php';
if (!FajrConfig::isConfigured()) {
    DisplayManager::addContent('notConfigured', true);
    echo DisplayManager::display();
    session_write_close();
    die;
}
class Fajr
{
    private function startSession()
    {
        $sessionLifeTime = 36000;
        session_cache_expire($sessionLifeTime / 60);
        session_set_cookie_params($sessionLifeTime, '/', '.' . $_SERVER['HTTP_HOST']);
        // cache expire, u servera
Exemplo n.º 4
0
<?php

require_once 'PHPUnit/Framework.php';
require_once 'libfajr/libfajr.php';
Loader::register();
Loader::searchForClasses(__DIR__, true);
ini_set('error_reporting', E_ALL | E_STRICT);