Pear::VersionControl::VersionControl_SVN(完結)
というわけで、相変わらずそこはかとなくイライラはしているものの、一端の解決とします。
全世界のVersionControl_SVNをWindows環境で実行しようとして、Pearマニュアルのサンプルがうごかねー!とお嘆きの皆様!
Windows環境での、より現実的なサンプルはこうなりましたよーー 笑
<?php require_once 'VersionControl/SVN.php'; // エラー処理を設定します -- 常にこのようにしておきましょう! $svnstack = &PEAR_ErrorStack::singleton('VersionControl_SVN'); // 実行時オプションを設定します $options = array('fetchmode' => VERSIONCONTROL_SVN_FETCHMODE_ARRAY, 'svn_path' => "svn"); // list クラスをファクトリに要求します $svn = VersionControl_SVN::factory('list', $options); // 必要なスイッチや引数を定義します $switches = array('username' => '', 'password' => ''); $args = array('file://localhost/C:/home/repos/codegolf'); // コマンドを実行します if ($output = $svn->run($args, $switches)) { print_r($output); } else { if (count($errs = $svnstack->getErrors())) { foreach ($errs as $err) { echo '<br />'.$err['message']."<br />\n"; echo "Command used: " . $err['params']['cmd']; } } } ?>
実行結果
Array ( [0] => Array ( [type] => F [name] => beer.php ) [1] => Array ( [type] => F [name] => beer2.php ) [2] => Array ( [type] => F [name] => beer3.php ) [3] => Array ( [type] => F [name] => beer4.php ) [4] => Array ( [type] => F [name] => beer5.php ) [5] => Array ( [type] => F [name] => beer6.php ) [6] => Array ( [type] => F [name] => cal.php ) [7] => Array ( [type] => F [name] => cals.hs ) )
私にイラッとしないでくださいねー 笑
私もイラッとしていますよーー