Beispiel #1
0
 /**
  * 全てのキャッシュをクリア
  *
  * @param bool $showMessage メッセージ表示?
  *
  * @return void
  */
 public static function clearAllCache($showMessage = false)
 {
     $app = BEAR::get('app');
     if ($app['core']['debug'] !== true) {
         return;
     }
     BEAR::factory('BEAR_Dev_Shell')->clearCache();
     if ($showMessage) {
         Panda::message('Cache Clear', '全てのキャッシュファイルとキャッシュメモリをクリアしました');
     }
 }
Beispiel #2
0
<?php

require 'Panda.php';
$file = isset($_GET['file']) ? $_GET['file'] : false;
$line = isset($_GET['line']) ? $_GET['line'] : 0;
if (!is_readable($file)) {
    Panda::message('404 Not found', "[{$file}] is not readable.");
    exit;
}
// set variable for view
$view = array();
$view['file_path'] = $file;
$view['line'] = $line;
$view['file_contents'] = file_get_contents($file);
$id = md5($file);
$view['mod_date'] = date(DATE_RFC822, filemtime($file));
$view['owner_info'] = function_exists('posix_getpwuid') ? posix_getpwuid(fileowner($file)) : array('name' => 'n/a');
$fileperms = substr(decoct(fileperms($file)), 2);
$view['is_writable'] = is_writable($file);
$view['is_writable_label'] = $view['is_writable'] ? "" : " Read Only";
$view['auth'] = md5(session_id() . $id);
// render
include 'view.php';
        $infoDir .= '<h3>bearコマンド(CLI)のアプリケーションホーム設定</h3>';
        $infoDir .= '<div><code>bear set-app ' . _BEAR_APP_HOME . ';</code></div>';
        $infoDir .= '<h3>オンラインエディタの設定</h3>';
        $infoDir .= '<div><code>sudo ln -s ' . _BEAR_BEAR_HOME . '/data/htdocs/__edit ';
        $infoDir .= _BEAR_APP_HOME . '/htdocs; </code></div>';
        $infoDir .= '<p>※保存するためには対象ファイルのパーミッションを変更する必要があります</p>';
        $subHeading = 'このコードをシェルで実行してください';
        Panda::message('開発環境のセットアップ', $subHeading, $infoDir);
        $exit = true;
    } elseif (isset($_GET['_beardebug_query'])) {
        $subHeading = 'デバックモードでクエリーによるデバッグコマンドが使えます';
        $infoDir = '<h3>キャッシュクリア</h3>';
        $infoDir .= '<div><p>?_cc</p></div>';
        $infoDir .= '<h3>リソースデバック</h3>';
        $infoDir .= '<div><p>?_resource</p></div>';
        $infoDir .= '<h3>全てのエラー表示</h3>';
        $infoDir .= '<div><p>?_error</p></div>';
        $infoDir .= '<h3>改行を表示するためのpreタグ表示</h3>';
        $infoDir .= '<div><p>?_pre</p></div>';
        $infoDir .= '<h3>firePHPログ</h3>';
        $infoDir .= '<div><p>?_firelog</p></div>';
        $infoDir .= '<div>スクリプト最後に発生したエラーメッセージを表示します。</div>';
        $infoDir .= '<h3>Pandaエラーハンドラーoff</h3>';
        $infoDir .= '<div><p>?_nopanda</p></div>';
        $infoDir .= '<div> ※エラーメッセージが表示されないときなど</div>';
        $infoDir .= '<h3>プロファイリング</h3>';
        $infoDir .= '<div><p>?_prof</p></div><div> ※xdebug, xhprofの機能拡張とApp.phpでApp/prof.phpの読み込みが必要です</div>';
        Panda::message('デバック用クエリー', $subHeading, $infoDir);
        $exit = true;
    }
}