本文整理汇总了PHP中is_NULL函数的典型用法代码示例。如果您正苦于以下问题:PHP is_NULL函数的具体用法?PHP is_NULL怎么用?PHP is_NULL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_NULL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: set_session
function set_session($k, $v)
{
if ('' === $v || is_NULL($v)) {
unset($_SESSION($k));
} else {
$_SESSION[$k] = $v;
}
}
开发者ID:mafergomez70,项目名称:micro-power,代码行数:8,代码来源:session.php
示例2: compileCoffee
/**
* Compile coffe script
*
* @param string
* @param bool|NULL
*
* @return string
*/
protected function compileCoffee($source, $bare = NULL)
{
if (is_NULL($bare)) {
$bare = $this->bare;
}
$cmd = $this->bin . ' -p -s' . ($bare ? ' -b' : '');
return $this->run($cmd, $source);
}
开发者ID:ales-zrak,项目名称:assets-loader,代码行数:16,代码来源:CoffeeScriptFilter.php
示例3: log_memory
/**
* Logs the memory usage of the provided variable, or entire script
*
* @param string $name Optional name used to group variables and scripts together
* @param mixed $variable Optional variable to log the memory usage of
*
* @return void
*/
public function log_memory($name = 'Memory usage at this point', $variable = NULL)
{
if (!is_NULL($variable)) {
$this->log_var_memory($name, $variable);
}
$log_item = array('data' => memory_get_usage(), 'name' => $name);
$this->_write('memory', $log_item);
}
开发者ID:4bs4,项目名称:marifa,代码行数:16,代码来源:console.php
示例4: __construct
/**
* Sets the configuration options for this object and sets the start time.
*
* Possible configuration options include:
* query_explain_callback - Callback used to explain queries. Follow format used by call_user_func
*
* @param array $config List of configuration options
* @param int $start_time Time to use as the start time of the profiler
*/
private function __construct(array $config = array(), $start_time = NULL)
{
if (is_NULL($start_time)) {
$start_time = microtime(TRUE);
}
$this->_start_time = $start_time;
$this->_config = $config;
$this->_console = new Profiler_Console();
}
开发者ID:4bs4,项目名称:marifa,代码行数:18,代码来源:profiler.php
示例5: __construct
public function __construct()
{
$gridfs_conf = Core::config('gridfs_servers');
$mongo = new \MongoClient($gridfs_conf['host'], $gridfs_conf['opt']);
$this->conn = $mongo->selectDB($gridfs_conf['db']['file']);
if (!is_NULL($gridfs_conf['user']) && !is_NULL($gridfs_conf['pwd'])) {
$this->conn->authenticate($gridfs_conf['user'], $gridfs_conf['pwd']);
}
}
开发者ID:momoim,项目名称:momo-api,代码行数:9,代码来源:FileSource.php
示例6: set_session
function set_session($k, $v)
{
global $session_prefix;
if (is_NULL($v) || $v === '') {
unset($_SESSION[$session_prefix . $k]);
} else {
$_SESSION[$session_prefix . $k] = $v;
}
}
开发者ID:omusico,项目名称:Social,代码行数:9,代码来源:fsession.php
示例7: getlist
public function getlist($content = NULL, $data = NULL, $select = '*')
{
$this->db->select($select);
if (!is_NULL($this->offset)) {
$this->offset > 0 && ($this->offset = ($this->offset - 1) * $this->limit);
$this->db->offset($this->offset);
}
!is_NULL($this->limit) && $this->db->limit($this->limit);
if (!is_NULL($content) || !is_NULL($data)) {
$this->db->where($content, $data);
}
$this->db->order_by($this->order_by);
return $this->db->get($this->table_name)->result_array();
}
开发者ID:blrik,项目名称:bWorld,代码行数:14,代码来源:BLHN_Model.php
示例8: ConectarBD
/**
* Crea una nueva conexión con la base de datos, de existir, una conexión no hace nada
*
* @author [email protected]
**/
static function ConectarBD()
{
if (!isset(self::$mysqli_obj) || is_NULL(self::$mysqli_obj)) {
$nombreDB = constant('NOMBRE_BASE_DATOS');
$usuario = constant('USUARIO');
$host = constant('HOST');
$clave = constant('PASSWORD');
self::$mysqli_obj = new mysqli($host, $usuario, $clave, $nombreDB);
/* check connection */
if (self::$mysqli_obj->connect_errno) {
printf("Connect failed: %s\n", self::$mysqli_obj->connect_error);
exit;
}
}
}
开发者ID:jonatalamantes,项目名称:Herremex,代码行数:20,代码来源:ControladorBaseDatos.php
示例9: __construct
public function __construct($sourcePath, $logPath = NULL)
{
if (empty($sourcePath)) {
$this->srcPath = getcwd();
} else {
$this->srcPath = $sourcePath;
}
if (is_NULL($logPath)) {
$this->logPath = getcwd() . "/fo_integration.log";
echo "DB: logpath is:{$this->logPath}\n";
} else {
$this->logPath = $logPath;
echo "DB: logpath is:{$this->logPath}\n";
}
$this->LOGFD = fopen($this->logPath, 'a+');
if ($this->LOGFD === FALSE) {
$error = "Error! cannot open {$this->logPath}" . " File: " . __FILE__ . " on line: " . __LINE__;
throw new exception($error);
}
}
开发者ID:DanielDobre,项目名称:fossology,代码行数:20,代码来源:fo_integration.php
示例10: getSaltingInstance
/**
* Obtains a salting hashing method instance.
*
* This function will return an instance of a class that implements
* tx_saltedpasswords_abstract_salts.
*
* Use parameter NULL to reset the factory!
*
* @param string $saltedHash (optional) Salted hashed password to determine the type of used method from or NULL to reset the factory
* @param string $mode (optional) The TYPO3 mode (FE or BE) saltedpasswords shall be used for
* @return tx_saltedpasswords_abstract_salts an instance of salting hashing method object
*/
public static function getSaltingInstance($saltedHash = '', $mode = TYPO3_MODE)
{
// Creating new instance when
// * no instance existing
// * a salted hash given to determine salted hashing method from
// * a NULL parameter given to reset instance back to default method
if (!is_object(self::$instance) || !empty($saltedHash) || is_NULL($saltedHash)) {
// Determine method by checking the given hash
if (!empty($saltedHash)) {
$result = self::determineSaltingHashingMethod($saltedHash);
if (!$result) {
self::$instance = NULL;
}
} else {
$classNameToUse = \TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::getDefaultSaltingHashingMethod($mode);
$availableClasses = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/saltedpasswords']['saltMethods'];
self::$instance = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($availableClasses[$classNameToUse], 'tx_');
}
}
return self::$instance;
}
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:33,代码来源:SaltFactory.php
示例11: fillGroupForm
/**
* fillGroupForm($groupName, $user)
* \breif fill in the manage group fields
*
* @param string $groupName the name of the group to create
* @param string $user the user who will admin the group.
*
* @return NULL on success, string on error
*/
public function fillGroupForm($groupName, $user)
{
global $URL;
if (is_NULL($groupName)) {
$msg = "FATAL! no group name to set\n";
$this->fail($msg);
return $msg;
}
if (is_NULL($user)) {
$msg = "FATAL! no user name to set\n";
$this->fail($msg);
return $msg;
}
// make sure we are on the page
$page = $this->mybrowser->get("{$URL}?mod=group_manage");
$this->assertTrue($this->myassertText($page, '/Manage Group/'), "Did NOT find Title, 'Manage Group'");
$this->assertTrue($this->myassertText($page, '/Add a Group/'), "Did NOT find phrase, 'Add a Group'");
// set the fields
$groupNotSet = 'FATAL! Could Not set the groupname field';
if (!empty($groupName)) {
$this->assertTrue($this->mybrowser->setField('groupname', $groupName), $groupNotSet);
}
if (!empty($user)) {
$userNotSet = 'FATAL! Could Not set the userid field in select';
$this->assertTrue($this->mybrowser->setField('userid', $user), $userNotSet);
//return($userNotSet);
}
return NULL;
}
开发者ID:DanielDobre,项目名称:fossology,代码行数:38,代码来源:fossologyTestCase.php
示例12: postfixEvaluate
/**
* Evaluate postfix notation
*
* @param array $tokens
* The list of tokens that make up the expression.
* @param array $vars
* The list of variables set previously.
*
* @return number
* The final result of the evaluation.
*/
private function postfixEvaluate($tokens, $vars = array())
{
if ($tokens == FALSE) {
return FALSE;
}
$stack = new EvalMathStack();
foreach ($tokens as $token) {
if (in_array($token, array('+', '-', '*', '/', '^'))) {
if (is_NULL($op2 = $stack->pop())) {
return $this->trigger(t('internal error'));
}
if (is_NULL($op1 = $stack->pop())) {
return $this->trigger(t('internal error'));
}
switch ($token) {
case '+':
$stack->push($op1 + $op2);
break;
case '-':
$stack->push($op1 - $op2);
break;
case '*':
$stack->push($op1 * $op2);
break;
case '/':
if ($op2 == 0) {
return $this->trigger(t('division by zero'));
}
$stack->push($op1 / $op2);
break;
case '^':
$stack->push(pow($op1, $op2));
break;
}
} elseif ($token == "_") {
$stack->push(-1 * $stack->pop());
} elseif (preg_match("/^([a-z]\\w*)\\(\$/", $token, $matches)) {
$fnn = $matches[1];
if (array_key_exists($fnn, $this->funcAliases)) {
$fnn = $this->funcAliases[$fnn];
}
if (array_key_exists($fnn, $this->funcBuildIn)) {
$argCount = $this->funcBuildIn[$fnn];
$args = array();
for ($i = $argCount; $i > 0; $i--) {
$arg = $stack->pop();
if (is_NULL($arg)) {
return $this->trigger(t('internal error: argument is null'));
}
$args[] = $arg;
$args = array_reverse($args);
}
$stack->push(call_user_func_array($fnn, $args));
} elseif (array_key_exists($fnn, $this->funcUser)) {
$args = array();
for ($i = count($this->funcUser[$fnn]['args']) - 1; $i >= 0; $i--) {
if (is_NULL($args[$this->funcUser[$fnn]['args'][$i]] = $stack->pop())) {
return $this->trigger(t('internal error: argument is null'));
}
}
$stack->push($this->postfixEvaluate($this->funcUser[$fnn]['func'], $args));
}
} else {
if (is_numeric($token)) {
$stack->push($token);
} elseif (array_key_exists($token, $this->variables)) {
$stack->push($this->variables[$token]);
} elseif (array_key_exists($token, $vars)) {
$stack->push($vars[$token]);
} else {
return $this->trigger(t('undefined variable "%token"', array('%token' => $token)));
}
}
}
if ($stack->getCount() != 1) {
return $this->trigger(t('internal error, stack not empty'));
}
return $stack->pop();
}
开发者ID:rollinsb1010,项目名称:elearning,代码行数:90,代码来源:evalmath.class.php
示例13: l
/**
* Method to return a language text element.
*
* @param string $itemName The language code for the item to be looked up
* @param string $modulename The module name that owns the string
* @param bool $default Default text
*
* @return string The language element
*/
protected function l($itemName, $modulename = NULL, $default = FALSE)
{
if (!defined('CHISIMBA_CONTROLLER_OBJLANGUAGE_CREATED')) {
define('CHISIMBA_CONTROLLER_OBJLANGUAGE_CREATED', TRUE);
$this->_objLanguage = $this->getObject('language', 'language');
}
$module = is_NULL($modulename) ? $this->moduleName : $modulename;
return $this->_objLanguage->languageText($itemName, $module, $default);
}
开发者ID:ookwudili,项目名称:chisimba,代码行数:18,代码来源:controller_class_inc.php
示例14: updateGoodsProduct
/**
* 更新商品的货品信息,对应操作5
* 干掉该商品的所有货品,再将平台上该商品的货品下载下来
*
* @param int $supplier_id
* @param int $supplier_goods_id
* @param int $command_id,更新列表的id
* @return array ,array(
* 'type' => array(
* $type_id => $type_name,
* $type_id => $type_name
* ),
* 'spec' => array(
* $spec_id => $spec_name,
* $spec_id => $spec_name
* ),
* 'brand' => array(
* 'add' => array(
* $brand_id => $brand_name,
* $brand_id => $brand_name,
* ),
* 'update' => array(
* $brand_id => $brand_name,
* $brand_id => $brand_name,
* )
* ),
* 'cat' => array(
* $cat_id => $cat_path,
* $cat_id => $cat_path
* ),
* 'locals' => array(
* 'local_type_id' => $local_type_id,
* 'local_spec_id' => $local_spec_id,
* 'local_brand_id' => $local_brand_id
* )
* )
*/
function updateGoodsProduct($supplier_id, $supplier_goods_id, $command_id)
{
$return = $this->preDownload($supplier_id, $supplier_goods_id, $command_id);
$local_goods_info = $this->db->selectrow("SELECT * FROM sdb_goods WHERE supplier_id=" . floatval($supplier_id) . " AND supplier_goods_id=" . intval($supplier_goods_id));
$local_goods_id = $local_goods_info['goods_id'];
$local_product_info = $this->db->select("SELECT * FROM sdb_products WHERE goods_id=" . $local_goods_id);
/*
//先删除商品的所有货品(比较流氓,开会讨论结果)、sdb_goods_spec_index记录、sdb_supplier_pdtbn记录
$this->db->exec("DELETE FROM sdb_supplier_pdtbn WHERE local_bn IN (SELECT bn FROM sdb_products WHERE goods_id=".intval($local_goods_id).")");
$this->db->exec("DELETE FROM sdb_products WHERE goods_id=".intval($local_goods_id));
$this->db->exec("DELETE FROM sdb_goods_spec_index WHERE goods_id=".intval($local_goods_id));
*/
//根据货号获取可对应的本地product_id,将对应不到的product_id删除相关记录
$products = $this->api->getApiData('getProductsByGoodsID', API_VERSION, array('supplier_id' => $supplier_id, 'id' => $supplier_goods_id), true, true);
$tmp_product_id = array();
if (!empty($products)) {
foreach ($products as $v) {
$tmp = $this->db->selectrow("SELECT p.product_id FROM sdb_products AS p,sdb_supplier_pdtbn AS sp WHERE sp.source_bn='" . $v['bn'] . "' AND sp.supplier_id=" . intval($supplier_id) . " AND sp.local_bn=p.bn");
if ($tmp) {
$tmp_product_id[] = $tmp['product_id'];
}
}
}
foreach ($local_product_info as $v) {
if (!in_array($v['product_id'], $tmp_product_id)) {
$this->db->exec("DELETE FROM sdb_supplier_pdtbn WHERE local_bn='" . $v['bn'] . "'");
$this->db->exec("DELETE FROM sdb_products WHERE product_id=" . $v['product_id']);
$this->db->exec("DELETE FROM sdb_goods_spec_index WHERE product_id=" . $v['product_id']);
}
}
//删除商品的pdt_desc,spec_desc
$rs = $this->db->query("SELECT * FROM sdb_goods WHERE supplier_id=" . $supplier_id . " AND supplier_goods_id=" . $supplier_goods_id);
$sql = $this->db->GetUpdateSQL($rs, array('spec' => '', 'pdt_desc' => '', 'spec_desc' => ''));
if ($sql) {
$this->db->exec($sql);
}
$this->addProducts($supplier_id, $supplier_goods_id, $local_goods_id);
//获取货品的总库存数,取货品最小销售价作为商品销售价,最小重量作为商品重量
$product_info = $this->db->select("SELECT store,price,weight,cost FROM sdb_products WHERE goods_id=" . intval($local_goods_id));
$store = 0;
$price = NULL;
$weight = NULL;
$min_cost = NULL;
foreach ($product_info as $product) {
if (is_null($product['store']) || $product['store'] === '') {
$store = NULL;
} else {
if (!is_null($store)) {
$store += $product['store'];
}
}
if (is_null($price)) {
$price = empty($product['price']) ? 0.0 : $product['price'];
} else {
$price = min($price, $product['price']);
}
if (is_null($weight)) {
$weight = empty($product['weight']) ? 0.0 : $product['weight'];
} else {
$weight = min($weight, $product['weight']);
}
if (is_NULL($min_cost)) {
$min_cost = $product['cost'];
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:MyShop,代码行数:101,代码来源:mdl.datasync.php
示例15: lista
/**
* Retorna uma lista de registros filtrados de acordo com os parâmetros
* @return array
*/
function lista($int_cod_compensado = NULL, $int_ref_cod_escola = NULL, $int_ref_ref_cod_instituicao = NULL, $int_ref_cod_servidor = NULL, $int_ref_usuario_exc = NULL, $int_ref_usuario_cad = NULL, $date_data_inicio_ini = NULL, $date_data_inicio_fim = NULL, $date_data_fim_ini = NULL, $date_data_fim_fim = NULL, $date_data_cadastro_ini = NULL, $date_data_cadastro_fim = NULL, $date_data_exclusao_ini = NULL, $date_data_exclusao_fim = NULL, $int_ativo = NULL)
{
$sql = "SELECT {$this->_campos_lista} FROM {$this->_tabela}";
$filtros = '';
$whereAnd = ' WHERE ';
if (is_numeric($int_cod_compensado)) {
$filtros .= "{$whereAnd} cod_compensado = '{$int_cod_compensado}'";
$whereAnd = ' AND ';
}
if (is_numeric($int_ref_cod_escola)) {
$filtros .= "{$whereAnd} ref_cod_escola = '{$int_ref_cod_escola}'";
$whereAnd = ' AND ';
}
if (is_numeric($int_ref_ref_cod_instituicao)) {
$filtros .= "{$whereAnd} ref_ref_cod_instituicao = '{$int_ref_ref_cod_instituicao}'";
$whereAnd = ' AND ';
}
if (is_numeric($int_ref_cod_servidor)) {
$filtros .= "{$whereAnd} ref_cod_servidor = '{$int_ref_cod_servidor}'";
$whereAnd = ' AND ';
}
if (is_numeric($int_ref_usuario_exc)) {
$filtros .= "{$whereAnd} ref_usuario_exc = '{$int_ref_usuario_exc}'";
$whereAnd = ' AND ';
}
if (is_numeric($int_ref_usuario_cad)) {
$filtros .= "{$whereAnd} ref_usuario_cad = '{$int_ref_usuario_cad}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_inicio_ini)) {
$filtros .= "{$whereAnd} data_inicio >= '{$date_data_inicio_ini}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_inicio_fim)) {
$filtros .= "{$whereAnd} data_inicio <= '{$date_data_inicio_fim}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_fim_ini)) {
$filtros .= "{$whereAnd} data_fim >= '{$date_data_fim_ini}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_fim_fim)) {
$filtros .= "{$whereAnd} data_fim <= '{$date_data_fim_fim}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_cadastro_ini)) {
$filtros .= "{$whereAnd} data_cadastro >= '{$date_data_cadastro_ini}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_cadastro_fim)) {
$filtros .= "{$whereAnd} data_cadastro <= '{$date_data_cadastro_fim}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_exclusao_ini)) {
$filtros .= "{$whereAnd} data_exclusao >= '{$date_data_exclusao_ini}'";
$whereAnd = ' AND ';
}
if (is_string($date_data_exclusao_fim)) {
$filtros .= "{$whereAnd} data_exclusao <= '{$date_data_exclusao_fim}'";
$whereAnd = ' AND ';
}
if (is_NULL($int_ativo) || $int_ativo) {
$filtros .= "{$whereAnd} ativo = '1'";
$whereAnd = ' AND ';
} else {
$filtros .= "{$whereAnd} ativo = '0'";
$whereAnd = ' AND ';
}
$db = new clsBanco();
$countCampos = count(explode(',', $this->_campos_lista));
$resultado = array();
$sql .= $filtros . $this->getOrderby() . $this->getLimite();
$this->_total = $db->CampoUnico("SELECT COUNT(0) FROM {$this->_tabela} {$filtros}");
$db->Consulta($sql);
if ($countCampos > 1) {
while ($db->ProximoRegistro()) {
$tupla = $db->Tupla();
$tupla['_total'] = $this->_total;
$resultado[] = $tupla;
}
} else {
while ($db->ProximoRegistro()) {
$tupla = $db->Tupla();
$resultado[] = $tupla[$this->_campos_lista];
}
}
if (count($resultado)) {
return $resultado;
}
return FALSE;
}
开发者ID:secteofilandia,项目名称:ieducar,代码行数:95,代码来源:clsPmieducarFaltaAtrasoCompensado.inc.php
示例16: generateCalendar
/**
* PHP Calendar (version 2.3), written by Keith Devens
* http://keithdevens.com/software/php_calendar
* see example at http://keithdevens.com/weblog
* License: http://keithdevens.com/software/license
*
* @param mixed $year
* @param mixed $month
* @param array $days
* @param integer $day_name_length
* @param mixed $month_href
* @param integer $first_day
* @param array $pn
* @return
*/
public function generateCalendar($year, $month, $days = array(), $day_name_length = 3, $month_href = null, $first_day = 0, $pn = array())
{
$first_of_month = gmmktime(0, 0, 0, $month, 1, $year);
// remember that mktime will automatically correct if invalid dates are entered
// for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998
// this provides a built in "rounding" feature to generate_calendar()
$day_names = array();
//generate all the day names according to the current locale
for ($n = 0, $t = (3 + $first_day) * 86400; $n < 7; $n++, $t += 86400) {
$day_names[$n] = ucfirst(gmstrftime('%A', $t));
}
//%A means full textual day name
list($month, $year, $month_name, $weekday) = explode(',', gmstrftime('%m,%Y,%B,%w', $first_of_month));
$weekday = ($weekday + 7 - $first_day) % 7;
//adjust for $first_day
$title = htmlentities(ucfirst($month_name)) . ' ' . $year;
//note that some locales don't capitalize month and day names
// Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03
@(list($p, $pl) = each($pn));
@(list($n, $nl) = each($pn));
//previous and next links, if applicable
if ($p) {
$p = '<span class="calendar-prev">' . ($pl ? '<a href="' . htmlspecialchars($pl) . '">' . $p . '</a>' : $p) . '</span> ';
}
if ($n) {
$n = ' <span class="calendar-next">' . ($nl ? '<a href="' . htmlspecialchars($nl) . '">' . $n . '</a>' : $n) . '</span>';
}
$calendar = '<table class="calendar">' . "\n" . '<caption class="calendar-month">' . $p . ($month_href ? '<a href="' . htmlspecialchars($month_href) . '">' . $title . '</a>' : $title) . $n . "</caption>\n<tr>";
if ($day_name_length) {
// if the day names should be shown ($day_name_length > 0)
// if day_name_length is >3, the full name of the day will be printed
foreach ($day_names as $d) {
$calendar .= '<th abbr="' . htmlentities($d) . '">' . htmlentities($day_name_length < 4 ? substr($d, 0, $day_name_length) : $d) . '</th>';
}
$calendar .= "</tr>\n<tr>";
}
if ($weekday > 0) {
for ($i = 1; $i <= $weekday; $i++) {
$calendar .= '<td class="noDay"> </td>';
}
}
for ($day = 1, $days_in_month = gmdate('t', $first_of_month); $day <= $days_in_month; $day++, $weekday++) {
if ($weekday == 7) {
$weekday = 0;
//start a new week
$calendar .= "</tr>\n<tr>";
}
if (isset($days[$day]) and is_array($days[$day])) {
@(list($link, $classes, $content) = $days[$day]);
if (is_NULL($content)) {
$content = $day;
}
$calendar .= '<td' . ($classes ? ' class="' . htmlspecialchars($classes) . '">' : '>') . ($link ? '<a href="' . htmlspecialchars($link) . '">' . $content . '</a>' : $content) . '</td>';
} else {
$calendar .= "<td>{$day}</td>";
}
}
if ($weekday != 7) {
for ($i = 1; $i <= 7 - $weekday; $i++) {
$calendar .= '<td class="noDay"> </td>';
}
}
return $calendar . "</tr>\n</table>\n";
}
开发者ID:Apen,项目名称:t3devapi,代码行数:79,代码来源:class.tx_t3devapi_calendar.php
示例17: run
/**
* Renders the widget.
*/
public function run()
{
$view = $this->getView();
$CssClass = NULL;
if ($this->sbLeft) {
$CssClass = 'sb-slidebar sb-left';
if ($this->sbStatic) {
$CssClass .= ' sb-static';
}
if ($this->sbStylePush) {
$CssClass .= ' sb-style-push';
} else {
$CssClass .= ' sb-style-overlay';
}
if (!is_null($this->sbWidth)) {
$CssClass .= ' sb-width-custom';
}
echo Html::beginTag('div', ['class' => $CssClass, is_NULL($this->sbWidth) ? NULL : 'data-sb-width' => $this->sbWidth]) . "\n";
if (isset($view->blocks['sb-left'])) {
echo $view->blocks['sb-left'];
}
echo Html::endTag('div') . "\n";
}
if ($this->sbRight) {
$CssClass = 'sb-slidebar sb-right';
if ($this->sbStatic) {
$CssClass .= ' sb-static';
}
if ($this->sbStylePush) {
$CssClass .= ' sb-style-push';
} else {
$CssClass .= ' sb-style-overlay';
}
if (!is_null($this->sbWidth)) {
$CssClass .= ' sb-width-custom';
}
echo Html::beginTag('div', ['class' => $CssClass, is_NULL($this->sbWidth) ? NULL : 'data-sb-width' => $this->sbWidth]) . "\n";
if (isset($view->blocks['sb-right'])) {
echo $view->blocks['sb-right'];
}
echo Html::endTag('div') . "\n";
}
$this->registerPlugin();
}
开发者ID:philippfrenzel,项目名称:yii2slidebars,代码行数:47,代码来源:yii2slidebars.php
示例18: mysql_connect
</p>
<?php
//create connection
$db_connection = mysql_connect("localhost", "cs143", "");
//check connection
if (!$db_connection) {
$errmsg = mysql_error($db_connection);
print "Connection failed: {$errmsg} <br/>";
exit(1);
}
//Choose db
$query = $_GET["query"];
echo "{$query}" . "<br/>";
//if(mysql_errno($db_connection)!=0){
if (!is_NULL($query)) {
mysql_select_db("CS143", $db_connection);
mysql_query($query, $db_connection);
echo "<h3>Result from MySQL: </h3>" . mysql_error($db_connection) . "<br/>";
}
$rs = mysql_query($query, $db_connection);
/*if (!is_null($query) && !mysql_errno($db_connection) && !$rs) {
echo '<b>Sorry! Could not run this query. </b>' ;
exit(1);
}*/
echo "<table>";
echo "<tr>";
//$row =mysql_fetch_row($rs)
while ($col = mysql_fetch_field($rs)) {
echo "<th>" . "{$col->name}" . "</th>";
}
开发者ID:bzplbn,项目名称:Movie-Webpage-Interacting-with-Database,代码行数:31,代码来源:query.php
示例19: processCUnit
/**
* \brief meta function to process cunit reports
*
* @param string $unitTest the unit test to process
*
* @return mixed NULL on success, newline terminated string on failure
*/
function processCUnit($unitTest)
{
global $failures;
global $other;
$unitTest = preg_replace('#/#', '-', $unitTest);
$libphp = "lib-php";
/** ignore lib/php/tests */
if ($libphp === $unitTest) {
return NULL;
}
if (empty($unitTest)) {
return "Error! no valid input at line " . __FILE__ . " at line " . __LINE__ . "\n";
}
foreach (glob("{$unitTest}*.xml") as $fName) {
$fileName = lcfirst($fName);
// Skip Listing files
if (preg_grep("/Listing/", array($fileName))) {
$rmlast = exec("rm {$fileName}", $rmOut, $rmRtn);
continue;
}
if (!tweakCUnit($fileName)) {
return "Error! could not save processed xml file, they may not display properly\n";
}
$errors = array();
// defect: if the report is corrupt, checkCUnit will say everything is OK.
$errors = checkCUnit($fileName);
//echo "DB: after checkCUnit, errors for $unitTest are\n";print_r($errors) . "\n";
if (is_object($errors[0])) {
$failures++;
echo "There were Unit Test Failures in {$unitTest}\n";
//print_r($errors) . "\n";
} else {
if (!is_NULL($errors)) {
// if we can't even check the file, then skip making the report
$failures++;
return "Failure: Could not check file {$fileName} for failures is the file corrupt?\n";
}
}
if (!genCunitRep($fileName)) {
return "Error!, could not generate html report for {$unitTest}\n";
}
}
// foreach
return NULL;
}
开发者ID:DanielDobre,项目名称:fossology,代码行数:52,代码来源:runAgentUnit.php
示例20: _getConnection
/**
* Get Connection
*
* Get a valid database connection
*
* @return MongoConnection
*/
protected final function _getConnection()
{
if (is_NULL(self::$_conn)) {
if (is_NULL(self::$_host)) {
self::$_host = 'localhost';
}
self::$_conn = new Mongo(self::$_host);
}
if (isset($this)) {
$dbname = $this->getDatabaseName();
} else {
$dbname = self::getDatabaseName();
}
if (!isset(self::$_dbs[$dbname])) {
self::$_dbs[$dbname] = self::$_conn->selectDB($dbname);
}
if (!is_null(self::$_user) && !is_null(self::$_pwd)) {
self::$_dbs[$dbname]->authenticate(self::$_user, self::$_pwd);
}
return self::$_dbs[$dbname];
}
开发者ID:284099857,项目名称:ActiveMongo,代码行数:28,代码来源:ActiveMongo.php
注:本文中的is_NULL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论