Warning, /webapps/ocs-webserver/library/Zend/Service/WindowsAzure/CommandLine/Scaffolders/DefaultScaffolder.phar is written in an unsupported language. File is not indexed.
0001 <?php
0002
0003 $web = 'index.php';
0004
0005 if (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {
0006 Phar::interceptFileFuncs();
0007 set_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());
0008 Phar::webPhar(null, $web);
0009 include 'phar://' . __FILE__ . '/' . Extract_Phar::START;
0010 return;
0011 }
0012
0013 if (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) {
0014 Extract_Phar::go(true);
0015 $mimes = array(
0016 'phps' => 2,
0017 'c' => 'text/plain',
0018 'cc' => 'text/plain',
0019 'cpp' => 'text/plain',
0020 'c++' => 'text/plain',
0021 'dtd' => 'text/plain',
0022 'h' => 'text/plain',
0023 'log' => 'text/plain',
0024 'rng' => 'text/plain',
0025 'txt' => 'text/plain',
0026 'xsd' => 'text/plain',
0027 'php' => 1,
0028 'inc' => 1,
0029 'avi' => 'video/avi',
0030 'bmp' => 'image/bmp',
0031 'css' => 'text/css',
0032 'gif' => 'image/gif',
0033 'htm' => 'text/html',
0034 'html' => 'text/html',
0035 'htmls' => 'text/html',
0036 'ico' => 'image/x-ico',
0037 'jpe' => 'image/jpeg',
0038 'jpg' => 'image/jpeg',
0039 'jpeg' => 'image/jpeg',
0040 'js' => 'application/x-javascript',
0041 'midi' => 'audio/midi',
0042 'mid' => 'audio/midi',
0043 'mod' => 'audio/mod',
0044 'mov' => 'movie/quicktime',
0045 'mp3' => 'audio/mp3',
0046 'mpg' => 'video/mpeg',
0047 'mpeg' => 'video/mpeg',
0048 'pdf' => 'application/pdf',
0049 'png' => 'image/png',
0050 'swf' => 'application/shockwave-flash',
0051 'tif' => 'image/tiff',
0052 'tiff' => 'image/tiff',
0053 'wav' => 'audio/wav',
0054 'xbm' => 'image/xbm',
0055 'xml' => 'text/xml',
0056 );
0057
0058 header("Cache-Control: no-cache, must-revalidate");
0059 header("Pragma: no-cache");
0060
0061 $basename = basename(__FILE__);
0062 if (!strpos($_SERVER['REQUEST_URI'], $basename)) {
0063 chdir(Extract_Phar::$temp);
0064 include $web;
0065 return;
0066 }
0067 $pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));
0068 if (!$pt || $pt == '/') {
0069 $pt = $web;
0070 header('HTTP/1.1 301 Moved Permanently');
0071 header('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);
0072 exit;
0073 }
0074 $a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
0075 if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
0076 header('HTTP/1.0 404 Not Found');
0077 echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
0078 exit;
0079 }
0080 $b = pathinfo($a);
0081 if (!isset($b['extension'])) {
0082 header('Content-Type: text/plain');
0083 header('Content-Length: ' . filesize($a));
0084 readfile($a);
0085 exit;
0086 }
0087 if (isset($mimes[$b['extension']])) {
0088 if ($mimes[$b['extension']] === 1) {
0089 include $a;
0090 exit;
0091 }
0092 if ($mimes[$b['extension']] === 2) {
0093 highlight_file($a);
0094 exit;
0095 }
0096 header('Content-Type: ' .$mimes[$b['extension']]);
0097 header('Content-Length: ' . filesize($a));
0098 readfile($a);
0099 exit;
0100 }
0101 }
0102
0103 class Extract_Phar
0104 {
0105 static $temp;
0106 static $origdir;
0107 const GZ = 0x1000;
0108 const BZ2 = 0x2000;
0109 const MASK = 0x3000;
0110 const START = 'index.php';
0111 const LEN = 6685;
0112
0113 static function go($return = false)
0114 {
0115 $fp = fopen(__FILE__, 'rb');
0116 fseek($fp, self::LEN);
0117 $L = unpack('V', $a = (binary)fread($fp, 4));
0118 $m = (binary)'';
0119
0120 do {
0121 $read = 8192;
0122 if ($L[1] - strlen($m) < 8192) {
0123 $read = $L[1] - strlen($m);
0124 }
0125 $last = (binary)fread($fp, $read);
0126 $m .= $last;
0127 } while (strlen($last) && strlen($m) < $L[1]);
0128
0129 if (strlen($m) < $L[1]) {
0130 die('ERROR: manifest length read was "' .
0131 strlen($m) .'" should be "' .
0132 $L[1] . '"');
0133 }
0134
0135 $info = self::_unpack($m);
0136 $f = $info['c'];
0137
0138 if ($f & self::GZ) {
0139 if (!function_exists('gzinflate')) {
0140 die('Error: zlib extension is not enabled -' .
0141 ' gzinflate() function needed for zlib-compressed .phars');
0142 }
0143 }
0144
0145 if ($f & self::BZ2) {
0146 if (!function_exists('bzdecompress')) {
0147 die('Error: bzip2 extension is not enabled -' .
0148 ' bzdecompress() function needed for bz2-compressed .phars');
0149 }
0150 }
0151
0152 $temp = self::tmpdir();
0153
0154 if (!$temp || !is_writable($temp)) {
0155 $sessionpath = session_save_path();
0156 if (strpos ($sessionpath, ";") !== false)
0157 $sessionpath = substr ($sessionpath, strpos ($sessionpath, ";")+1);
0158 if (!file_exists($sessionpath) || !is_dir($sessionpath)) {
0159 die('Could not locate temporary directory to extract phar');
0160 }
0161 $temp = $sessionpath;
0162 }
0163
0164 $temp .= '/pharextract/'.basename(__FILE__, '.phar');
0165 self::$temp = $temp;
0166 self::$origdir = getcwd();
0167 @mkdir($temp, 0777, true);
0168 $temp = realpath($temp);
0169
0170 if (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {
0171 self::_removeTmpFiles($temp, getcwd());
0172 @mkdir($temp, 0777, true);
0173 @file_put_contents($temp . '/' . md5_file(__FILE__), '');
0174
0175 foreach ($info['m'] as $path => $file) {
0176 $a = !file_exists(dirname($temp . '/' . $path));
0177 @mkdir(dirname($temp . '/' . $path), 0777, true);
0178 clearstatcache();
0179
0180 if ($path[strlen($path) - 1] == '/') {
0181 @mkdir($temp . '/' . $path, 0777);
0182 } else {
0183 file_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));
0184 @chmod($temp . '/' . $path, 0666);
0185 }
0186 }
0187 }
0188
0189 chdir($temp);
0190
0191 if (!$return) {
0192 include self::START;
0193 }
0194 }
0195
0196 static function tmpdir()
0197 {
0198 if (strpos(PHP_OS, 'WIN') !== false) {
0199 if ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) {
0200 return $var;
0201 }
0202 if (is_dir('/temp') || mkdir('/temp')) {
0203 return realpath('/temp');
0204 }
0205 return false;
0206 }
0207 if ($var = getenv('TMPDIR')) {
0208 return $var;
0209 }
0210 return realpath('/tmp');
0211 }
0212
0213 static function _unpack($m)
0214 {
0215 $info = unpack('V', substr($m, 0, 4));
0216 $l = unpack('V', substr($m, 10, 4));
0217 $m = substr($m, 14 + $l[1]);
0218 $s = unpack('V', substr($m, 0, 4));
0219 $o = 0;
0220 $start = 4 + $s[1];
0221 $ret['c'] = 0;
0222
0223 for ($i = 0; $i < $info[1]; $i++) {
0224 $len = unpack('V', substr($m, $start, 4));
0225 $start += 4;
0226 $savepath = substr($m, $start, $len[1]);
0227 $start += $len[1];
0228 $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24)));
0229 $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]
0230 & 0xffffffff);
0231 $ret['m'][$savepath][7] = $o;
0232 $o += $ret['m'][$savepath][2];
0233 $start += 24 + $ret['m'][$savepath][5];
0234 $ret['c'] |= $ret['m'][$savepath][4] & self::MASK;
0235 }
0236 return $ret;
0237 }
0238
0239 static function extractFile($path, $entry, $fp)
0240 {
0241 $data = '';
0242 $c = $entry[2];
0243
0244 while ($c) {
0245 if ($c < 8192) {
0246 $data .= @fread($fp, $c);
0247 $c = 0;
0248 } else {
0249 $c -= 8192;
0250 $data .= @fread($fp, 8192);
0251 }
0252 }
0253
0254 if ($entry[4] & self::GZ) {
0255 $data = gzinflate($data);
0256 } elseif ($entry[4] & self::BZ2) {
0257 $data = bzdecompress($data);
0258 }
0259
0260 if (strlen($data) != $entry[0]) {
0261 die("Invalid internal .phar file (size error " . strlen($data) . " != " .
0262 $stat[7] . ")");
0263 }
0264
0265 if ($entry[3] != sprintf("%u", crc32((binary)$data) & 0xffffffff)) {
0266 die("Invalid internal .phar file (checksum error)");
0267 }
0268
0269 return $data;
0270 }
0271
0272 static function _removeTmpFiles($temp, $origdir)
0273 {
0274 chdir($temp);
0275
0276 foreach (glob('*') as $f) {
0277 if (file_exists($f)) {
0278 is_dir($f) ? @rmdir($f) : @unlink($f);
0279 if (file_exists($f) && is_dir($f)) {
0280 self::_removeTmpFiles($f, getcwd());
0281 }
0282 }
0283 }
0284
0285 @rmdir($temp);
0286 clearstatcache();
0287 chdir($origdir);
0288 }
0289 }
0290
0291 Extract_Phar::go();
0292 __HALT_COMPILER(); ?> , build.batO +MO j index.php_ +M_ VTZ : resources/PhpOnAzure.Web/bin/add-environment-variables.cmd= +M= o : resources/PhpOnAzure.Web/bin/add-environment-variables.ps1 +M +v , resources/PhpOnAzure.Web/bin/install-php.cmd) +M) o ; resources/PhpOnAzure.Web/resources/WebPICmdLine/license.rtf +M \ L resources/PhpOnAzure.Web/resources/WebPICmdLine/Microsoft.Web.Deployment.dll`W +M`W ` S resources/PhpOnAzure.Web/resources/WebPICmdLine/Microsoft.Web.PlatformInstaller.dll` +M` DĶ V resources/PhpOnAzure.Web/resources/WebPICmdLine/Microsoft.Web.PlatformInstaller.UI.dll`W +M`W Z< @ resources/PhpOnAzure.Web/resources/WebPICmdLine/WebpiCmdLine.exeq +Mq ?u)[ # resources/PhpOnAzure.Web/Web.config` +M` La̶ $ resources/ServiceConfiguration.cscfg +M {& ! resources/ServiceDefinition.csdef +M ҕ} + resources/PhpOnAzure.Web/diagnostics.wadcfg +M ) .svn/all-wcprops +M .svn/entriesE +ME + ! .svn/text-base/build.bat.svn-baseO +MO j ! .svn/text-base/index.php.svn-base_ +M_ VTZ resources/.svn/all-wcprops( +M( >˶ resources/.svn/entriess +Ms cE <