<?php $fichier_php = implode("/", $thisSite->current_tab_paths); $script_php = get_path($fichier_php, 0); if ($script_php == "") { $script_php = get_path_pages($fichier_php, 0); } if ($script_php == "") { $script_php = $fichier_php; } if (!file_exists($script_php) || $script_php == "") { $thisSite->current_scriptPHP = get_path_pages("404.php", 0); config_404("index-php.php: page_php inconnue: " . $thisSite->RACINE . $script_php); } else { $thisSite->current_scriptPHP = $script_php; } $thisSite->current_scriptTPL = remove_extension($thisSite->current_scriptPHP) . ".tpl"; include_once $thisSite->DOS_BASE_INIT . "init_commun.php"; // initialisation commune à tout les types de page include $thisSite->current_scriptPHP; $smarty->assign("thisSite", $thisSite); $_SESSION["thisSite"] = serialize($thisSite); if (file_exists($thisSite->current_scriptTPL)) { $smarty->display($thisSite->current_scriptTPL); }
# do an extra check to see if the original filename might have uppercase extension that can be preserved. # also, set extension to "" if the original filename didn't have an extension (exiftool identification of filetypes) $pathparts = pathinfo($filename); if (isset($pathparts['extension'])) { if (strtolower($pathparts['extension']) == $pextension) { $pextension = $pathparts['extension']; } } else { $pextension = "jpg"; } if ($usesize != "" && !$subbed_original) { $append = "-" . $usesize; } else { $append = ""; } $basename_minus_extension = remove_extension($pathparts['basename']); $filename = $basename_minus_extension . $append . "." . $pextension; if ($prefix_resource_id_to_filename) { $filename = $prefix_filename_string . $ref . "_" . $filename; } $fs = explode("/", $filename); $filename = $fs[count($fs) - 1]; # Convert $filename to the charset used on the server. if (!isset($server_charset)) { $to_charset = 'UTF-8'; } else { if ($server_charset != "") { $to_charset = $server_charset; } else { $to_charset = 'UTF-8'; }
} } } $thisSite->page = $thisSite->pages[$thisSite->idPage]; //////////// if ($thisSite->current_scriptPHP == "") { $thisSite->current_scriptPHP = "404.php"; config_404("index-nophp.php: page_php==''"); } $fichier_php = get_path_pages($thisSite->current_scriptPHP, 0); if ($fichier_php == "") { $thisSite->current_scriptTPL = ""; } // Templating if ($thisSite->current_scriptTPL == "") { $thisSite->current_scriptTPL = remove_extension($fichier_php) . ".tpl"; } else { $thisSite->current_scriptTPL = get_path_pages($thisSite->current_scriptTPL, 0); } $my_cache_id = $thisSite->current_lang . "_" . implode($thisSite->current_tab_paths, "_"); $my_cache_id = md5($my_cache_id); if ($thisSite->current_scriptTPL == "") { $isCached = 0; } else { $isCached = $smarty->isCached($thisSite->current_scriptTPL, $my_cache_id); } // Ne pas mettre plus loin $smarty->assign("thisSite", $thisSite); if ($isCached == 0) { $datas_page = array(); include_once $thisSite->DOS_BASE_INIT . "init_commun.php";
$version = get_laravel_version(); $current_path = getcwd() . '/vendor/sempro/laraworker/'; $workers_dir_path = getcwd() . '/workers'; $install_option = getopt("i:"); @($install_option = $install_option['i'] === 'true' ? true : false); if (!$install_option) { return; } if ($version == 4) { $command_destination_path = getcwd() . '/app/commands'; $config_destination_path = getcwd() . '/app/config'; $artisan_file_path = getcwd() . '/app/start/artisan.php'; $commands = array('RunWorker.php', 'UploadWorker.php'); //register commands foreach ($commands as $command) { $register_command_text = "Artisan::add(new " . remove_extension($command) . ");"; if (!is_command_registered($artisan_file_path, $register_command_text)) { file_put_contents($artisan_file_path, "\r\n" . $register_command_text, FILE_APPEND); } } } elseif ($version == 5) { $command_destination_path = getcwd() . '/app/Console/Commands'; $config_destination_path = getcwd() . '/config'; $artisan_file_path = getcwd() . '/app/Console/Kernel.php'; $commands = array('App\\Console\\Commands\\RunWorker', 'App\\Console\\Commands\\UploadWorker'); $worker_boot_path = $current_path . '/workers/libs/worker_boot.php'; $register_command_text = ""; foreach ($commands as $command) { $register_command_text .= "'" . $command . "',\n"; } insert_to_file($artisan_file_path, "protected \$commands", $register_command_text);
$smarty->assign("PAGE_head", array_unique($PAGE_type_action)); } $PAGE_type_action = $smarty->getTemplateVars("PAGE_javascript"); if (is_array($PAGE_type_action)) { $smarty->assign("PAGE_javascript", array_unique($PAGE_type_action)); } $PAGE_type_action = $smarty->getTemplateVars("PAGE_doc_ready"); if (is_array($PAGE_type_action)) { $smarty->assign("PAGE_doc_ready", array_unique($PAGE_type_action)); } $PAGE_type_action = $smarty->getTemplateVars("PAGE_win_load"); if (is_array($PAGE_type_action)) { $smarty->assign("PAGE_win_load", array_unique($PAGE_type_action)); } $PAGE_type_action = $smarty->getTemplateVars("PAGE_footer"); if (is_array($PAGE_type_action)) { $smarty->assign("PAGE_footer", array_unique($PAGE_type_action)); } if (!file_exists($thisSite->current_scriptTPL)) { $thisSite->current_scriptTPL = ""; } // Script JS associé à la page $fichier_js = remove_extension($thisSite->current_scriptPHP) . ".js"; if (file_exists($thisSite->DOS_CLIENT . "js/" . $fichier_js)) { $thisSite->current_scriptJS = $thisSite->DOS_CLIENT . "js/" . $fichier_js; } $structure_page = $thisSite->DOS_BASE_TEMPLATES . $thisSite->current_typePage . ".tpl"; $_SESSION["thisSite"] = serialize($thisSite); if (file_exists($structure_page)) { $smarty->display($structure_page, $my_cache_id); }