Subversion-Projekte lars-tiefland.ci

Revision

Revision 2257 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2257 Revision 2414
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2018, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2019, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	https://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 1.0.0
35
 * @since	Version 1.0.0
36
 * @filesource
36
 * @filesource
37
 */
37
 */
38
defined('BASEPATH') OR exit('No direct script access allowed');
38
defined('BASEPATH') OR exit('No direct script access allowed');
Zeile 61... Zeile 61...
61
	 */
61
	 */
62
	function singular($str)
62
	function singular($str)
63
	{
63
	{
64
		$result = strval($str);
64
		$result = strval($str);
Zeile 65... Zeile 65...
65
 
65
 
66
		if ( ! is_countable($result))
66
		if ( ! word_is_countable($result))
67
		{
67
		{
68
			return $result;
68
			return $result;
Zeile 69... Zeile 69...
69
		}
69
		}
Zeile 126... Zeile 126...
126
	 */
126
	 */
127
	function plural($str)
127
	function plural($str)
128
	{
128
	{
129
		$result = strval($str);
129
		$result = strval($str);
Zeile 130... Zeile 130...
130
 
130
 
131
		if ( ! is_countable($result))
131
		if ( ! word_is_countable($result))
132
		{
132
		{
133
			return $result;
133
			return $result;
Zeile 134... Zeile 134...
134
		}
134
		}
Zeile 224... Zeile 224...
224
	}
224
	}
225
}
225
}
Zeile 226... Zeile 226...
226
 
226
 
Zeile 227... Zeile 227...
227
// --------------------------------------------------------------------
227
// --------------------------------------------------------------------
228
 
228
 
229
if ( ! function_exists('is_countable'))
229
if ( ! function_exists('word_is_countable'))
230
{
230
{
231
	/**
231
	/**
232
	 * Checks if the given word has a plural version.
232
	 * Checks if the given word has a plural version.
233
	 *
233
	 *
234
	 * @param	string	$word	Word to check
234
	 * @param	string	$word	Word to check
235
	 * @return	bool
235
	 * @return	bool
236
	 */
236
	 */
237
	function is_countable($word)
237
	function word_is_countable($word)
238
	{
238
	{
239
		return ! in_array(
239
		return ! in_array(
240
			strtolower($word),
240
			strtolower($word),
Zeile 272... Zeile 272...
272
				'wheat'
272
				'wheat'
273
			)
273
			)
274
		);
274
		);
275
	}
275
	}
276
}
276
}
-
 
277
 
-
 
278
// --------------------------------------------------------------------
-
 
279
 
-
 
280
if ( ! function_exists('is_countable'))
-
 
281
{
-
 
282
	function is_countable($word)
-
 
283
	{
-
 
284
		trigger_error('is_countable() is a native PHP function since version 7.3.0; use word_is_countable() instead', E_USER_WARNING);
-
 
285
		return word_is_countable($word);
-
 
286
	}
-
 
287
}