Esempio n. 1
0
 /**
  * Removing a config variable.
  *
  * @access public
  */
 public function testConfigRemovingVariable()
 {
     // Removing a config variable that does not exist...
     $this->assertFalse(Core\Config::remove('foo', 'doesNotExist'));
     // .. and one that does exist
     $this->assertTrue(Core\Config::remove('foo', 'bar'));
 }
Esempio n. 2
0
 public function getDb()
 {
     $config = Core\Config::getInstance('../config/config.php');
     if (is_null($this->db_instance)) {
         $this->db_instance = new Core\Database\Database($config->get('db_name'), $config->get('db_user'), $config->get('db_pass'), $config->get('db_host'));
     }
     return $this->db_instance;
 }
Esempio n. 3
0
 /**
  * Can we add stacks to the profiler, and they arrange themselves correctly?
  *
  * @access public
  */
 public function testAddingStackToProfile()
 {
     // Enable the profiler
     Core\Config::set('profiler', 'enable', true, true);
     // Add a stack
     Core\Profiler::register('Foo', 'bar');
     $stack = Core\Profiler::getProfilerData();
     $this->assertTrue(is_array($stack['stack']));
     $this->assertEquals(1, count($stack['stack']));
 }
Esempio n. 4
0
 /**
  * Can we call a View Helper and get the expected result?
  *
  * @access public
  */
 public function testViewHelper()
 {
     // Load the config file
     Core\Config::load('MyProject');
     // Get a new View
     $view = new Core\View();
     // Load a View Helper
     $viewHelperContent = $view->test(array('testVar' => 'foo'));
     // And test
     $this->assertEquals($viewHelperContent, 'Test var: foo');
 }
Esempio n. 5
0
 /**
  * Can we create a cached object?
  *
  * @access public
  */
 public function testCreateCachedObject()
 {
     // Load the config file
     Core\Config::load('MyProject');
     Core\Config::set('cache', 'enable', true, true);
     // Put the cache
     Core\Cache::put('foo', 'bar');
     // The file exists?
     $this->assertTrue(Core\Cache::has('foo'));
     // And the file has the correct contents?
     $this->assertEquals(Core\Cache::get('foo'), 'bar');
 }
Esempio n. 6
0
 public static function run($func = NULL)
 {
     if (!defined('APP_RUN')) {
         Core\Config::load(CONF_PATH . DS . 'bootstrap.php');
         if (is_callable($func)) {
             call_user_func($func);
         }
         self::exceptionHandler();
         self::errorHandler();
         self::registerShutdown();
         Core\App::instance()->run();
         define('APP_RUN', TRUE);
     }
 }
Esempio n. 7
0
?>
    <div class="wWrapper">
        <?php 
echo Core\Widgets::get('header');
?>
        <div class="wConteiner">
            <div class="wSize">
                <?php 
echo $_breadcrumbs;
?>
                <?php 
echo Core\Widgets::get('userMenu');
?>
                <div class="lk_content">
                    <div class="title"><?php 
echo Core\Config::get('h1');
?>
</div>
                    <div class="lkMainContent">
                        <?php 
echo $_content;
?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php 
echo Core\Widgets::get('hiddenData');
?>
    <?php 
Esempio n. 8
0
                    <p><?php 
    echo Core\Config::get('subscribe_text');
    ?>
</p>
                <?php 
}
?>
                <div class="foot_podp">
                    <div form="true" class="wForm regBlock" data-ajax="subscribe">
                        <div class="tar">
                            <button class="wSubmit enterReg_btn">подписаться</button>
                        </div>
                        <div class="wFormRow">
                            <input type="email" name="email" placeholder="E-mail" required="">
                            <label>E-mail</label>
                        </div>
                    </div>
                </div>
            </div>
		</div>
		<?php 
foreach (Core\Config::get('counters') as $counter) {
    ?>
            <?php 
    echo $counter;
    ?>
        <?php 
}
?>
	</div>
</footer>
Esempio n. 9
0
<div class="small_filt" id="catalogSort" data-uri="<?php 
echo str_replace('/page/' . Core\Route::param('page'), '', Core\Arr::get($_SERVER, 'REQUEST_URI'));
?>
" data-get="<?php 
echo Core\Route::controller() == 'search' ? 'query=' . Core\Arr::get($_GET, 'query') : '';
?>
">
    <div class="small_filt1">
        <p>выводить ПО:</p>
        <select name="per_page" id="select1">
            <?php 
$limit = Core\Config::get('limit');
?>
            <?php 
for ($i = Core\Config::get('limit'); $i < Core\Config::get('limit') * 5; $i += Core\Config::get('limit')) {
    ?>
                <option value="<?php 
    echo $i;
    ?>
" <?php 
    echo Core\Arr::get($_GET, 'per_page') == $i ? 'selected' : '';
    ?>
><?php 
    echo $i;
    ?>
</option>
            <?php 
}
?>
        </select>
        <p>на странице</p>
Esempio n. 10
0
        <?php 
    $countPlaces += $places;
    ?>
        <?php 
    $totalCost += $cost;
    ?>

        <?php 
    $status = null;
    if ($obj->status == 'success') {
        $status = 'success';
    } else {
        if ($obj->created_at > time() - Core\Config::get('reserved_days') * 24 * 60 * 60 and $obj->status != 'success') {
            $status = 'brone';
        } else {
            if ($obj->created_at < time() - Core\Config::get('reserved_days') * 24 * 60 * 60 and $obj->status != 'success') {
                $status = 'expired';
            }
        }
    }
    ?>
        <?php 
    if ($status == 'brone') {
        ?>
            <?php 
        $class = 'info';
        $countBrone++;
        ?>
        <?php 
    } elseif ($status == 'expired') {
        ?>
Esempio n. 11
0
    </div>
    <div class="col-md-12">
        <div class="widget box">
            <div class="widgetHeader">
                <div class="widgetTitle">
                    <i class="fa-reorder"></i>
                    Доступ к разделам
                </div>
            </div>
            <div class="widgetContent">
                <div class="form-vertical row-border">
                    <div class="form-actions" style="display: none;">
                        <input class="submit btn btn-primary pull-right" type="submit" value="Отправить">
                    </div>
                    <?php 
foreach (Core\Config::get('access') as $el) {
    ?>
                        <?php 
    $ac = \Core\Arr::get($access, $el['controller'], 'no');
    ?>
<!--                        Custom view -->
                        <?php 
    if (array_key_exists('customView', $el)) {
        ?>
                            <?php 
        if ($el['customView'] == 'boolean') {
            ?>
                                <div class="form-group">
                                    <label class="control-label"><?php 
            echo Core\Arr::get($el, 'name');
            ?>
Esempio n. 12
0
    .panel-heading { font-size: 18px; }


  </style>
</head>
<body>
<br>
<div class="container">
  <div class="panel panel-default">
    <div class="panel-body">
      <h2>Oups, une erreur est survenue sur votre site</h2>
    </div>
  </div>
</div>
<?php 
if (Core\Config::get('dev')) {
    ?>
  <div class="container">
    <div class="panel panel-primary">
    <div class="panel-heading">
      <h4><?php 
    echo $this->error;
    ?>
&nbsp;<strong><?php 
    echo $this->message;
    ?>
</strong></h4>
      dans le fichier <abbr title="attribute"><i><?php 
    echo $this->file;
    ?>
</i></abbr> à la ligne <strong><?php 
        <?php 
echo Core\Widgets::get('header');
?>
        <div class="wConteiner">
            <div class="wSize">
                <?php 
echo $_breadcrumbs;
?>
                <div class="folt_cat_block no_filt clearFix">
                    <div class="flr">
                        <div class="title"><?php 
echo Core\Config::get('h1');
?>
</div>
                        <?php 
echo Core\Config::get('brand_description');
?>
                        <?php 
echo Core\Widgets::get('catalogSort');
?>
                        <?php 
echo $_content;
?>
                    </div>
                </div>
                <div class="novelty clearFix">
                    <?php 
echo Core\Widgets::get('catalogViewed');
?>
                </div>
                <div id="clonSeo"></div>
Esempio n. 14
0
                <p><?php 
    echo Core\Config::get('dostavka_est');
    ?>
</p>
            </div>
        <?php 
}
?>
        <?php 
if ($obj->available == 2) {
    ?>
            <div class="tovar_vNall noNall">
                <div class="vNall_img"></div>
                <p>товар под заказ</p>
                <?php 
    echo Core\Config::get('dostavka_bron');
    ?>
            </div>
        <?php 
}
?>
        <div class="sel_but clearFix">
            <div class="fll">
                <?php 
if (count($sizes)) {
    ?>
                    <select id="select5">
                        <?php 
    foreach ($sizes as $size) {
        ?>
                            <option value="<?php 
Esempio n. 15
0
         header('Content-Type: application/json');
         // Printing the logout page
         require 'app/logout.php';
     } elseif ($request['args'][0] == "validate" && empty($request['args'][1])) {
         // Setting the content-type to JSON
         header('Content-Type: application/json');
         // Printing the logout page
         require 'app/validate.php';
     } elseif ($request['args'][0] == "invalidate" && empty($request['args'][1])) {
         // Setting the content-type to JSON
         header('Content-Type: application/json');
         // Printing the logout page
         require 'app/invalidate.php';
     } elseif ($request['args'][0] == "register" && empty($request['args'][1])) {
         // If the register page is activated in the config
         if (Core\Config::get('activeRegisterPage')) {
             // Printing the register page
             require 'app/register.php';
         } else {
             // Setting the header to 404 error
             header("HTTP/1.0 404 Not Found");
             // Printing the first error
             echo error(1);
         }
     } else {
         // Setting the header to 404 error
         header("HTTP/1.0 404 Not Found");
         // Printing the first error
         echo error(1);
     }
 } else {
Esempio n. 16
0
                        </div>
                    </div> -->
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-5">
        <div class="widget">
            <div class="widgetHeader myWidgetHeader">
                <div class="widgetTitle">
                    <i class="fa-reorder"></i>
                    Изображение
                </div>
            </div>
            <p>Размеры: <?php 
echo Core\Config::get('images.slider.1.width') . ' x ' . Core\Config::get('images.slider.1.height');
?>
</p>
            <div class="widgetContent">
                <div class="form-vertical row-border">
                    <div class="form-group">
                        <label class="control-label"></label>
                        <div class="">
                            <?php 
if (is_file(HOST . Core\HTML::media('images/slider/big/' . $obj->image))) {
    ?>
                                <a href="<?php 
    echo Core\HTML::media('images/slider/big/' . $obj->image);
    ?>
" rel="lightbox">
                                    <img src="<?php 
Esempio n. 17
0
echo Core\Arr::get($_seo, 'h1');
?>
                        </h3>
                        <span>
                            Здравствуйте, <?php 
echo Core\User::info()->name;
?>
!
                        </span>
                    </div>
                    <?php 
echo $_toolbar;
?>
                </div>
                <div class="rowSection <?php 
echo Core\Config::get('collsClass');
?>
">
                    <div class="col-md-12">
                        <div class="widget checkbox-wrap">
                            <?php 
echo $_filter;
?>
                            <div class="widgetContent">
                                <?php 
echo $_content;
?>
                            </div>
                        </div>
                    </div>
                </div>
Esempio n. 18
0
/*
|--------------------------------------------------------------------------
| Register the Autoloader
|--------------------------------------------------------------------------
|
| Composer is our best friend. He maintains our dependencies and manage
| the autoloader very well. Good guy Composer.
|
*/
require __DIR__ . '/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Register the Environment Variables
|--------------------------------------------------------------------------
|
| Reads the config file (config/env.php) and register it in using the
| putenv() function. Configurations are retreivable using the getenv() 
| function everywhere in the project.
|
*/
Core\Config::setEnv();
/*
|--------------------------------------------------------------------------
| Register the Error Handler
|--------------------------------------------------------------------------
|
| The debugging tool will register the error handler based on your
| configuration (located at config/env.php). 
|
*/
Core\Debugger::start();
Esempio n. 19
0
?>
</head>
<body>
    <?php 
foreach ($_seo['metrika']['body'] as $metrika) {
    ?>
        <?php 
    echo $metrika;
    ?>
    <?php 
}
?>
    <div class="seoTxt" id="seoTxt">
        <div class="wSize wTxt">
            <?php 
echo trim(strip_tags(Core\Config::get('seo_text'))) ? Core\Config::get('seo_text') : '';
?>
        </div>
    </div>
    <div class="wWrapper">
        <?php 
echo Core\Widgets::get('header');
?>
        <div class="wConteiner">
            <div class="wSize">
                <?php 
echo $_breadcrumbs;
?>
                <div class="folt_cat_block clearFix cat_ul_block">
                    <div class="fll">
                        <?php 
Esempio n. 20
0
<div class="textPage wTxt">
	<h1><?php 
echo $item->name;
?>
</h1>
	<?php 
echo Core\Config::get('map_text');
?>
</div>
<div class="backButton tal"><a href="/afisha/<?php 
echo $item->alias;
?>
">◄Назад к афише</a></div>
<!-- .textPage -->
<div class="map_price"></div>
<div class="slider_wrap">
	<div class="reset_zoom">1:1</div>   
    <div id="slider_zoom">
        <div class="ui-slider-handle"><span>100%</span></div>
    </div>
    <div class="clear"></div>
</div>
<div class="map_svg_wrap <?php 
#echo strtolower($item->filename)
?>
">
	<div class="map_svg">
		
		
		<?php 
echo $map;
Esempio n. 21
0
 * @link      	http://www.alain-dessi.com
 */
// vérification du type de mode dans config
$session_mode = Core\Config::get('session_mode');
if (is_null($session_mode)) {
    $session_mode = 1;
}
// session mode Base de données
if ($session_mode === 2) {
    // récupération temps d'expiration
    $session_expire = Core\Config::get('session_time');
    if (is_null($session_expire)) {
        $session_expire = 7200;
    }
    // récuperation du nom de la table
    $session_table = Core\Config::get('session_tablename');
    if (is_null($session_table)) {
        $session_table = 'sessions';
    }
    // initialisation du handler
    $session = new Core\Http\SessionHandlerDataBase($session_table);
    $session->setSessionTime($session_expire);
    // Mise en place du handler
    ini_set('session.save_handler', 'user');
    session_set_save_handler($session);
    // démarage de session
    session_start();
} else {
    // démarage de session mode Normal
    session_start();
}
Esempio n. 22
0
<?php

namespace Vela;

$autoloader = __DIR__ . '/../vendor/autoload.php';
if (!file_exists($autoloader)) {
    throw new \Exception('Please install this app via composer.json. http://www.getcomposer.org');
}
require_once $autoloader;
// Load configuration file
$configuration = (require_once __DIR__ . '/Config/' . ENVIRONMENT . '/Config.php');
/**
 * Initialize Configuration container
 */
$config = new Core\Config($configuration);
/**
 * Start mailer
 */
$mail = function () use($config) {
    return new Core\Mail($config);
};
/**
 * Register the error handler
 */
$whoops = new \Whoops\Run();
if (ENVIRONMENT !== 'Production') {
    $logLevel = \Psr\Log\LogLevel::DEBUG;
    $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
} else {
    $logLevel = \Psr\Log\LogLevel::WARNING;
    $whoops->pushHandler(function () use($mail) {
Esempio n. 23
0
                    <span class="socialText">Мы в социальных сетях:</span>
                    <ul class="listSocial">
                        <li><a href="<?php 
echo Core\Config::get('vk');
?>
" rel="nofolow" class="vk"></a></li>
                        <li><a href="<?php 
echo Core\Config::get('ok');
?>
" rel="nofolow" class="ok"></a></li>
                        <li><a href="<?php 
echo Core\Config::get('fb');
?>
" rel="nofolow" class="facebook"></a></li>
                        <li><a href="<?php 
echo Core\Config::get('in');
?>
" rel="nofolow" class="instagramm"></a></li>
                    </ul>
                </div>
                <!-- .social -->
            </div>
            <!-- .wrapHeader -->
            
            <div class="clear"></div>
            <?php 
if (count($slider)) {
    ?>
                <div class="carousel">
                    <ul id="carousel">
                        <?php 
Esempio n. 24
0
if ($obj->status != 'success' and $obj->created_at < time() - Core\Config::get('reserved_days') * 24 * 60 * 60) {
    ?>
							<p class="info-block">Бронь просрочена</p>
						<?php 
}
?>
						<?php 
if ($obj->status != 'success' and $obj->created_at > time() - Core\Config::get('reserved_days') * 24 * 60 * 60) {
    ?>
							<p class="info-block">Заказ не оплачен</p>
						<?php 
}
?>
						<input class="btn btn-primary print_order_tickets" type="submit" value="Печать"
							<?php 
echo (Core\User::info()->role_id == 2 or $obj->created_at > time() - Core\Config::get('reserved_days') * 24 * 60 * 60 and $obj->status == 'success') ? null : 'disabled';
?>
						/>
					</div>
				</form>
			</div>
		</div>

		<?php 
if (Core\User::info()->role_id == 2) {
    ?>
			<div class="widget box">
				<div class="widgetHeader">
					<div class="widgetTitle"><i class="fa-eraser"></i>Сбросить историю печати</div>
				</div>
				<div class="widgetContent">
Esempio n. 25
0
"><?php 
    echo $obj->name;
    ?>
</a></li>
                    <?php 
}
?>
				</ul>
			</div>
			<div class="flr">
				<div class="block_p">
					<a href="tel:<?php 
echo Core\Config::get('phone');
?>
?call" class="head_phone"><?php 
echo Core\Config::get('phone');
?>
</a>
					<a href="#enterReg2" class="call_back enterReg2"><span>ОБРАТНЫЙ ЗВОНОК</span></a>
				</div>
			</div>
			<div class="flc">
				<a href="<?php 
echo Core\HTML::link();
?>
"><img src="<?php 
echo Core\HTML::media('pic/logo.png');
?>
" alt=""></a>
			</div>
		</div>