Location: PHPKode > projects > Energine > energine-2.2/doc/api/energine/core/_framework---utils.func.php.html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
			<title>Docs for page utils.func.php</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
						<script src="../../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../../media/images/plus.png";
				imgMinus.src = "../../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			
<h2 class="file-name"><img src="../../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/framework/utils.func.php</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-functions">Functions</a>
			</div>
	<div class="info-box-body">	
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Содержит набор служебных утилит системы.</p>
	<ul class="tags">
				<li><span class="field">author:</span> 1m.dm</li>
				<li><span class="field">version:</span> $Id: _framework---utils.func.php.html,v 1.1 2007/10/24 16:10:14 pavka Exp $</li>
				<li><span class="field">copyright:</span> ColoCall 2006</li>
				<li><span class="field">filesource:</span> <a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html">Source Code for this file</a></li>
			</ul>
		
			</div>
</div>
		

	
	
	
	<a name="sec-functions"></a>	
	<div class="info-box">
		<div class="info-box-title">Functions</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<span class="disabled">Functions</span>
		</div>
		<div class="info-box-body">	
			<a name="functionarrayPush" id="functionarrayPush"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">arrayPush</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a227">227</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Добавляет элемент $var в конец массива $array и возвращает индекс  добавленного элемента. С помощью аргумента $key возможно принудительно  задать индекс для добавляемого элемента.</p>
	<ul class="tags">
				<li><span class="field">see:</span> <a href="http://www.php.net/array_push">array_push()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			arrayPush
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">&$array</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$var</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span> = <span class="var-default">null</span>], <span class="var-type">ref</span>&nbsp;<span class="var-name">$array</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">ref</span>
				<span class="var-name">$array</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$var</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$key</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$array</span>			</li>
				</ul>
		
	
</div>
<a name="functionarray_push_before" id="functionarray_push_before"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">array_push_before</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a252">252</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Добавляет элемент(ы) в массив перед указанной позицией и возвращает результат  в виде нового массива.</p>
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			array_push_before
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$array</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$var</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$pos</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$array</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$var</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$pos</span>			</li>
				</ul>
		
	
</div>
<a name="functionconvertDatetimeToTimestamp" id="functionconvertDatetimeToTimestamp"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">convertDatetimeToTimestamp</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a93">93</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Конвертирует строку формата DATETIME (YYYY-MM-DD HH:MM:SS) в UNIX timestamp.</p>
<p class="description"><p>Возвращает timestamp (int) в случае успеха, или false в случае неудачи.</p></p>
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			convertDatetimeToTimestamp
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$datetime</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$datetime</span>			</li>
				</ul>
		
	
</div>
<a name="functionconvertDBResult" id="functionconvertDBResult"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">convertDBResult</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a165">165</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../energine/core/QAL.html#methodselect">QAL::select()</a></li>
				<li><span class="field">todo:</span> написать подробное описание!</li>
			</ul>
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			convertDBResult
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dbResult</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$pkName</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$deletePK</span> = <span class="var-default">false</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$dbResult</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$pkName</span>			</li>
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$deletePK</span>			</li>
				</ul>
		
	
</div>
<a name="functionconvertFieldNames" id="functionconvertFieldNames"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">convertFieldNames</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a204">204</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Приводит имена полей массива $fields в так называемую Camel Notation,  где каждое слово после первого написано с большой буквы. Необязательный  аргумент $prefix позволяет задать префикс, который будет удаляться из имени  поля при конвертации.</p>
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			convertFieldNames
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$fields</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span> = <span class="var-default">&#039;&#039;</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$prefix</span><span class="var-description">: префикс имени подлежащий удалению</span>			</li>
				</ul>
		
	
</div>
<a name="functionddump" id="functionddump"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">ddump</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a36">36</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Аналог функции inspect, с завершением работы программы сразу после вывода.</p>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			ddump
		</span>
					([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$var,</span> = <span class="var-default">...</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$var,</span><span class="var-description">: ...</span>			</li>
				</ul>
		
	
</div>
<a name="functionddump_log" id="functionddump_log"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">ddump_log</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a73">73</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Записывает информацию о переданных переменных в лог-файл и завершает  работу программы. Информация записывается в начало файла, при этом  прежнее содержимое удаляется.</p>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			ddump_log
		</span>
					([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$var,</span> = <span class="var-default">...</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$var,</span><span class="var-description">: ...</span>			</li>
				</ul>
		
	
</div>
<a name="functiondump_log" id="functiondump_log"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">dump_log</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a52">52</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Записывает информацию о переменной в лог-файл.</p>
<p class="description"><p>Флаг $append контролирует способ записи:      true - добавить информацию в конец файла;      false - записать информацию в начало файла, удалив прежнее содержимое (по-умолчанию);</p></p>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			dump_log
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$var</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$append</span> = <span class="var-default">false</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$var</span>			</li>
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$append</span>			</li>
				</ul>
		
	
</div>
<a name="functioninspect" id="functioninspect"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">inspect</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a22">22</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Выводит форматированную при помощи HTML информацию о переданных переменных  непосредственно в текущий поток вывода (output stream).</p>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			inspect
		</span>
					([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$var,</span> = <span class="var-default">...</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$var,</span><span class="var-description">: ...</span>			</li>
				</ul>
		
	
</div>
<a name="functioninverseDBResult" id="functioninverseDBResult"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">inverseDBResult</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a145">145</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Трансформирует массив результата SELECT-запроса к БД из представления  по строкам в представление по столбцам.</p>
<p class="description"><p>На входе:      array($n =&gt; array($fieldName =&gt; $fieldValue))</p><p>На выходе:      array($fieldName =&gt; array($n =&gt; $fieldValue))</p></p>
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			inverseDBResult
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$dbResult</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$dbResult</span>			</li>
				</ul>
		
	
</div>
<a name="functionsimplifyDBResult" id="functionsimplifyDBResult"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../../media/images/Function.png" />
		<span class="method-title">simplifyDBResult</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkutils.func.php.html#a114">114</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Выбирает значения указанного поля из двумерного ассоциативного массива  результата SELECT-запроса к БД в одномерный массив. Если флаг $singleRow  установлен в true, возвращается значение указанного поля из первой  (обычно единственной) строки результата $dbResult.</p>
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			simplifyDBResult
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dbResult</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$fieldName</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$singleRow</span> = <span class="var-default">false</span>])
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$dbResult</span><span class="var-description">: результат SELECT-запроса к БД</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$fieldName</span><span class="var-description">: имя поля для выборки из результата</span>			</li>
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$singleRow</span>			</li>
				</ul>
		
	
</div>
		</div>
	</div>
	
	<p class="notes" id="credit">
		Documentation generated on Mon, 17 Sep 2007 13:33:41 +0300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
	</p>
	</div></body>
</html>
Return current item: Energine