예제 #1
0
<?php

/**
 * Create table
 * @param string $model 
 * @param boolean $drop 
 */
$model_list = [];
if (empty($model)) {
    foreach (\ebi\Dt::classes(\ebi\Dao::class) as $class_info) {
        $model_list[] = \ebi\Util::get_class_name($class_info['class']);
    }
} else {
    $model_list[] = \ebi\Util::get_class_name($model);
}
foreach ($model_list as $m) {
    if ($drop === true) {
        call_user_func([$m, 'drop_table']);
        \cmdman\Std::println('dropped ' . $m);
    }
    call_user_func([$m, 'create_table']);
    \cmdman\Std::println('created ' . $m);
}
예제 #2
0
<?php

\ebi\Conf::set(\ebi\Db::class, 'autocommit', true);
\testman\Conf::set('urls', \ebi\Dt::get_urls());
\testman\Conf::set('ssl-verify', false);
\testman\Conf::set('coverage-dir', dirname(__DIR__) . '/lib');
예제 #3
0
파일: Dt.php 프로젝트: tokushima/ebi
 /**
  * テーブルを削除後作成する
  */
 public static function reset_tables()
 {
     foreach (\ebi\Dt::classes(\ebi\Dao::class) as $class_info) {
         $class = \ebi\Util::get_class_name($class_info['class']);
         call_user_func([$class, 'drop_table']);
         call_user_func([$class, 'create_table']);
     }
 }
예제 #4
0
파일: send.php 프로젝트: tokushima/ebi
<?php

$vars = ['abc' => 'ABC'];
$mail = new \ebi\Mail();
$mail->to("*****@*****.**");
$mail->send_template('send.xml', $vars);
$xml = \ebi\Dt::find_mail('*****@*****.**');
eq(<<<__DATA
123ABC456

=======================
 Signature
  tokushima
=======================

__DATA
, $xml->message());
eq('テストサブジェクト', $xml->subject());
$vars = ['abc' => 'ABC'];
$mail = new \ebi\Mail();
$mail->to("*****@*****.**");
$mail->send_template('send_html.xml', $vars);
$xml = \ebi\Dt::find_mail('*****@*****.**');
eq('123ABC456' . "\n", $xml->message());
eq('テストサブジェクト', $xml->subject());
meq('Content-Type: text/html;', $xml->manuscript());
meq('<p class="abc">ピーボディー</p>', mb_convert_encoding($xml->manuscript(), 'UTF8', 'JIS'));
meq('send_html.css', mb_convert_encoding($xml->manuscript(), 'UTF8', 'JIS'));