本文整理汇总了PHP中Requirement类的典型用法代码示例。如果您正苦于以下问题:PHP Requirement类的具体用法?PHP Requirement怎么用?PHP Requirement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Requirement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testRequirementSuccess
public function testRequirementSuccess()
{
$requirement = new Requirement();
$requirement->protocol_id = 1;
$requirement->family = "user";
$requirement->parameter_id = 1;
$this->assertTrue($requirement->save());
}
开发者ID:philtweir,项目名称:glossia-scratch-test-site,代码行数:8,代码来源:RequirementTest.php
示例2: get_error_message
function get_error_message(Requirement $requirement, $lineSize)
{
if ($requirement->isFulfilled()) {
return;
}
$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL . ' ') . PHP_EOL;
$errorMessage .= ' > ' . wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL . ' > ') . PHP_EOL;
return $errorMessage;
}
开发者ID:Dren-x,项目名称:mobit,代码行数:9,代码来源:check.php
示例3: req_row
function req_row(Requirement $req, $indentation, TableCreator $table_creator)
{
$req->with('validationTest', 'requirements');
$ret = "";
$ret .= $table_creator->row(array($table_creator->child_indentation($indentation), $req->public_id(), $req->validationTest == null ? '' : $req->validationTest->public_id()));
$nested = $req->requirements;
foreach ($nested as $c) {
$ret .= req_row($c, $indentation + 1, $table_creator);
}
return $ret;
}
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:11,代码来源:requirement_validation.php
示例4: test_row
function test_row(Requirement $req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
$test = $req->with('system_test')->system_test;
$ret = "";
if (isset($req->system_test) && (!is_numeric($filter_cat) || $req->category == $filter_cat) && (!is_numeric($filter_pri) || $req->priority == $filter_pri)) {
$test->with('test');
$ret .= $table_creator->row(array($test->public_id(), $test->test->description, 'success', $table_creator->anchor($req->public_id(), $req->public_id())));
}
$nested = $req->with('requirements')->requirements;
foreach ($nested as $nreq) {
$ret .= test_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
}
return $ret;
}
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:14,代码来源:system_test.php
示例5: test_row
function test_row(Requirement $req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
$test = $req->with('system_test')->system_test;
$validation = $req->with('validation0')->validation0;
$ret = "";
$rv = '';
if (isset($test)) {
$rv = $test->public_id();
} else {
if (isset($validation)) {
$rv = $validation->name;
}
}
$ret .= $table_creator->row(array($table_creator->child_indentation($indentation), $req->public_id(), $rv));
$nested = $req->with('requirements')->requirements;
foreach ($nested as $nreq) {
$ret .= test_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
}
return $ret;
}
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:20,代码来源:requirement_test.php
示例6: echo_requirement
/**
* Prints a Requirement instance
*/
private function echo_requirement(\Requirement $requirement)
{
$result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
$data = '';
switch (rtrim(ltrim(str_pad($result, 9)))) {
case 'OK':
$data .= '<tr class="success">';
break;
case 'WARNING':
$data .= '<tr class="warning">';
break;
case 'ERROR':
$data .= '<tr class="danger">';
break;
default:
$data .= '<tr>';
break;
}
$data .= '<td>' . str_pad($result, 9) . '</td>';
$data .= '<td>' . $requirement->getTestMessage() . "</td>";
if (!$requirement->isFulfilled()) {
$data .= '<td>' . $requirement->getHelpText() . '</td>';
}
$data .= '</tr>';
return $data;
}
开发者ID:hasantayyar,项目名称:ojs,代码行数:29,代码来源:CheckController.php
示例7: alter
public function alter()
{
if (!isset($_SESSION['logged'])) {
return call('pages', 'home');
} else {
if (!isset($_GET['code'])) {
return call('pages', 'error', 2);
}
$sources = Sources::all();
$requirement = Requirement::get($_GET['code']);
require_once 'views/requirements/alter.php';
}
}
开发者ID:ScalateKids,项目名称:Scalatetrack,代码行数:13,代码来源:requirements_controller.php
示例8: echo_requirement
/**
* Prints a Requirement instance
*/
function echo_requirement(Requirement $requirement)
{
$result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
echo ' ' . str_pad($result, 9);
echo $requirement->getTestMessage() . "\n";
if (!$requirement->isFulfilled()) {
echo sprintf(" %s\n\n", $requirement->getHelpText());
}
}
开发者ID:TuxCoffeeCorner,项目名称:tcc,代码行数:12,代码来源:check.php
示例9: save
public function save()
{
// yo thau ma requirement save huna aaucha
// yei bata feri "index.php" ma falne jun chai profile ma jancha
$req = new Requirement();
if (isset($_POST['title'])) {
$req->setTitle($_POST['title']);
} else {
$req->setTitle("");
}
if (isset($_POST['date'])) {
$req->setDate($_POST['date']);
} else {
$req->setDate("01-01-2001");
}
if (isset($_POST['details'])) {
$req->setDescription($_POST['details']);
} else {
$req->setDescription("");
}
$req->setStatus(1);
$req->setOrgname("");
$this->requirement_repository->insert($req);
}
开发者ID:pratishshr,项目名称:Aawaaj,代码行数:24,代码来源:RequirementController.php
示例10: download_tex
public function download_tex()
{
if (!isset($_SESSION['logged'])) {
$this->login();
} else {
$rs = Requirement::reqSources();
$sr = Requirement::sourcesReq();
$frq = Requirement::functionalRequirements();
$tex = "\\section{Requisiti funzionali}<br>\n \\begin{longtable}[H]{|l|p{2cm}|p{6cm}|p{4cm}|}<br>\n \\hline<br>\n \\textbf{Requisito} & \\textbf{Tipologia} & \\textbf{Descrizione} & \\textbf{Fonti}\\\\<br>\n \\hline<br>";
foreach ($frq as $funcReq) {
if ($funcReq->getType() == 'F') {
$type = 'Funzionale';
} elseif ($funcReq->getType() == 'T') {
$type = 'Tecnologico';
} elseif ($funcReq->getType() == 'Q') {
$type = 'Qualitativo';
} elseif ($funcReq->getType() == 'B') {
$type = 'Vincolo';
}
$tex .= $funcReq->getCode() . " & \\multiLineCell{" . $type . "\\\\" . $funcReq->getPriority() . "} & " . $funcReq->getDescription() . " & \\multiLineCell{";
foreach ($funcReq->getSources() as $sources) {
$tex .= $sources->getName() . "\\\\";
}
$tex .= "}\\\\<br>\n \\hline<br>";
}
$tex .= "\\end{longtable}<br>";
$tex .= "\\section{Tracciamento Requisiti-Fonti}<br>\n \\begin{longtable}[H]{|p{5.5cm}|p{5.5cm}|}<br>\n \\hline<br>\n \\textbf{Requisito} & \\textbf{Fonti}\\\\<br>\n \\hline<br>";
foreach ($rs as $key => $val) {
$tex .= $key . " & \\multiLineCell[t]{";
foreach ($val as $v) {
$tex .= $v . "\\\\";
}
$tex .= "}\\\\<br>\n \\hline<br>";
}
$tex .= "\\end{longtable}<br>\n \\section{Tracciamento Fonti-Requisiti}<br>\n \\begin{longtable}[H]{|p{5.5cm}|p{5.5cm}|}<br>\n \\hline<br>\n \\textbf{Fonte} & \\textbf{Requisiti}\\\\<br>\n \\hline<br>";
foreach ($sr as $key => $val) {
$tex .= $key . " & \\multiLineCell[t]{";
foreach ($val as $v) {
$tex .= $v . "\\\\";
}
$tex .= "}\\\\<br>\n \\hline<br>";
}
$tex .= "\\end{longtable}<br>";
require_once 'views/pages/output.php';
}
}
开发者ID:ScalateKids,项目名称:Scalatetrack,代码行数:46,代码来源:pages_controller.php
示例11: requirement_row
function requirement_row($req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
$ret = "";
if ((!is_numeric($filter_cat) || $req->category == $filter_cat) && (!is_numeric($filter_pri) || $req->priority == $filter_pri)) {
$pkg_name = array();
foreach ($req->classes as $c) {
array_push($pkg_name, $table_creator->link($c->full_name(), $c->name));
}
array_unique($pkg_name);
sort($pkg_name);
$cells = array($table_creator->child_indentation($indentation), $table_creator->link($req->public_id(), $req->public_id()), implode("\n\n", $pkg_name));
$ret .= $table_creator->row($cells);
}
$nested = Requirement::model()->with('classes')->findAll("t.parent=:parent", array(':parent' => $req->id_requirement));
foreach ($nested as $nreq) {
$ret .= requirement_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
}
return $ret;
}
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:19,代码来源:requirement_class.php
示例12: __construct
/**
* Constructor that initializes the requirement.
*
* @param string $cfgName The configuration name used for ini_get()
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
*/
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
{
$cfgValue = ini_get($cfgName);
if (is_callable($evaluation)) {
if (null === $testMessage || null === $helpHtml) {
throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
}
$fulfilled = call_user_func($evaluation, $cfgValue);
} else {
if (null === $testMessage) {
$testMessage = sprintf('%s %s be %s in php.ini', $cfgName, $optional ? 'should' : 'must', $evaluation ? 'enabled' : 'disabled');
}
if (null === $helpHtml) {
$helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.', $cfgName, $evaluation ? 'on' : 'off');
}
$fulfilled = $evaluation == $cfgValue;
}
parent::__construct($fulfilled || $approveCfgAbsence && false === $cfgValue, $testMessage, $helpHtml, $helpText, $optional);
}
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:33,代码来源:PhpIniRequirement.php
示例13: actionRequirementHandle
public function actionRequirementHandle()
{
if (parent::_ajax_acl('evaluate_update')) {
$id = Yii::app()->request->getPost('id');
$requirement = Requirement::model()->findByPk($id);
if (!empty($requirement)) {
$requirement->status = 1;
if ($requirement->save()) {
AdminLogger::_create(array('catalog' => 'update', 'intro' => '更新学区专栏房源需求处理状态,ID:' . $requirement->id));
echo CJSON::encode(array('success' => true, 'msg' => '需求处理成功'));
} else {
echo CJSON::encode(array('success' => false, 'msg' => '操作失败,请联系管理员'));
}
} else {
echo CJSON::encode(array('success' => false, 'msg' => '此需求不存在'));
}
} else {
echo CJSON::encode(array('success' => false, 'msg' => '当前角色组无权限进行此操作,请联系管理员授权'));
}
}
开发者ID:zywh,项目名称:maplecity,代码行数:20,代码来源:RequirementController.php
示例14: requirement_row
function requirement_row($req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
$ret = "";
if ((!is_numeric($filter_cat) || $req->category == $filter_cat) && (!is_numeric($filter_pri) || $req->priority == $filter_pri)) {
$source_desc = array();
foreach ($req->sources as $rc) {
$rc->with('useCase', 'externalSource');
if (isset($rc->useCase)) {
array_push($source_desc, $table_creator->link($rc->useCase->public_id(), $rc->useCase->public_id()));
} else {
array_push($source_desc, $rc->externalSource->description);
}
}
sort($source_desc);
$cells = array($table_creator->child_indentation($indentation), $table_creator->anchor($req->public_id(), $req->public_id()), $req->category0->name . "\n\n" . $req->priority0->name, $req->description, implode("\n\n", $source_desc));
$ret .= $table_creator->row($cells);
}
$nested = Requirement::model()->with('sources', 'category0', 'priority0')->findAll("t.parent=:parent", array(':parent' => $req->id_requirement));
foreach ($nested as $nreq) {
$ret .= requirement_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
}
return $ret;
}
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:23,代码来源:requirement_source.php
示例15: __construct
/**
* @return WebRootExposedFolderRequirement
*/
public function __construct()
{
parent::__construct(Craft::t('Sensitive Craft folders should not be publicly accessible'), null, false, '<a href="http://craftcms.com">Craft CMS</a>');
}
开发者ID:andyra,项目名称:tes,代码行数:7,代码来源:Requirements.php
示例16: loadModel
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer the ID of the model to be loaded
*/
public function loadModel($id)
{
$model = Requirement::model()->findByPk($id);
$model->with('category0', 'priority0', 'parent0', 'sources', 'validation0', 'system_test');
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:14,代码来源:RequirementController.php
示例17:
<?php
/// @warning HARD CODED DB PK!!!!!!!!!!!
$reqs = Requirement::model()->findAll("category != 4 and priority != 4");
$table = $table_creator->begin_table("|m{3cm}|m{6cm}|m{4cm}|") . $table_creator->heading_row(array("Id", "Descrizione", "Implementazione"));
foreach ($reqs as $r) {
$id = $r->public_id();
$app = $r->apported;
$strapp = "";
if ($app) {
$strapp = "\\color{dkgreen}{Implementato}";
} else {
$strapp = "\\color{dkred}{Non implementato}";
}
$table .= $table_creator->row(array($id, $r->description, $strapp));
}
$table .= $table_creator->caption("Tabella implementazione requisiti opzionali e desiderabili") . $table_creator->end_table();
if ($table_creator->id() != 'html' && !$raw) {
echo CodeGen::generic_render_code($table, 'latex', true);
} else {
echo $table;
}
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:22,代码来源:requirement_apported.php
示例18: actionRequirement
public function actionRequirement()
{
$cs = Yii::app()->getClientScript();
$cs->registerCssFile(Yii::app()->baseUrl . '/css/requirement.css', 'screen');
$model = new Requirement();
// uncomment the following code to enable ajax-based validation
/*
if(isset($_POST['ajax']) && $_POST['ajax']==='requirement-requirement-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
*/
if (isset($_POST['Requirement'])) {
$model->attributes = $_POST['Requirement'];
if ($model->validate()) {
// form inputs are valid, do something here
return;
}
}
$this->render('requirement', array('model' => $model));
}
开发者ID:ngdvan,项目名称:lntguitar,代码行数:22,代码来源:SongController.php
示例19: actionAjaxRequirementCreate
public function actionAjaxRequirementCreate()
{
$city_id = Yii::app()->request->getPost('city_id');
$district_id = Yii::app()->request->getPost('district_id');
$investType_id = Yii::app()->request->getPost('investType_id');
$propertyType_id = Yii::app()->request->getPost('propertyType_id');
$total_price = Yii::app()->request->getPost('total_price');
$house_area = Yii::app()->request->getPost('house_area');
$land_area = Yii::app()->request->getPost('land_area');
$bedroom_num = Yii::app()->request->getPost('bedroom_num');
$construction_year = Yii::app()->request->getPost('construction_year');
if (!empty($this->_account['userId'])) {
$user = User::model()->findByPk($this->_account['userId']);
$model = new Requirement();
$model->city_id = $city_id;
$model->district_id = $district_id;
$model->investType_id = $investType_id;
$model->propertyType_id = $propertyType_id;
$model->total_price = $total_price;
$model->house_area = $house_area;
$model->land_area = $land_area;
$model->bedroom_num = $bedroom_num;
$model->construction_year = $construction_year;
$model->phone = $user->phone;
$model->email = $user->email;
if ($model->save()) {
$url = Yii::app()->createUrl('column/success');
echo CJSON::encode(array('status' => 'success', 'url' => $url, 'msg' => '提交成功'));
} else {
echo CJSON::encode(array('status' => 'failed', 'url' => '', 'msg' => '提交失败,请稍候重试'));
}
} else {
echo CJSON::encode(array('status' => 'failed', 'url' => '', 'msg' => '您还未登录,请先登录'));
}
}
开发者ID:zywh,项目名称:maplecity,代码行数:35,代码来源:ColumnController.php
示例20: actionPost
public function actionPost()
{
Yii::beginProfile('requirement_post');
$userId = Yii::app()->user->id;
$model = new Requirement();
$modelState = new GeoState();
$requirementCities = new RequirementCities();
$requirementAmenities = new RequirementAmenities();
$requirementPropertyTypes = new RequirementPropertyTypes();
$requirementBedrooms = new RequirementBedrooms();
$amenities = null;
$propertyTypes = null;
$bedrooms = null;
$cities = null;
$this->performAjaxValidation(array($model));
if (isset($_POST['minsubmit'])) {
$modelState->attributes = $_POST['GeoState'];
} elseif (isset($_POST['PostRequirementMin'])) {
$model->attributes = $_POST['Requirement'];
if (isset($_POST['GeoCity']['city'])) {
$cities[0] = $_POST['GeoCity']['city'];
}
} elseif (isset($_POST['submit'])) {
$model->attributes = $_POST['Requirement'];
$amenities = isset($_POST['amenity_id']) ? $_POST['amenity_id'] : null;
$propertyTypes = isset($_POST['property_type_id']) ? $_POST['property_type_id'] : null;
$bedrooms = isset($_POST['bedrooms']) ? $_POST['bedrooms'] : null;
$cities = isset($_POST['city_id']) ? $_POST['city_id'] : null;
$valid = true;
$model->user_id = $userId;
$valid = $valid && $model->validate();
if ($propertyTypes == null) {
$requirementPropertyTypes->addError('property_type_id', 'Property Type cannot be blank.');
$valid = false;
}
if ($cities == null || empty($cities) || $cities[0] == '') {
$requirementCities->addError('city_id', 'City cannot be blank.');
$valid = false;
}
if ($valid) {
$data = $_POST['Requirement'];
if ($data['covered_area_from'] == null) {
$data['covered_area_from'] == 0;
}
if ($data['min_price'] == null) {
$data['min_price'] = 0;
}
$requirement = RequirementApi::createRequirement($userId, $data);
if (!$requirement->hasErrors()) {
$addAmenities = true;
$addCities = true;
$addBedrooms = true;
$addPropertyTypes = true;
if (isset($_POST['amenity_id'])) {
$addAmenities = RequirementAmenitiesApi::addAmenitiesForRequirement($requirement->id, $_POST['amenity_id']);
}
if (isset($_POST['city_id'])) {
$addCities = RequirementCitiesApi::addCitiesForRequirement($requirement->id, $_POST['city_id']);
}
if (isset($_POST['bedrooms']) && !empty($_POST['bedrooms'])) {
$addBedrooms = RequirementBedroomsApi::addBedroomForRequirement($requirement->id, $_POST['bedrooms']);
}
if (isset($_POST['property_type_id'])) {
$addPropertyTypes = RequirementPropertyTypesApi::addPropertyTypesForRequirement($requirement->id, $_POST['property_type_id']);
}
if ($addAmenities && $addCities && $addBedrooms && $addPropertyTypes) {
//$this->refresh();
$this->redirect('/requirement/' . $requirement->id);
} else {
RequirementAmenitiesApi::deleteAllAmenitiesForRequirement($requirement->id);
RequirementCitiesApi::deleteAllCitiesForRequirement($requirement->id);
RequirementBedroomsApi::deleteAllBedroomsForRequirement($requirement->id);
RequirementPropertyTypesApi::deleteAllPropertyTypesForRequirement($requirement->id);
}
} else {
if (isset($property->id)) {
PropertyApi::deletePropertyById($property->id);
}
}
}
}
$this->render('post', array('model' => $model, 'modelState' => $modelState, 'requirementCities' => $requirementCities, 'requirementAmenities' => $requirementAmenities, 'requirementPropertyTypes' => $requirementPropertyTypes, 'requirementBedrooms' => $requirementBedrooms, 'amenities' => $amenities, 'propertyTypes' => $propertyTypes, 'bedrooms' => $bedrooms, 'cities' => $cities));
Yii::endProfile('requirement_post');
}
开发者ID:romeo14,项目名称:wallfeet,代码行数:84,代码来源:RequirementController.php
注:本文中的Requirement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论