232 return str_replace(
'_', NULL,
$p );
248 define(
'START_TIME' , microtime(
true ) );
251 define(
'DIRECTORY_BASE' , str_replace(
'_src' , NULL , dirname( __FILE__ ) ) );
254 define(
'DIRECTORY_ETC' ,
'_etc/' );
255 define(
'DIRECTORY_DIZIONARI' ,
'_etc/_dictionaries/' );
256 define(
'DIRECTORY_MODULI' ,
'_mod/' );
257 define(
'DIRECTORY_SRC' ,
'_src/' );
258 define(
'DIRECTORY_CONFIGURAZIONE' ,
'_src/_config/' );
259 define(
'DIRECTORY_INCLUSIONI' ,
'_src/_inc/' );
260 define(
'DIRECTORY_CONTROLLER' ,
'_src/_inc/_controllers/' );
261 define(
'DIRECTORY_LIBRERIE' ,
'_src/_lib/' );
262 define(
'DIRECTORY_LIBRERIE_EX' ,
'_src/_lib/_external/' );
263 define(
'DIRECTORY_TEMPORANEA' ,
'tmp/' );
264 define(
'DIRECTORY_VAR' ,
'var/' );
265 define(
'DIRECTORY_CACHE' ,
'var/cache/' );
266 define(
'DIRECTORY_IMMAGINI' ,
'var/immagini/' );
267 define(
'DIRECTORY_LOG' ,
'var/log/' );
268 define(
'DIRECTORY_LOG_LATEST' ,
'var/log/latest/' );
275 define(
'FILTERED_CONTROL' ,
'FILTERED' );
276 define(
'FULL_CONTROL' ,
'FULL' );
279 define(
'METHOD_DELETE' ,
'DELETE' );
280 define(
'METHOD_GET' ,
'GET' );
281 define(
'METHOD_PATCH' ,
'PATCH' );
282 define(
'METHOD_POST' ,
'POST' );
283 define(
'METHOD_PUT' ,
'PUT' );
284 define(
'METHOD_REPLACE' ,
'REPLACE' );
285 define(
'METHOD_UPDATE' ,
'UPDATE' );
288 define(
'DB_MYSQL' ,
'MYSQL' );
289 define(
'DB_POSTGRESQL' ,
'PGSQL' );
290 define(
'DB_MSSQL' ,
'MSSQL' );
293 define(
'OB_NON_ATTIVO' ,
'NOOB' );
294 define(
'OB_ATTIVO' ,
'OB' );
295 define(
'OB_ATTIVO_CON_GZIP' ,
'OBGZ' );
298 define(
'SESSION_APACHE' ,
'SESS_APACHE' );
299 define(
'SESSION_FILESYSTEM' ,
'SESS_FS' );
300 define(
'SESSION_REDIS' ,
'SESS_REDIS' );
301 define(
'SESSION_MEMCACHE' ,
'SESS_MEMCACHE' );
304 if( ob_start(
'ob_gzhandler' ) ) {
327 if( file_exists(
DIRECTORY_BASE .
'src/config/external/config.yaml' ) ) {
328 $cx = yaml_parse( file_get_contents(
DIRECTORY_BASE .
'src/config/external/config.yaml' ) );
331 $cx = yaml_parse( file_get_contents(
DIRECTORY_BASE .
'src/config.yaml' ) );
334 $cx = json_decode( file_get_contents(
DIRECTORY_BASE .
'src/config/external/config.json' ),
true );
337 $cx = json_decode( file_get_contents(
DIRECTORY_BASE .
'src/config.json' ),
true );
360 if( isset( $cx[
'mods'][
'active'][
'array'] ) ) {
361 $cf[
'mods'][
'active'][
'array'] = $cx[
'mods'][
'active'][
'array'];
362 $cf[
'mods'][
'active'][
'string'] = implode(
',',
$cf[
'mods'][
'active'][
'array'] );
364 $cf[
'mods'][
'active'][
'array'] = array_values( array_diff( scandir( str_replace(
'_',
'',
DIRECTORY_BASE . DIRECTORY_MODULI ) ) , array(
'..' ,
'.' ) ) );
365 $cf[
'mods'][
'active'][
'string'] = implode(
',',
$cf[
'mods'][
'active'][
'array'] );
366 # } elseif( ! empty( $_ENV['ACTIVE_MODULES'] ) ) { 367 # $cf['mods']['active']['array'] = explode( ',', $_ENV['ACTIVE_MODULES'] ); 368 # $cf['mods']['active']['string'] = getenv( 'ACTIVE_MODULES' ); 370 $cf[
'mods'][
'active'][
'array'] = array();
371 $cf[
'mods'][
'active'][
'string'] = NULL;
387 define(
'MODULI_ATTIVI' ,
$cf[
'mods'][
'active'][
'string'] );
406 $locale = str_replace(
'_' ,
'' , $libreria );
407 if( file_exists( $locale ) ) {
442 if( ! isset(
$cf[
'runlevels'][
'skip'] ) ) {
$cf[
'runlevels'][
'skip'] = array(); }
471 $configFileLocale = str_replace(
'_',
'', $configFile );
474 $runLvlArray = explode(
'.', basename( $configFileLocale ) );
475 $runLvlString = array_shift( $runLvlArray );
478 if( ! in_array( $runLvlString,
$cf[
'runlevels'][
'skip'] ) ) {
486 if( file_exists( $configFileLocale ) ) {
487 require $configFileLocale;
494 foreach( $arrayConfigModuli as $configFileModuli ) {
500 require $configFileModuli;
505 $configFileModuliLocale = str_replace(
'_',
'', $configFileModuli );
506 if( file_exists( $configFileModuliLocale ) ) {
507 require $configFileModuliLocale;
516 logWrite(
'saltato runlevel: ' . $runLvlString,
'speed', LOG_DEBUG );
logWrite( $m, $f='site', $l=LOG_NOTICE, $d=DIRECTORY_LOG, $t=CURRENT_LOG_LEVEL, $s=SITE_STATUS)
scrive un messaggio nei log del sito
$cf['mods']['active']['string']
if(! isset( $_REQUEST['__view__'][ $ct['view']['id']]['__extra__']['assegnato'])|| $_REQUEST['__view__'][ $ct['view']['id']]['__extra__']['assegnato']=='__me__') elseif($_REQUEST[ '__view__'][$ct[ 'view'][ 'id']][ '__extra__'][ 'assegnato']=='__nessuno__')
const DIRECTORY_LOG_LATEST
const DIRECTORY_CONFIGURAZIONE