2012-04-13 13 views
0

私は3つのPHPファイルを使用するテンプレートを持っています。PHPをASPに変換しますか?

コネクタ-fileimport.php コネクタ-icon.php elFinder.class.php

それはこれらは、ASP.NETに変換することは可能ですか?

コネクタ-fileimport.php

<?php 

error_reporting(0); // Set E_ALL for debuging 

if (function_exists('date_default_timezone_set')) { 
    date_default_timezone_set('Europe/Moscow'); 
} 

include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php'; 

/** 
* Simple example how to use logger with elFinder 
**/ 
class elFinderLogger implements elFinderILogger { 

    public function log($cmd, $ok, $context, $err='', $errorData = array()) { 
     if (false != ($fp = fopen('./log.txt', 'a'))) { 
      if ($ok) { 
       $str = "cmd: $cmd; OK; context: ".str_replace("\n", '', var_export($context, true))."; \n"; 
      } else { 
       $str = "cmd: $cmd; FAILED; context: ".str_replace("\n", '', var_export($context, true))."; error: $err; errorData: ".str_replace("\n", '', var_export($errorData, true))."\n"; 
      } 
      fwrite($fp, $str); 
      fclose($fp); 
     } 
    } 

} 

$opts = array(
    'root'   => '../../../../examfilemanager/',      // path to root directory 
    'URL'    => "examfilemanager/", // root directory URL 
    'rootAlias'  => 'Home',  // display this instead of root directory name 
    //'uploadAllow' => array('images/*'), 
    //'uploadDeny' => array('all'), 
    //'uploadOrder' => 'deny,allow' 
    // 'disabled'  => array(),  // list of not allowed commands 
    // 'dotFiles'  => false,  // display dot files 
    // 'dirSize'  => true,   // count total directories sizes 
    // 'fileMode'  => 0666,   // new files mode 
    // 'dirMode'  => 0777,   // new folders mode 
    // 'mimeDetect' => 'internal',  // files mimetypes detection method (finfo, mime_content_type, linux (file -ib), bsd (file -Ib), internal (by extensions)) 
    // 'uploadAllow' => array(),  // mimetypes which allowed to upload 
    // 'uploadDeny' => array(),  // mimetypes which not allowed to upload 
    // 'uploadOrder' => 'deny,allow', // order to proccess uploadAllow and uploadAllow options 
    // 'imgLib'  => 'mogrify',  // image manipulation library (imagick, mogrify, gd) 
    // 'tmbDir'  => '.tmb',  // directory name for image thumbnails. Set to "" to avoid thumbnails generation 
    // 'tmbCleanProb' => 1,   // how frequiently clean thumbnails dir (0 - never, 100 - every init request) 
    // 'tmbAtOnce' => 5,   // number of thumbnails to generate per request 
    // 'tmbSize'  => 48,   // images thumbnails size (px) 
    // 'fileURL'  => true,   // display file URL in "get info" 
    // 'dateFormat' => 'j M Y H:i', // file modification date format 
    // 'logger'  => null,   // object logger 
    // 'defaults'  => array(  // default permisions 
    // 'read' => true, 
    // 'write' => true, 
    // 'rm'  => true 
    // ), 
    // 'perms'  => array(),  // individual folders/files permisions  
    // 'debug'  => true,   // send debug to client 
    'archiveMimes' => array(),  // allowed archive's mimetypes to create. Leave empty for all available types. 
    // 'archivers' => array()  // info about archivers to use. See example below. Leave empty for auto detect 
    'archivers' => array(
     'create' => array(
      'application/x-gzip' => array(
       'cmd' => 'tar', 
       'argc' => '-czf', 
       'ext' => 'tar.gz' 
       ) 
      ), 
     'extract' => array(
      'application/x-gzip' => array(
       'cmd' => 'tar', 
       'argc' => '-xzf', 
       'ext' => 'tar.gz' 
       ), 
      'application/x-bzip2' => array(
       'cmd' => 'tar', 
       'argc' => '-xjf', 
       'ext' => 'tar.bz' 
       ) 
      ) 
     ) 
); 

$fm = new elFinder($opts); 
$fm->run(); 

?> 

コネクタ-icon.php

<?php 

error_reporting(0); // Set E_ALL for debuging 

if (function_exists('date_default_timezone_set')) { 
    date_default_timezone_set('Europe/Moscow'); 
} 

include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php'; 

/** 
* Simple example how to use logger with elFinder 
**/ 
class elFinderLogger implements elFinderILogger { 

    public function log($cmd, $ok, $context, $err='', $errorData = array()) { 
     if (false != ($fp = fopen('./log.txt', 'a'))) { 
      if ($ok) { 
       $str = "cmd: $cmd; OK; context: ".str_replace("\n", '', var_export($context, true))."; \n"; 
      } else { 
       $str = "cmd: $cmd; FAILED; context: ".str_replace("\n", '', var_export($context, true))."; error: $err; errorData: ".str_replace("\n", '', var_export($errorData, true))."\n"; 
      } 
      fwrite($fp, $str); 
      fclose($fp); 
     } 
    } 

} 

$opts = array(
    'root'   => '../../../../examicon/',      // path to root directory 
    'URL'    => "examicon/", // root directory URL 
    'rootAlias'  => 'Home',  // display this instead of root directory name 
    //'uploadAllow' => array('images/*'), 
    //'uploadDeny' => array('all'), 
    //'uploadOrder' => 'deny,allow' 
    // 'disabled'  => array(),  // list of not allowed commands 
    // 'dotFiles'  => false,  // display dot files 
    // 'dirSize'  => true,   // count total directories sizes 
    // 'fileMode'  => 0666,   // new files mode 
    // 'dirMode'  => 0777,   // new folders mode 
    // 'mimeDetect' => 'internal',  // files mimetypes detection method (finfo, mime_content_type, linux (file -ib), bsd (file -Ib), internal (by extensions)) 
    // 'uploadAllow' => array(),  // mimetypes which allowed to upload 
    // 'uploadDeny' => array(),  // mimetypes which not allowed to upload 
    // 'uploadOrder' => 'deny,allow', // order to proccess uploadAllow and uploadAllow options 
    // 'imgLib'  => 'mogrify',  // image manipulation library (imagick, mogrify, gd) 
    // 'tmbDir'  => '.tmb',  // directory name for image thumbnails. Set to "" to avoid thumbnails generation 
    // 'tmbCleanProb' => 1,   // how frequiently clean thumbnails dir (0 - never, 100 - every init request) 
    // 'tmbAtOnce' => 5,   // number of thumbnails to generate per request 
    // 'tmbSize'  => 48,   // images thumbnails size (px) 
    // 'fileURL'  => true,   // display file URL in "get info" 
    // 'dateFormat' => 'j M Y H:i', // file modification date format 
    // 'logger'  => null,   // object logger 
    // 'defaults'  => array(  // default permisions 
    // 'read' => true, 
    // 'write' => true, 
    // 'rm'  => true 
    // ), 
    // 'perms'  => array(),  // individual folders/files permisions  
    // 'debug'  => true,   // send debug to client 
    'archiveMimes' => array(),  // allowed archive's mimetypes to create. Leave empty for all available types. 
    // 'archivers' => array()  // info about archivers to use. See example below. Leave empty for auto detect 
    'archivers' => array(
     'create' => array(
      'application/x-gzip' => array(
       'cmd' => 'tar', 
       'argc' => '-czf', 
       'ext' => 'tar.gz' 
       ) 
      ), 
     'extract' => array(
      'application/x-gzip' => array(
       'cmd' => 'tar', 
       'argc' => '-xzf', 
       'ext' => 'tar.gz' 
       ), 
      'application/x-bzip2' => array(
       'cmd' => 'tar', 
       'argc' => '-xjf', 
       'ext' => 'tar.bz' 
       ) 
      ) 
     ) 
); 

$fm = new elFinder($opts); 
$fm->run(); 

?> 

3番目のファイルは、この記事に含めるにはあまりにも大きかったです。しかしこれも可能ですか?

+3

もちろん、それを変換することは可能です。ちょうどそれを投げ捨て、それをASPに書き直してください(うまくいけばASP.NETと悲惨な "古典的な" ASP)。だから、[実際の]質問はどこですか? –

+3

確かに、あなたはそれに十分な汗をかけると、一般にどの言語も他の言語に変換することができます。 –

+0

Def。可能。あなたはあなたのためにそれをやる人を探していますか? –

答えて

1

いくつかの自動化ツールが存在していても、私は強く選ぶだろうそれに対してすべての言語には固有の特徴があり、未加工の変換はめったに良い考えではありません。

他にも示唆しているように - あなた自身で書き直してください。ツールに頼らないでください。

0

たぶん、あなたはこれを使用することができます(私は、ASPが正確に何をするかわからないので、それが何であるか見当がつかない)

http://www.asp.net/downloads/archived-v11/migration-assistants/php-to-aspnet

+0

それは、残念ながらそれを働かせることはできませんでした。何らかのコンバータを見つけて、何千ものコード行を書き直す必要がないことを期待していました。 –

+0

@JamesWilsonこれを自動的に変換することはできません。 AIが私の知識を上回っていない限り、人間の開発者はそれを同じインテント/セマンティクスで書き直す必要があります。部品は変換される可能性がありますが、悲しいかな、そして開発者までは、SOは募集サイトではありません;-) –

関連する問題