fclose($handle_r); // Update values $properties['project.path'] = getRelativePath($tmp_directory, WINK_DIRECTORY); $properties['wink.build.destdir'] = getRelativePath($tmp_directory, $build_directory); $properties['build.conf.dir'] = getRelativePath($tmp_directory, $tmp_directory); // Rewrite the properties file $handle_w = fopen($list_copies[WINK_PATH_PROPERTIES_BUILD], 'w+'); foreach ($properties as $key => $value) { fwrite($handle_w, $key . ': ' . $value . "\r\n"); } fclose($handle_w); // -------------------------------------------------- // Update json profile file with the modules choosed // -------------------------------------------------- // Parse Json $profile_data = parseJsonFile($list_copies[WINK_PATH_JSON_PROFILES], TRUE); // define language choosed if (count($languages) == 0) { $languages = array('en_EN'); } $profile_data['defaultLocaleList'] = $languages; // Get CSS files from theme choosed $theme_choosed = param('css_theme'); $defaults_css = searchInDir(array('\\.css$'), WINK_DIR_THEMES, FALSE); $list_css = array_merge($defaults_css, searchInDir(array('\\.css$'), WINK_DIR_THEMES . '/' . $theme_choosed, TRUE)); // Update css path to relative path foreach ($list_css as $k => $path) { $list_css[$k] = getRelativePath(WINK_DIRECTORY, $path); } // Reset profils $profile_data['profiles'] = array();
function parseJsonAst($ast) { assert_ast_type($ast, [NodeType::JSON_INLINE, NodeType::JSON_FILE]); $type = ast_node_type($ast); switch ($type) { case NodeType::JSON_INLINE: return parseJsonInline($ast); break; case NodeType::JSON_FILE: return parseJsonFile($ast); break; } }
<?php // Load required files require_once dirname(__FILE__) . '/../inc/config.php'; require_once dirname(__FILE__) . '/../inc/functions.inc.php'; // Parse and get modules $listModules = parseJsonFile(WINK_DIRECTORY . '/utils/build/conf/modules.json'); $res = parseListModule($listModules->modules); // Return to json format echo json_encode(array('result' => $res)); exit;