Example #1
0
<?php

/**
 * MSergeev
 * @package core
 * @author Mikhail Sergeev
 * @copyright 2016 Mikhail Sergeev
 */
use MSergeev\Core\Lib;
__include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/data_base.php");
$DB = new Lib\DataBase();
$GLOBALS['DB'] = $DB;
__include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/options.php");
Lib\Options::init();
__include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/loader.php");
Lib\Loader::init();
__include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/users.php");
$USER = new Lib\Users();
$GLOBALS['USER'] = $USER;
//***** Exception ********
Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "exception/", array("system_exception.php", "argument_exception.php", "db_exception.php", "sql_exception.php", "io_exception.php"));
//***** Lib *********
Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "lib/", array(), array("data_base.php", "options.php", "config.php", "loader.php", "users.php"));
Lib\Loc::setModuleMessages();
//***** Entity ********
Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "entity/", array("field.php", "scalar_field.php", "date_field.php"));
//***** Tables ********
Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "tables/");
Example #2
0
<?php

__include_once(\MSergeev\Core\Lib\Loader::getTemplate("calendar") . "footer.php");
Example #3
0
<?php

__include_once(\MSergeev\Core\Lib\Loader::getTemplate("apihelp") . "footer.php");
Example #4
0
<?php

$usePackage = "finances";
/*
if ($curDir == $usePackage) $curDir = "main";
?><script type="text/javascript">
	$(document).on("ready",function(){
		$(".top_menu_link").each(function(){
			$(this).removeClass("selected");
		});
		$("#<?=$curDir?>").addClass("selected");
	});
</script><?*/
__include_once(\MSergeev\Core\Lib\Loader::getTemplate($usePackage) . "footer.php");
Example #5
0
<?php

include_once $_SERVER["DOCUMENT_ROOT"] . "/msergeev_config.php";
MSergeev\Core\Lib\Loader::IncludePackage("events");
__include_once(MSergeev\Core\Lib\Loader::getTemplate("events") . "header.php");
MSergeev\Core\Lib\Buffer::addCSS(MSergeev\Core\Lib\Loader::getTemplate("events") . "css/style.css");
MSergeev\Core\Lib\Buffer::addJS(MSergeev\Core\Lib\Config::getConfig("CORE_ROOT") . "js/jquery-1.11.3.min.js");
MSergeev\Core\Lib\Buffer::addJS(MSergeev\Core\Lib\Loader::getTemplate("events") . "js/script.js");
Example #6
0
<?php

/**
 * MSergeev
 * @package core
 * @author Mikhail Sergeev
 * @copyright 2016 Mikhail Sergeev
 */
//echo __FILE__."<br>";
include_once \MSergeev\Core\Lib\Config::getConfig('CORE_ROOT') . 'tools.php';
__include_once(\MSergeev\Core\Lib\Config::getConfig('CORE_ROOT') . 'core.php');
//Вместо автоматической подгрузки всех пакетов, пакеты подгружаются классом Loader там, где необходимо
//__include_once(\MSergeev\Core\Lib\Config::getConfig('PACKAGES_ROOT').'packages.php');
Example #7
0
 public static function includeFiles($dir, $firstLoad = array(), $noLoad = array())
 {
     //$dir = Config::getConfig('CORE_ROOT')."lib/";
     if (empty($noLoad)) {
         $noLoad = array(".", "..");
     } else {
         if (!in_array(".", $noLoad)) {
             $noLoad[] = ".";
         }
         if (!in_array("..", $noLoad)) {
             $noLoad[] = "..";
         }
         if (!in_array(".readme", $noLoad)) {
             $noLoad[] = ".readme";
         }
     }
     if (!empty($firstLoad)) {
         foreach ($firstLoad as $files) {
             __include_once($dir . $files);
             $noLoad[] = $files;
         }
     }
     if (is_dir($dir)) {
         if ($dh = opendir($dir)) {
             while (($file = readdir($dh)) !== false) {
                 if (!in_array($file, $noLoad)) {
                     __include_once($dir . $file);
                 }
             }
             closedir($dh);
         }
     }
 }