public static function init() { if (self::$loader == NULL) { self::$loader = new self(); } return self::$loader; }
header('Last-Modified: ' . $headers['If-Modified-Since'], true, 304); return; } else { header('Expired: ' . gmdate("D, d M Y H:i:s", time() + $offset) . ' GMT', true); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT', true, 200); } require_once "{$base_path}/includes/init.inc.php"; require_once "{$base_path}/includes/error_report.inc.php"; require_once "{$base_path}/includes/global_vars.inc.php"; // récupération paramètres MySQL et connection á la base if (file_exists($base_path . '/includes/opac_db_param.inc.php')) { require_once $base_path . '/includes/opac_db_param.inc.php'; } else { die("Fichier opac_db_param.inc.php absent / Missing file Fichier opac_db_param.inc.php"); } require_once $base_path . '/includes/opac_mysql_connect.inc.php'; $dbh = connection_mysql(); require_once $base_path . "/includes/session.inc.php"; session_write_close(); require_once $class_path . "/autoloader.class.php"; $autoloader = new autoloader(); $autoloader->add_register("cms_modules", true); //on ne charge que le minima, donc il faut aller chercher soit même le param qui nous interesse $query = "select valeur_param from parametres where type_param= 'cms' and sstype_param='active_image_cache'"; $result = pmb_mysql_query($query, $dbh); if (pmb_mysql_num_rows($result)) { global $cms_active_image_cache; $cms_active_image_cache = pmb_mysql_result($result, 0, 0); } $logo = new cms_logo($id, $type); $logo->show_picture($mode);
<?php //Include Config files. include 'app/config/routes.php'; include 'app/config/paths.php'; //Initialize Autoloader. include 'app/system/autoloader.php'; autoloader::register(); //Initialize the router with URL and route config file. $router = new Router($routes, $_GET['url']); switch ($_SERVER['REQUEST_METHOD']) { case 'GET': $router->get($_GET['url']); break; case 'POST': $router->post($_GET['url']); break; case 'PUT': //need to be done $router->put($_GET['url']); break; case 'DELETE': //need to be done $router->delete($_GET['url']); break; default: die('not a valid Request Method, request method =' . $_SERVER['REQUEST_METHOD']); }
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: reindex_concept.inc.php,v 1.2 2015-04-03 11:16:18 jpermanne Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } require_once $base_path . '/classes/autoloader.class.php'; $autoloader = new autoloader(); $autoloader->add_register("onto_class", true); // la taille d'un paquet de notices $lot = REINDEX_PAQUET_SIZE; // defini dans ./params.inc.php // taille de la jauge pour affichage $jauge_size = GAUGE_SIZE; $jauge_size .= "px"; // initialisation de la borne de départ if (!isset($start)) { $start = 0; //remise a zero de la table au début pmb_mysql_query("TRUNCATE skos_words_global_index", $dbh); pmb_mysql_query("ALTER TABLE skos_words_global_index DISABLE KEYS", $dbh); pmb_mysql_query("TRUNCATE skos_fields_global_index", $dbh); pmb_mysql_query("ALTER TABLE skos_fields_global_index DISABLE KEYS", $dbh); } $v_state = urldecode($v_state); $onto_store_config = array('db_name' => DATA_BASE, 'db_user' => USER_NAME, 'db_pwd' => USER_PASS, 'db_host' => SQL_SERVER, 'store_name' => 'ontology', 'max_errors' => 100, 'store_strip_mb_comp_str' => 0); $data_store_config = array('db_name' => DATA_BASE, 'db_user' => USER_NAME, 'db_pwd' => USER_PASS, 'db_host' => SQL_SERVER, 'store_name' => 'rdfstore', 'max_errors' => 100, 'store_strip_mb_comp_str' => 0); $tab_namespaces = array("skos" => "http://www.w3.org/2004/02/skos/core#", "dc" => "http://purl.org/dc/elements/1.1", "dct" => "http://purl.org/dc/terms/", "owl" => "http://www.w3.org/2002/07/owl#", "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs" => "http://www.w3.org/2000/01/rdf-schema#", "xsd" => "http://www.w3.org/2001/XMLSchema#", "pmb" => "http://www.pmbservices.fr/ontology#");
if (!is_string($ns_or_ns_class) || !($ns_or_ns_class = trim($ns_or_ns_class, '\\')) || !is_string($class_file)) { throw new \exception(sprintf(stub::__('Invalid arguments: `%1$s`'), print_r(func_get_args(), TRUE))); } if ($class_file) { // Interpret `$ns_or_ns_class` as a namespace only. $ns_class = $ns_or_ns_class . '\\' . stub::with_underscores(basename($class_file, '.php')); } else { $ns_class = $ns_or_ns_class; } // Presume full class path. if (!preg_match(stub::$regex_valid_plugin_ns_class, $ns_class)) { throw new \exception(sprintf(stub::__('Namespace\\class contains invalid chars: `%1$s`.'), $ns_class)); } if (strpos($ns_class, stub::$core_ns . '\\') !== 0) { throw new \exception(sprintf(stub::__('Namespace\\class is NOT from this core: `%1$s`.'), $ns_class)); } if (!class_exists('\\' . $ns_class, FALSE) && !interface_exists('\\' . $ns_class, FALSE) && (!function_exists('trait_exists') || !trait_exists('\\' . $ns_class, FALSE))) { throw new \exception(sprintf(stub::__('Namespace\\class does NOT exist yet: `%1$s`.'), $ns_class)); } $alias = str_replace(array(stub::$core_ns . '\\', '\\'), array(stub::$core_ns_stub . '\\', '__'), $ns_class); if (!class_exists('\\' . $alias, FALSE) && !interface_exists('\\' . $alias, FALSE) && (!function_exists('trait_exists') || !trait_exists('\\' . $alias, FALSE))) { class_alias('\\' . $ns_class, $alias); } } } # -------------------------------------------------------------------------------------------------------------------------------- # Initialize the XDaRk Core autoloader. # -------------------------------------------------------------------------------------------------------------------------------- autoloader::initialize(); // Also registers autoloader handler. }
if (pmb_mysql_num_rows($result)) { $row = pmb_mysql_fetch_object($result); $selector = new $row->selector_type($row->id_selector); } } else { if (class_exists($class)) { $selector = new $class(); } } if (is_object($selector)) { print $selector->get_form(); } break; case "save_source": if (!is_object($autoloader)) { $autoloader = new autoloader(); } $autoloader->add_register("docwatch", true); if (class_exists($className)) { $docwatch_datasource = new $className($id_datasource); //TODO: Comme pour la veille $docwatch_datasource->set_from_form(); $docwatch_datasource->set_num_watch($num_watch); $result = $docwatch_datasource->save(); if ($docwatch_datasource->get_id()) { $response = $docwatch_datasource->get_normalized_datasource(); } $response = array('result' => $result, 'elementId' => $docwatch_datasource->get_id(), 'response' => $response); print encoding_normalize::json_encode($response); } break;
return false; } protected function readCache() { if ($this->cacheUsed === false) { $cacheContents = @file_get_contents($this->getCacheFileForInstance()); if ($cacheContents !== false) { $cacheContents = @unserialize($cacheContents) ?: null; } if (is_array($cacheContents) === true && isset($cacheContents['version']) === true && $cacheContents['version'] === static::version) { $this->classes = $cacheContents['classes']; } $this->cacheUsed = true; } return $this; } protected function writeCache() { $cacheFile = $this->getCacheFileForInstance(); if (@file_put_contents($cacheFile, serialize(array('version' => static::version, 'classes' => $this->classes))) === false) { throw new \runtimeException('Unable to write in \'' . $cacheFile . '\''); } return $this; } protected static function exists($class) { return class_exists($class, false) === true || interface_exists($class, false) === true; } } autoloader::set();
/** * @access private * @param $setClassLoader */ public function getClassAutoloader($setClassLoader) { if ($this->getFilesRequire() != false) { $this->getFilesRequire(); } if (is_array($setClassLoader)) { //$mp_autoloader = dirname(__FILE__).'/component/loader/autoloader.php'; $loader = new autoloader(); $loader->registerPrefixFallbacks($setClassLoader); $loader->register(); } }
/** * Loads pro add-on class(es). */ public function load_pro_class() { if (isset($this->cache[__FUNCTION__])) { return; } // Already attempted this once. $this->cache[__FUNCTION__] = -1; if (!$this->has_pro_active()) { return; } // NOT active. if ($is_in_wp_debug_mode = $this->©env->is_in_wp_debug_mode()) { require_once $this->instance->plugin_pro_class_file; } else { @(include_once $this->instance->plugin_pro_class_file); } if (!class_exists($pro_class = $this->instance->plugin_root_ns_prefix . '\\pro') || empty($pro_class::${'for_plugin_version'}) || $pro_class::${'for_plugin_version'} !== $this->instance->plugin_version) { $this->enqueue_update_sync_pro_notice(); } else { $GLOBALS[$this->instance->plugin_pro_var] = $GLOBALS[$this->instance->plugin_root_ns]; autoloader::add_classes_dir($this->instance->plugin_pro_classes_dir); } }
<?php require_once dirname(__FILE__) . '/lib/autoloader.php'; autoloader::init(); ini_set('date.timezone', 'Europe/Zurich'); session_start(); $GLOBALS['domain_sub'] = "domain"; $requestURI = explode('/', $_SERVER['REQUEST_URI']); unset($requestURI[0]); if ($requestURI[1] == $GLOBALS['domain_sub']) { unset($requestURI[1]); } $req = array_values($requestURI); $tmp = new PageCat(); $cats = $tmp->findAll(1, 1, false, true); // parse routing for ($i = 0; $i < count($cats); $i++) { if ($req[0] == $cats[$i]->uri()) { $conString = $cats[$i]->controller(); $controller = new $conString(); $tmp = new PageCat(); $controller->cat = $tmp->find('uri', $req[0]); $controller->pageTitle = $controller->cat->title_de(); break; } } // standard start page? if ($req[0] == "") { $controller = new NormPage(); $controller->isStart = true; }
# DISCLAIMER # Do not edit or add to this file if you wish to upgrade MAGIX CMS to newer # versions in the future. If you wish to customize MAGIX CMS for your # needs please refer to http://www.magix-cms.com for more information. */ /** * Fichier de configuration */ $config_in = 'app/init/common.inc.php'; if (file_exists($config_in)) { require $config_in; } else { throw new Exception('Error Ini Common Files'); exit; } /** * Chargement du Bootsrap */ $bootstrap = __DIR__ . '/bootstrap.php'; if (file_exists($bootstrap)) { require $bootstrap; } else { throw new Exception('Boostrap is not exist'); } /** * Autoloader registerPrefixes pour les composants du CMS */ $loader = new autoloader(); $loader->registerPrefixes(array('component' => 'app', 'frontend' => 'app')); $loader->register();
<?php /* * bootstrap file containing some basic configuration and loading */ define('_BASEPATH_', __DIR__ . '/'); define('_LIBS_', _BASEPATH_ . 'libs/'); define('_TMP_', _BASEPATH_ . 'tmp/'); define('_CONTROLLERS_', _BASEPATH_ . 'controllers/'); // get base URL, without subdir if exists $base = $_SERVER['PHP_SELF']; $idx = strrpos($base, '/'); define('_BASEURL_', substr($_SERVER['PHP_SELF'], 0, $idx)); // get URI without base path $idx = strpos($_SERVER['REQUEST_URI'], _BASEURL_) + strlen(_BASEURL_); $uri = substr($_SERVER['REQUEST_URI'], $idx); unset($base, $idx); $refreshAutoloaderCache = true; require_once _LIBS_ . 'autoloader.php'; autoloader::init($refreshAutoloaderCache); $router = new router($uri); // load the controller $controller = $router->getController(); $controller = new $controller(); $method = $router->getMethod();
<?php try { define("DEBUG", true); require_once dirname(__FILE__) . "/rif/loader/autoloader.php"; autoloader::autoload(); $riframework = new riframework(); $riframework->shell(isset($argv) ? $argv : array()); } catch (Exception $e) { if (DEBUG) { $error = new rifErr($e); echo json_encode($error); } }
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # -- END LICENSE BLOCK ----------------------------------- # DISCLAIMER # Do not edit or add to this file if you wish to upgrade MAGIX CMS to newer # versions in the future. If you wish to customize MAGIX CMS for your # needs please refer to http://www.magix-cms.com for more information. */ $config_in = '../app/init/common.inc.php'; if (file_exists($config_in)) { require $config_in; } else { throw new Exception('Error Ini Common Files'); exit; } $bootstrap = __DIR__ . '/bootstrap.php'; if (file_exists($bootstrap)) { require $bootstrap; } $loader = new autoloader(); $loader->registerPrefixes(array('component' => '../app', 'backend' => '../app')); $loader->register();