• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Build类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Build的典型用法代码示例。如果您正苦于以下问题:PHP Build类的具体用法?PHP Build怎么用?PHP Build使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Build类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: installMods

		function installMods($mods)
		{
			global $config, $db, $user, $auth, $template, $cache;
			global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
			
			$res = $db->sql_query(
				'SELECT style_name FROM ' . $table_prefix 
				. 'styles WHERE style_id = ' . $config['default_style']
			);
			$this->style = $db->sql_fetchfield('style_name');
			$build = Build::create();
			foreach ($mods as $modName)
				$build->addMod(Mod::create()->setName($modName));
			try {
				$deps = $build->getDependences('style');
			} catch (Exception $e) {
				return null;
			}			
			
			if ($deps && !in_array($this->style, $deps)) {
				return $build;
			} else {
				try {
					InstallAction::me()->setBuild($build)->run();
					file_put_contents(
						USER_DIR . DIRECTORY_SEPARATOR . '.htaccess',
						str_replace(
							$this->build->getHash(),
							$build->getHash(),
							file_get_contents(
								USER_DIR . DIRECTORY_SEPARATOR . '.htaccess'
							)
						)
					);
					
					file_put_contents(
						USER_DIR . DIRECTORY_SEPARATOR . 'nginx.rewrite',
						str_replace(
							$this->build->getHash(),
							$build->getHash(),
							file_get_contents(
								USER_DIR . DIRECTORY_SEPARATOR . 'nginx.rewrite'
							)
						)
					);
				} catch (Exception $e) {
					trigger_error($e->getMessage(),E_USER_WARNING);
				}
			}
			return $this;
		}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:51,代码来源:acp_mods.php


示例17: scheduleBuilders

/**
 * @brief Schedules builders discovered in @p dir directory.
 *
 * @param buildset Parent buildset for newly created builds.
 * @param dir Directory to look for builders.
 * @param suffix Additional suffix for builders path (appended to @p dir).
 *
 * @returns Array of scheduler builder names.
 */
function scheduleBuilders($buildset, $dir, $suffix)
{
    $builders = [];
    $basePath = "{$dir}/{$suffix}";
    if (is_dir($basePath) && ($handle = opendir($basePath))) {
        while (($entry = readdir($handle)) !== false) {
            $path = "{$basePath}/{$entry}";
            if (!is_dir($path) && $entry != '.' && $entry != '..') {
                $builderName = "{$suffix}{$entry}";
                Build::create($buildset, $builderName);
                array_push($builders, $builderName);
            }
        }
        closedir($handle);
    }
    return $builders;
}
开发者ID:xaizek,项目名称:fragile,代码行数:26,代码来源:new.php


示例18: buildAppServerDir

 private static function buildAppServerDir($serverName)
 {
     // 没有创建的话自动创建
     if (!is_dir(DI_APP_PATH)) {
         mkdir(DI_APP_PATH, 0755, true);
     }
     if (is_writeable(DI_APP_PATH)) {
         Build::makeDirs();
         //生成基础目录
         Build::makeConfigs();
         //生成基础配置文件
         Build::makeFunctions();
         //生成基础函数文件
         Build::makeReloadHelper($serverName);
         //生成基础热重载类。
     } else {
         exit("应用目录[' . DI_APP_PATH . ']不可写,目录无法自动生成!\n请手动生成项目目录~");
     }
 }
开发者ID:weijer,项目名称:DIServer,代码行数:19,代码来源:Build.php


示例19: array

 // 实例化对象
 private static $_instance = array();
 /**
  * 应用程序初始化
  * @access public
  * @return void
  */
 public static function start()
 {
     // 注册AUTOLOAD方法
     spl_autoload_register('Think\\Think::autoload');
     // 设定错误和异常处理
     register_shutdown_function('Think\\Think::fatalError');
     set_error_handler('Think\\Think::appError');
     set_exception_handler('Think\\Think::appException');
     // 初始化文件存储方式
     Storage::connect(STORAGE_TYPE);
     $runtimefile = RUNTIME_PATH . APP_MODE . '~runtime.php';
     if (!APP_DEBUG && Storage::has($runtimefile)) {
         Storage::load($runtimefile);
     } else {
         if (Storage::has($runtimefile)) {
             Storage::unlink($runtimefile);
         }
         $content = '';
         // 读取应用模式
         $mode = (include is_file(CONF_PATH . 'core.php') ? CONF_PATH . 'core.php' : MODE_PATH . APP_MODE . '.php');
         // 加载核心文件
         foreach ($mode['core'] as $file) {
             if (is_file($file)) {
                 include $file;
                 if (!APP_DEBUG) {
                     $content .= compile($file);
                 }
             }
         }
         // 加载应用模式配置文件
         foreach ($mode['config'] as $key => $file) {
             is_numeric($key) ? C(load_config($file)) : C($key, load_config($file));
         }
         // 读取当前应用模式对应的配置文件
         if ('common' != APP_MODE && is_file(CONF_PATH . 'config_' . APP_MODE . CONF_EXT)) {
             C(load_config(CONF_PATH . 'config_' . APP_MODE . CONF_EXT));
         }
         // 加载模式别名定义
         if (isset($mode['alias'])) {
             self::addMap(is_array($mode['alias']) ? $mode['alias'] : (include $mode['alias']));
         }
         // 加载应用别名定义文件
         if (is_file(CONF_PATH . 'alias.php')) {
             self::addMap(include CONF_PATH . 'alias.php');
         }
         // 加载模式行为定义
         if (isset($mode['tags'])) {
             Hook::import(is_array($mode['tags']) ? $mode['tags'] : (include $mode['tags']));
         }
         // 加载应用行为定义
         if (is_file(CONF_PATH . 'tags.php')) {
             // 允许应用增加开发模式配置定义
             Hook::import(include CONF_PATH . 'tags.php');
         }
         // 加载框架底层语言包
         L(include THINK_PATH . 'Lang/' . strtolower(C('DEFAULT_LANG')) . '.php');
         if (!APP_DEBUG) {
             $content .= "\nnamespace { Think\\Think::addMap(" . var_export(self::$_map, true) . ");";
             $content .= "\nL(" . var_export(L(), true) . ");\nC(" . var_export(C(), true) . ');Think\\Hook::import(' . var_export(Hook::get(), true) . ');}';
             Storage::put($runtimefile, strip_whitespace('<?php ' . $content));
         } else {
             // 调试模式加载系统默认的配置文件
             C(include THINK_PATH . 'Conf/debug.php');
             // 读取应用调试配置文件
             if (is_file(CONF_PATH . 'debug' . CONF_EXT)) {
                 C(include CONF_PATH . 'debug' . CONF_EXT);
             }
         }
     }
     // 读取当前应用状态对应的配置文件
     if (APP_STATUS && is_file(CONF_PATH . APP_STATUS . CONF_EXT)) {
         C(include CONF_PATH . APP_STATUS . CONF_EXT);
     }
     // 设置系统时区
     date_default_timezone_set(C('DEFAULT_TIMEZONE'));
     // 检查应用目录结构 如果不存在则自动创建
     if (C('CHECK_APP_DIR')) {
         $module = defined('BIND_MODULE') ? BIND_MODULE : C('DEFAULT_MODULE');
         if (!is_dir(APP_PATH . $module) || !is_dir(LOG_PATH)) {
             // 检测应用目录结构
             Build::checkDir($module);
         }
开发者ID:TedaLIEz,项目名称:AUNET,代码行数:89,代码来源:Think.class.php


示例20: register_shutdown_function

// 加载基础文件
require __DIR__ . '/base.php';
require CORE_PATH . 'Loader.php';
// 注册自动加载
Loader::register();
// 注册错误和异常处理机制
register_shutdown_function('think\\Error::appShutdown');
set_error_handler('think\\Error::appError');
set_exception_handler('think\\Error::appException');
// 加载模式定义文件
$mode = (require MODE_PATH . APP_MODE . EXT);
// 加载模式别名定义
if (isset($mode['alias'])) {
    Loader::addMap(is_array($mode['alias']) ? $mode['alias'] : (include $mode['alias']));
}
// 加载模式配置文件
if (isset($mode['config'])) {
    is_array($mode['config']) ? Config::set($mode['config']) : Config::load($mode['config']);
}
// 加载模式行为定义
if (APP_HOOK && isset($mode['tags'])) {
    Hook::import(is_array($mode['tags']) ? $mode['tags'] : (include $mode['tags']));
}
// 自动生成
if (APP_AUTO_BUILD && is_file(APP_PATH . 'build.php')) {
    Build::run(include APP_PATH . 'build.php');
}
// 是否自动运行
if (APP_AUTO_RUN) {
    App::run();
}
开发者ID:jiehuilong,项目名称:think,代码行数:31,代码来源:start.php



注:本文中的Build类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BuildEvent类代码示例发布时间:2022-05-23
下一篇:
PHP BufferedReader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap