if (is_dir($file)) { $directory_path = $file . DIRECTORY_SEPARATOR; array_push($directories, $directory_path); $files['dirs'][] = $directory_path; } elseif (is_file($file)) { $files['files'][] = $file; } } closedir($handle); } } return $files; } $exclude_files = array('cache.manifest', 'list_files.php', '.htaccess', 'lib/angular/README.md'); $replace_files = array("lib/onsen/css/ionicons/fonts/ionicons.ttf" => "lib/onsen/css/ionicons/fonts/ionicons.ttf?v=2.0.0", "lib/onsen/css/ionicons/fonts/ionicons.woff" => "lib/onsen/css/ionicons/fonts/ionicons.woff?v=2.0.0"); $ary = read_all_files(); $files = $ary['files']; $data = "CACHE MANIFEST\n"; // 顯示現在日期 $data .= "# " . date("Y-m-d H:i:s") . "\n\n"; foreach ($files as $file) { $file = substr($file, 2); $file = str_replace("\\", "/", $file); //echo $file . " - "; if (in_array($file, $exclude_files) !== FALSE) { continue; } if (isset($replace_files[$file])) { $file = $replace_files[$file]; } $data .= $file . "\n";
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_USERPWD, "{$username}:{$password}"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_POST, 1); $curlResponse = curl_exec($ch); curl_close($ch); $curlResponse = json_decode($curlResponse, TRUE); //echo $curlResponse['access_token']."\n"; $access_token = $curlResponse['access_token']; $dir = realpath($srclib); $getcwd = getcwd(); chdir($dir); $srclibarray = read_all_files(); chdir($getcwd); $data1 = 'access_token=' . $curlResponse['access_token'] . '&test=test'; $data1 .= '&device=' . $device; $data1 .= '&srcfile=' . urlencode(base64_encode(urlencode(file_get_contents($srcfile)))); if (count($srclibarray['files']) > 0) { $fixedFiles = array(); foreach ($srclibarray['files'] as $curName => $curFile) { $fixedFiles[] = 'srclib[' . $curName . ']=' . urlencode($curFile); } $data1 .= '&' . implode('&', $fixedFiles); } $data1 .= '&filename=' . $filename; $data1 .= '&comp=' . $comp; $data1 .= '&writedevice=' . $writedevice; //echo $data1;
<hr/> <h1><Strong>On Device Installation Server</strong></h1> <center><h2><Strong>IOS</h2><center> <!-- <p class='designer'>Created by Krish and Ramki</p> --> <hr/> <div class='install_instructions'> <ul> <li>Tap on application icon install on device.</li> <li>Tap on info icon to get the details of the build.</li> <li>App can be installed only when device UDID is in the provisioning profile which is used to AdHoc build.</li> </ul> </div> <hr/> <?php $data = []; $files = read_all_files('./Builds'); $files = $files['files']; $cnt = -1; foreach ($files as $file) { if (strpos($file, '.json') !== false) { $handle = @fopen($file, "r"); $json = ""; while (false !== ($char = fgetc($handle))) { $json = $json . $char; } $json = json_decode($json, true); $json['buildFileLocation'] = './Builds'; $cnt++; $data[$cnt] = $json; } }