function get_includes($filename, &$includes = false) { if (!$includes) { $includes = array($filename); } // Recurse through includes within this file foreach (includedFiles($filename) as $include) { if (!in_array($include, $includes)) { array_push($includes, $include); get_includes($include, $includes); } } // Look for implementation files $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); if (in_array($extension, array("h", "hh", "hpp", "h++"))) { $implementationExtensions = array("cpp", "cc", "cp", "cxx", "c++"); if ($extension == "h") { $implementationExtensions = array_merge($implementationExtensions, array("c", "m", "mm")); } $directory = dirname($filename); $classname = pathinfo($filename, PATHINFO_FILENAME); $files = array_filter(scandir($directory), function ($item) { return !is_dir($directory . "/" . $item); }); foreach ($files as $file) { $theFile = pathinfo($file, PATHINFO_FILENAME); if ($theFile == $classname) { $theFileExt = strtolower(pathinfo($file, PATHINFO_EXTENSION)); if (in_array($theFileExt, $implementationExtensions)) { $path = $directory . "/" . $file; if (!in_array($path, $includes)) { $includedFiles = includedFiles($path); if (in_array($filename, $includedFiles)) { array_push($includes, $path); foreach ($includedFiles as $include) { if (!in_array($include, $includes)) { array_push($includes, $include); get_includes($include, $includes); } } break; } } } } } } return $includes; }
... well done you!<br /> now go to the <a href="create.php">create page</a> to create your database tables...'; exit; } if (!empty($config['admin']['shutdown'])) { header('HTTP/1.1 503 Service Temporarily Unavailable', true, 503); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 172800'); echo "\n\t\t" . $config['site']['title'] . " is temporarily closed for maintenance..."; exit; } // process url $request = process_request(); $config['site']['theme'] = isset($_SESSION['theme']) ? $_SESSION['theme'] : $config['site']['theme']; // check for includes $includes = get_includes($config['site']['theme']); if (!empty($includes)) { foreach ($includes as $inc) { include_once $inc; } } // create a 'meta title' from the main site title (used for browser titlebar and <title> tag // redirect as needed if (isset($_GET['page_name'])) { // rss feed - redirect to xml page if ($_GET['page_name'] == 'feed') { include WW_ROOT . '/ww_view/rss-xml.php'; exit; } // front page if ($_GET['page_name'] == 'front') {
if (make_app_version_dir($app_name, $i, $platform)) { error("Couldn't create dir: {$app_dir}"); } $file = "{$app_dir}/{$app_name}" . "_1." . $i; if (!copy($wrapper_filename, $file)) { error("Couldn't copy {$wrapper_filename} to {$file}"); } chmod($file, 0750); echo "- type 'bin/update_versions', and answer 'y' to all questions.\n"; } } // make sure daemons are in the config file // function check_config_file() { global $app_name, $platform; $config = file_get_contents('config.xml'); if (!strstr($config, "single_job_assimilator")) { echo "- Add the following to the <daemons> section of config.xml:\n\n <daemon>\n <cmd>single_job_assimilator -app {$app_name}</cmd>\n <output>single_job_assimilator_{$platform}.out</output>\n <pid>single_job_assimilator_{$platform}.pid</pid>\n </daemon>\n <daemon>\n <cmd>sample_trivial_validator -app {$app_name}</cmd>\n <output>sample_trivial_validator_{$platform}.out</output>\n <pid>sample_trivial_validator_{$platform}.pid</pid>\n </daemon>\nThen restart your project by typing\nbin/stop\nbin/start\n "; } } if ($argc != 2) { usage(); } $boinc_samples_dir = $argv[1]; check_wrapper_exists(); get_includes(); add_application(); add_apps_dir(); create_app_dir(); check_config_file();
</ul> </div> </nav> <?php if (is_page('home') || is_page('single')) { // The Video Gallery Template get_template_part('content-gallery'); } elseif (is_page('about')) { // The About Page Template get_template_part('content-about'); } else { // The 404 Page Template get_template_part('content-404'); } ?> <?php get_includes('footer'); ?> <script src="<?php get_setting($theme_url); ?> /assets/js/app.js"></script> <?php get_analytics(); ?> </body> </html>