当前位置: 首页>>代码示例>>PHP>>正文


PHP Error::notice方法代码示例

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


在下文中一共展示了Error::notice方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: forge

 /**
  * Gets a new instance of the Asset class.
  *
  * @param   string  instance name
  * @param   array  $config  default config overrides
  * @return  Asset_Instance
  */
 public static function forge($name = 'default', array $config = array())
 {
     if ($exists = static::instance($name)) {
         \Error::notice('Asset with this name exists already, cannot be overwritten.');
         return $exists;
     }
     static::$_instances[$name] = new \Asset_Instance(array_merge(static::$default_config, \Config::get('asset'), $config));
     if ($name == 'default') {
         static::$_instance = static::$_instances[$name];
     }
     return static::$_instances[$name];
 }
开发者ID:marietta-adachi,项目名称:website,代码行数:19,代码来源:asset.php

示例2: forge

 /**
  * Gets a new instance of the Messages class.
  *
  * @param   string  instance name
  * @return  Messages
  */
 public static function forge($name = 'messages')
 {
     if ($exists = static::instance($name)) {
         \Error::notice('Messages instance with this name exists already, cannot be overwritten.');
         return $exists;
     }
     static::$_instances[$name] = new \Messages_Instance($name);
     if ($name == 'messages') {
         static::$_instance = static::$_instances[$name];
     }
     return static::$_instances[$name];
 }
开发者ID:EdgeCommerce,项目名称:edgecommerce,代码行数:18,代码来源:messages.php

示例3: forge

 /**
  * Forge
  * 
  * @param  string $service
  * @param  string $name
  * @param  array $config
  * @return Gdata
  */
 public static function forge($service = null, $name = 'default', array $config = array())
 {
     if ($exists = static::instance($name)) {
         \Error::notice('Gdata with this name exists already, cannot be overwritten.');
         return $exists;
     }
     static::$_instances[$name] = new static($service, $config);
     if ($name == 'default') {
         static::$_instance = static::$_instances[$name];
     }
     return static::$_instances[$name];
 }
开发者ID:mp-php,项目名称:fuel-packages-gdata,代码行数:20,代码来源:gdata.php

示例4: forge

 /**
  * forge a new pagination instance
  *
  * @return	\Pagination	a new pagination instance
  */
 public static function forge($name = 'default', $config = array())
 {
     \Config::load('auto_response_emails', true);
     if ($exists = static::instance($name)) {
         \Error::notice('Autoresponder with this name exists already, cannot be overwritten.');
         return $exists;
     }
     static::$_instances[$name] = new static($config);
     if ($name == 'default') {
         static::$_instance = static::$_instances[$name];
     }
     return static::$_instances[$name];
 }
开发者ID:EdgeCommerce,项目名称:edgecommerce,代码行数:18,代码来源:autoresponder.php

示例5: handle

 public function handle()
 {
     // handle the error based on the config and the environment we're in
     if (static::$count <= Config::get('errors.throttle', 10)) {
         logger(\Fuel::L_ERROR, $this->code . ' - ' . $this->message . ' in ' . $this->file . ' on line ' . $this->line);
         if (\Fuel::$env != \Fuel::PRODUCTION and ($this->code & error_reporting()) == $this->code) {
             static::$count++;
             \Error::show_php_error(new \ErrorException($this->message, $this->code, 0, $this->file, $this->line));
         }
     } elseif (\Fuel::$env != \Fuel::PRODUCTION and static::$count == \Config::get('errors.throttle', 10) + 1 and ($this->severity & error_reporting()) == $this->severity) {
         static::$count++;
         \Error::notice('Error throttling threshold was reached, no more full error reports are shown.', true);
     }
 }
开发者ID:highestgoodlikewater,项目名称:webspider-1,代码行数:14,代码来源:error.php

示例6: add

    /**
     * Factory for Fieldset_Field objects
     *
     * @param   string
     * @param   string
     * @param   array
     * @param   array
     * @return  Fieldset_Field
     */
    public function add($name, $label = '', array $attributes = array(), array $rules = array()) {
        if ($name instanceof Fieldset_Field) {
            if ($name->name == '' or $this->field($name->name) !== false) {
                throw new \RuntimeException('Fieldname empty or already exists in this Fieldset: "' . $name->name . '".');
            }

            $name->set_fieldset($this);
            $this->fields[$name->name] = $name;
            return $name;
        } elseif ($name instanceof Fieldset) {
            if (empty($name->name) or $this->field($name->name) !== false) {
                throw new \RuntimeException('Fieldset name empty or already exists in this Fieldset: "' . $name->name . '".');
            }

            $name->set_parent($this);
            $this->fields[$name->name] = $name;
            return $name;
        }

        if (empty($name) || (is_array($name) and empty($name['name']))) {
            throw new \InvalidArgumentException('Cannot create field without name.');
        }

        // Allow passing the whole config in an array, will overwrite other values if that's the case
        if (is_array($name)) {
            $attributes = $name;
            $label      = isset($name['label']) ? $name['label'] : '';
            $rules      = isset($name['rules']) ? $name['rules'] : array();
            $name = $name['name'];
        }

        // Check if it exists already, if so: return and give notice
        if (($field = $this->field($name))) {
            \Error::notice('Field with this name exists already in this fieldset: "' . $name . '".');
            return $field;
        }

        $field = new \ViewForm\Fieldset_Field($name, $label, $attributes, $rules, $this);
        $this->fields[$name] = $field;


        return $field;
    }
开发者ID:hazeleye,项目名称:fuel-viewform,代码行数:52,代码来源:fieldset.php

示例7: add_rule

 /**
  * Add a validation rule
  * any further arguements after the callback will be used as arguements for the callback
  *
  * @param	string|Callback	either a validation rule or full callback
  * @return	Fieldset_Field	this, to allow chaining
  */
 public function add_rule($callback)
 {
     $args = array_slice(func_get_args(), 1);
     // Rules are validated and only accepted when given as an array consisting of
     // array(callback, params) or just callbacks in an array.
     $callable_rule = false;
     if (is_string($callback)) {
         $callback_method = '_validation_' . $callback;
         $callables = $this->fieldset->validation()->callables();
         foreach ($callables as $callback_class) {
             if (method_exists($callback_class, $callback_method)) {
                 $callable_rule = true;
                 $this->rules[] = array(array($callback_class, $callback_method), $args);
             }
         }
     }
     // when no callable function was found, try regular callbacks
     if (!$callable_rule) {
         if (is_callable($callback)) {
             $this->rules[] = array($callback, $args);
         } else {
             $string = !is_array($callback) ? $callback : (is_object(@$callback[0]) ? get_class(@$callback[0]) . '->' . @$callback[1] : @$callback[0] . '::' . @$callback[1]);
             Error::notice('Invalid rule "' . $string . '" passed to Validation, not used.');
         }
     }
     // Set required setting for forms when rule was applied
     if ($callback === 'required') {
         $this->set_attribute('required', true);
     }
     return $this;
 }
开发者ID:hymns,项目名称:fuel,代码行数:38,代码来源:field.php

示例8: insert_after_value

 /**
  * Insert value(s) into an array after a specific value (first found in array)
  *
  * @param   array        the original array (by reference)
  * @param   array|mixed  the value(s) to insert, if you want to insert an array it needs to be in an array itself
  * @param   string|int   the value after which to insert
  * @return  bool         false when value isn't found in the array, otherwise true
  */
 public static function insert_after_value(array &$original, $value, $search)
 {
     $key = array_search($search, $original);
     if ($key === false) {
         \Error::notice('Unknown value after which to insert the new value into the array.');
         return false;
     }
     return static::insert_after_key($original, $value, $key);
 }
开发者ID:quickpacket,项目名称:noclayer,代码行数:17,代码来源:arr.php

示例9: _find_rule

 /**
  * Takes the rule input and formats it into a name & callback
  *
  * @param   string|array  short rule to be called on Validation callables array or full callback
  * @return  array|bool    rule array or false when it fails to find something callable
  */
 protected function _find_rule($callback)
 {
     // Rules are validated and only accepted when given as an array consisting of
     // array(callback, params) or just callbacks in an array.
     if (is_string($callback)) {
         $callback_method = '_validation_' . $callback;
         foreach ($this->callables as $callback_class) {
             if (method_exists($callback_class, $callback_method)) {
                 return array($callback => array($callback_class, $callback_method));
             }
         }
     }
     // when no callable function was found, try regular callbacks
     if (is_callable($callback)) {
         if ($callback instanceof \Closure) {
             $callback_name = 'closure';
         } elseif (is_array($callback)) {
             $callback_name = preg_replace('#^([a-z_]*\\\\)*#i', '', is_object($callback[0]) ? get_class($callback[0]) : $callback[0]) . ':' . $callback[1];
         } else {
             $callback_name = preg_replace('#^([a-z_]*\\\\)*#i', '', str_replace('::', ':', $callback));
         }
         return array($callback_name => $callback);
     } elseif (is_array($callback) and is_callable(reset($callback))) {
         return $callback;
     } else {
         $string = !is_array($callback) ? $callback : (is_object(@$callback[0]) ? get_class(@$callback[0]) . '->' . @$callback[1] : @$callback[0] . '::' . @$callback[1]);
         \Error::notice('Invalid rule "' . $string . '" passed to Validation, not used.');
         return false;
     }
 }
开发者ID:cloudetm,项目名称:development,代码行数:36,代码来源:validation.php

示例10: unregister_driver_type

 /**
  * Unregister a driver type
  *
  * @param	string	name of the driver type
  * @return	bool
  */
 public static function unregister_driver_type($type)
 {
     if (in_array('login', 'group', 'acl')) {
         \Error::notice('Cannot remove driver type, included drivers login, group and acl cannot be removed.');
         return false;
     }
     unset(static::$_drivers[$type]);
     return true;
 }
开发者ID:bryanheo,项目名称:FuelPHP-Auth-AJAX,代码行数:15,代码来源:auth.php

示例11: days_in_month

	/**
	 * Returns the number of days in the requested month
	 * (Based on CodeIgniter function)
	 *
	 * @param	int	month as a number (1-12)
	 * @param	int	the year, leave empty for current
	 * @return	int	the number of days in the month
	 */
	public static function days_in_month($month, $year = null)
	{
		$year	= ! empty($year) ? (int) $year : (int) date('Y');
		$month	= (int) $month;

		if ($month < 1 || $month > 12)
		{
			\Error::notice('Invalid input for month given.');
			return false;
		}
		elseif ($month == 2)
		{
			if ($year % 400 == 0 || ($year % 4 == 0 && $year % 100 != 0))
			{
				return 29;
			}
		}

		$days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
		return $days_in_month[$month-1];
	}
开发者ID:nasumi,项目名称:fuel,代码行数:29,代码来源:date.php

示例12: insert_before_value

 /**
  * Insert value(s) into an array before a specific value (first found in array)
  *
  * @param   array        the original array (by reference)
  * @param   array|mixed  the value(s) to insert, if you want to insert an array it needs to be in an array itself
  * @param   string|int   the value after which to insert
  * @param   bool         wether the input is an associative array
  * @return  bool         false when value isn't found in the array, otherwise true
  */
 public static function insert_before_value(array &$original, $value, $search, $is_assoc = false)
 {
     $key = array_search($search, $original);
     if ($key === false) {
         \Error::notice('Unknown value before which to insert the new value into the array.');
         return false;
     }
     return static::insert_before_key($original, $value, $key, $is_assoc);
 }
开发者ID:wushian,项目名称:MDD,代码行数:18,代码来源:arr.php

示例13: add

 /**
  * Factory for Fieldset_Field objects
  *
  * @param	string
  * @param	string
  * @param	array
  * @param	array
  * @return	Fieldset_Field
  */
 public function add($name, $label = '', array $attributes = array(), array $rules = array())
 {
     if (empty($name) || (is_array($name) and empty($name['name']))) {
         throw new \InvalidArgumentException('Cannot create field without name.');
     }
     // Allow passing the whole config in an array, will overwrite other values if that's the case
     if (is_array($name)) {
         $attributes = $name;
         $label = isset($name['label']) ? $name['label'] : '';
         $rules = isset($name['rules']) ? $name['rules'] : array();
         $name = $name['name'];
     }
     // Check if it exists already, if so: return and give notice
     if ($field = static::field($name)) {
         \Error::notice('Field with this name exists already, cannot be overwritten through add().');
         return $field;
     }
     $field = new \Fieldset_Field($name, $label, $attributes, $rules, $this);
     $this->fields[$name] = $field;
     return $field;
 }
开发者ID:nathanharper,项目名称:divine-economy,代码行数:30,代码来源:fieldset.php

示例14: set_raw

 /**
  * Sets a variable on the template without sanitizing
  *
  * @param	string
  * @param	mixed
  */
 public function set_raw($name, $val)
 {
     \Error::notice('The ViewModel::set_safe() method is depricated and will be removed at 1.0. Use set(name, var, false) instead.');
     $this->_template->set($name, $val, false);
     return $this;
 }
开发者ID:469306621,项目名称:Languages,代码行数:12,代码来源:viewmodel.php


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