當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Build類代碼示例

本文整理匯總了PHP中Build的典型用法代碼示例。如果您正苦於以下問題:PHP Build類的具體用法?PHP Build怎麽用?PHP Build使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Build類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete

function delete($details)
{
    $conn = new Connection("auto");
    $query = new Build();
    $result = $query->delete($conn->grab_conn(), $details, "close");
    return $result;
}
開發者ID:hazbo2,項目名稱:Outglow,代碼行數:7,代碼來源:omod_index.php

示例2: testBuildReplaceExampleProject

 public function testBuildReplaceExampleProject()
 {
     $build = new Build();
     $build->build(__DIR__ . '/../_fixtures/example-replace');
     $bazNamespaces = (include __DIR__ . '/../_fixtures/example-replace/baz/vendor/composer/autoload_namespaces.php');
     $this->assertCount(2, $bazNamespaces);
     $this->assertEquals(array('Baz\\', 'Bar\\'), array_keys($bazNamespaces));
 }
開發者ID:sidisinsane,項目名稱:fiddler,代碼行數:8,代碼來源:BuildTest.php

示例3: deregister

 public function deregister(Build $build)
 {
     $file = $this->baseDir . DIRECTORY_SEPARATOR . $build->getName();
     if (file_exists($file)) {
         unlink($file);
         return true;
     }
     return false;
 }
開發者ID:phpbrew,項目名稱:phpbrew,代碼行數:9,代碼來源:BuildRegister.php

示例4: testBuildGetDate

 public function testBuildGetDate()
 {
     $retval = 0;
     $build = new Build();
     $build->Id = 1;
     $build->ProjectId = 1;
     $build->Filled = true;
     $row = pdo_single_row_query('SELECT nightlytime FROM project WHERE id=1');
     $original_nightlytime = $row['nightlytime'];
     // Test the case where the project's start time is in the evening.
     pdo_query("UPDATE project SET nightlytime = '20:00:00' WHERE id=1");
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 19:59:59'));
     $expected_date = '2009-02-23';
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Evening case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 20:00:00'));
     $expected_date = '2009-02-24';
     $build->NightlyStartTime = false;
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Evening case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     // Test the case where the project's start time is in the morning.
     pdo_query("UPDATE project SET nightlytime = '09:00:00' WHERE id=1");
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 08:59:59'));
     $expected_date = '2009-02-22';
     $build->NightlyStartTime = false;
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Morning case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 09:00:00'));
     $expected_date = '2009-02-23';
     $build->NightlyStartTime = false;
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Morning case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     pdo_query("UPDATE project SET nightlytime = '{$original_nightlytime}' WHERE id=1");
     if ($retval === 0) {
         $this->pass('Tests passed');
     }
     return $retval;
 }
開發者ID:kitware,項目名稱:cdash,代碼行數:50,代碼來源:test_buildgetdate.php

示例5: saveConfig

 public function saveConfig()
 {
     //       C('URL_MODEL',2);
     //動態生成控製器類/模型類
     Build::buildController('Home', 'UserDisplay');
     Build::buildModel('User', 'UserDisplay');
 }
開發者ID:tamchinglol,項目名稱:gitproject2,代碼行數:7,代碼來源:IndexController.class.php

示例6: testBuildDeletePost

 public function testBuildDeletePost()
 {
     $build = Build::find(2);
     $data = array('confirm-delete' => '1');
     $response = $this->call('POST', '/modpack/build/' . $build->id . '?action=delete', $data);
     $this->assertRedirectedTo('modpack/view/' . $build->modpack->id);
 }
開發者ID:NorthPL,項目名稱:Solder-for-NorthLauncher,代碼行數:7,代碼來源:BuildTest.php

示例7: inbetweenBuilds

 static function inbetweenBuilds($regression)
 {
     $build = $regression->build();
     $run = $build->run();
     $mode_id = $build->mode_id();
     $machine_id = $run->machine_id();
     $sortOrder = $run->sort_order();
     $prevSortOrder = $regression->prev_build()->run()->sort_order();
     $builds = array();
     for ($i = $prevSortOrder + 1; $i < $sortOrder; $i++) {
         $run_i = Run::withMachineAndSortOrder($machine_id, $i);
         if (!$run_i->isFinished()) {
             continue;
         }
         $build = Build::withRunAndMode($run_i->id, $mode_id);
         if (!$build) {
             continue;
         }
         if (count($build->scores()) == 0) {
             continue;
         }
         $builds[] = $build;
     }
     return $builds;
 }
開發者ID:stoklund,項目名稱:arewefastyet,代碼行數:25,代碼來源:RegressionTools.php

示例8: start

 public static function start()
 {
     //注冊自動加載類函數
     spl_autoload_register('self::autoload');
     //導入公用的函數
     include THINK_PATH . 'Common/functions.php';
     //導入通用的function函數
     if (is_file(COMMON_PATH . 'Common/function.php')) {
         include COMMON_PATH . 'Common/function.php';
     }
     //導入通用的配置文件
     C(include THINK_PATH . 'Conf/convention.php');
     // 設置係統時區
     date_default_timezone_set(C('DEFAULT_TIMEZONE'));
     // 檢查應用目錄結構 如果不存在則自動創建
     if (C('CHECK_APP_DIR')) {
         if (!is_dir(LOG_PATH)) {
             // 檢測應用目錄結構
             Build::checkDir();
         }
     }
     // 定義當前請求的係統常量
     define('NOW_TIME', $_SERVER['REQUEST_TIME']);
     define('REQUEST_METHOD', $_SERVER['REQUEST_METHOD']);
     define('IS_GET', REQUEST_METHOD == 'GET' ? true : false);
     define('IS_POST', REQUEST_METHOD == 'POST' ? true : false);
     //路由解析
     self::dispatch();
     define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' || !empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')]) ? true : false);
     //初始化session
     session(C('SESSION_OPTIONS'));
     //執行應用程序
     self::exec();
 }
開發者ID:xs5816,項目名稱:mictp,代碼行數:34,代碼來源:Think.class.php

示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('modpacks')->delete();
     $testmodpack = Modpack::create(array('name' => 'TestModpack', 'slug' => 'testmodpack', 'icon' => false, 'icon_md5' => md5_file(public_path() . '/resources/default/icon.png'), 'icon_url' => URL::asset('/resources/default/icon.png'), 'logo' => false, 'logo_md5' => md5_file(public_path() . '/resources/default/logo.png'), 'logo_url' => URL::asset('/resources/default/logo.png'), 'background' => false, 'background_md5' => md5_file(public_path() . '/resources/default/background.jpg'), 'background_url' => URL::asset('/resources/default/background.jpg')));
     DB::table('builds')->delete();
     $testbuild = Build::create(array('modpack_id' => $testmodpack->id, 'version' => '1.0.0', 'minecraft' => '1.7.10', 'minecraft_md5' => 'e6b7a531b95d0c172acb704d1f54d1b3', 'min_java' => '1.7', 'min_memory' => '1024', 'is_published' => true));
 }
開發者ID:NorthPL,項目名稱:Solder-for-NorthLauncher,代碼行數:12,代碼來源:ModpackTableTestSeeder.php

示例10: findSortOrder

 private static function findSortOrder($run, $mode_id, $revision)
 {
     $version_control = VersionControl::forMode($mode_id);
     $j = 0;
     while (True) {
         if ($j++ > 30) {
             throw new Exception("There shouldn't be too many runs in between");
         }
         if (!$run->isBuildInfoComplete()) {
             throw new Exception("Encountered an incomplete run.");
         }
         $build = Build::withRunAndMode($run->id, $mode_id);
         // We can safely ignore runs that have no results with the requested mode_id
         if (!$build) {
             $run = $run->next();
             continue;
         }
         // We skip to the next run, if revisions are the same.
         // To make sure that new runs are shown after existing ones.
         if ($version_control->equal($build->revision(), $revision)) {
             $run = $run->next();
             continue;
         }
         // Using version control take a peek if the revision
         // is later/earlier than this one.
         if ($version_control->isAfter($build->revision(), $revision)) {
             return $run->sort_order();
         }
         $run = $run->next();
     }
 }
開發者ID:stoklund,項目名稱:arewefastyet,代碼行數:31,代碼來源:RunReporter.php

示例11: getIndex

 public function getIndex()
 {
     $builds = Build::where('is_published', '=', '1')->orderBy('updated_at', 'desc')->take(5)->get();
     $modversions = Modversion::whereNotNull('md5')->orderBy('updated_at', 'desc')->take(5)->get();
     $rawChangeLog = UpdateUtils::getLatestChangeLog();
     $changelogJson = array_key_exists('error', $rawChangeLog) ? $rawChangeLog : array_slice($rawChangeLog, 0, 10);
     return View::make('dashboard.index')->with('modversions', $modversions)->with('builds', $builds)->with('changelog', $changelogJson);
 }
開發者ID:jensz12,項目名稱:TechnicSolder,代碼行數:8,代碼來源:DashboardController.php

示例12: up

 /**
  * Make changes to the database.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('builds', function ($table) {
         $table->string('minecraft_md5')->default('');
     });
     $minecraft = MinecraftUtils::getMinecraft(true);
     foreach (Build::all() as $build) {
         $build->minecraft_md5 = $minecraft[$build->minecraft]->md5;
         $build->save();
     }
 }
開發者ID:NorthPL,項目名稱:Solder-for-NorthLauncher,代碼行數:16,代碼來源:2013_03_13_200706_update_builds_md5.php

示例13: up

 /**
  * Make changes to the database.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('builds', function ($table) {
         $table->string('minecraft_md5');
     });
     $minecraft = $this->getMinecraft();
     $minecraft = (array) $minecraft;
     foreach (Build::all() as $build) {
         $build->minecraft_md5 = $minecraft[$build->minecraft]->md5;
         $build->save();
     }
 }
開發者ID:kreezxil,項目名稱:TechnicSolder,代碼行數:17,代碼來源:2013_03_13_200706_update_builds_md5.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     //$this->call('UserTableSeeder');
     $this->call('ModpackTableTestSeeder');
     $this->call('ModTableTestSeeder');
     $this->call('ClientTableTestSeeder');
     $this->call('KeyTableTestSeeder');
     DB::table('build_modversion')->delete();
     $testbuild = Build::find(1);
     //Add testmodversion to testbuild
     $testbuild->modversions()->attach(1);
 }
開發者ID:GoatEli,項目名稱:TechnicSolder,代碼行數:18,代碼來源:TestSeeder.php

示例15: start

 public static function start()
 {
     //注冊AUTOLOAD方法
     spl_autoload_register('\\Core\\HF::autoload');
     //自動生成目錄
     Build::checkDir();
     //加載項目下配置文件
     if (is_file(CONF_PATH . 'config.php')) {
         C(include CONF_PATH . 'config.php');
     }
     //運行應用
     App::run();
 }
開發者ID:hanfengtianyasmile,項目名稱:hfphp2.0,代碼行數:13,代碼來源:HF.class.php


注:本文中的Build類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。