本文整理汇总了PHP中System_XML函数的典型用法代码示例。如果您正苦于以下问题:PHP System_XML函数的具体用法?PHP System_XML怎么用?PHP System_XML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了System_XML函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Open
public function Open()
{
#-------------------------------------------------------------------------------
$Settings = $this->Settings;
#-------------------------------------------------------------------------------
$Address = SPrintF('%s:%u', $Settings['Server'], $Settings['Port']);
#-------------------------------------------------------------------------------
$this->Link = @MySQL_Connect($Address, $User = $Settings['User'], $Settings['Password'], TRUE);
#-------------------------------------------------------------------------------
if (!Is_Resource($this->Link)) {
return ERROR | @Trigger_Error(SPrintF('[MySQL->Open]: не возможно соединиться с (%s@%s)', $User, $Address));
}
#-------------------------------------------------------------------------------
Debug(SPrintF('[MySQL->Open]: связь как (%s@%s) установлена', $User, $Address));
#-------------------------------------------------------------------------------
$Init = System_XML('config/MySqlInit.xml');
#-------------------------------------------------------------------------------
if (Is_Error($Init)) {
return ERROR | @Trigger_Error('[MySQL->Open]: не возможно загрузить запросы инициализации');
}
#-------------------------------------------------------------------------------
foreach ($Init as $Query) {
if (Is_Error($this->Query($Query))) {
return ERROR | @Trigger_Error('[MySQL->Open]: не удалось произвести инициализацию подключения');
}
}
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
}
示例2: Md5
function &Messages()
{
#-----------------------------------------------------------------------------
$Name = Md5('Messages');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#---------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Messages.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Messages]: не удалось загрузить файл сообщений');
}
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例3: Md5
function &Regulars()
{
#-----------------------------------------------------------------------------
$Name = Md5('Regulars');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#---------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Regulars.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Regulars]: не удалось загрузить файл регулярных выражений');
}
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例4: Md5
function &Config()
{
#-------------------------------------------------------------------------------
$Name = Md5('Config');
#-------------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#-------------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Config.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Config]: не удалось загрузить основную конфигурацию');
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $GLOBALS[$Name];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
}
示例5: array
if (Is_Error($DOM->Load('Window'))) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$DOM->AddText('Title', 'Новое обсуждение');
#-------------------------------------------------------------------------------
$Table = array();
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('name' => 'Theme', 'size' => 60, 'type' => 'text'));
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Table[] = array('Тема обсуждения', $Comp);
#-------------------------------------------------------------------------------
$Smiles = System_XML('config/Smiles.xml');
if (Is_Error($Smiles)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Options = array('NO' => 'Не выбран');
#-------------------------------------------------------------------------------
foreach ($Smiles as $Smile) {
$Options[$Smile['Pattern']] = $Smile['Name'];
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Select', array('name' => 'Smile', 'onchange' => "if(value != 'NO'){ form.Message.value += value; }"), $Options);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
示例6: DB_Select
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
for ($i = 0; $i < $Count; $i += 100) {
#-------------------------------------------------------------------------------
$Users = DB_Select('Users', array('*'), array('Limits' => array('Start' => $i, 'Length' => 100)));
#-------------------------------------------------------------------------------
switch (ValueOf($Users)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
# No more...
break;
case 'array':
#-------------------------------------------------------------------------------
$Template = System_XML('xml/Params/Users.xml');
if (Is_Error($Template)) {
return new gException('ERROR_TEMPLATE_LOAD', 'Ошибка загрузки шаблона');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
foreach ($Users as $User) {
#-------------------------------------------------------------------------------
$Attribs = @$User['Params']['Settings'];
#-------------------------------------------------------------------------------
foreach (Array_Keys($Template['Settings']) as $AttribID) {
if (!isset($Attribs[$AttribID])) {
$Attribs[$AttribID] = $Template['Settings'][$AttribID]['Value'];
}
}
#-------------------------------------------------------------------------------
示例7: foreach
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
foreach ($DomainSchemes as $DomainScheme) {
if (isset($DomainScheme['ID'])) {
$Zones[$DomainScheme['ID']] = array('Name' => $DomainScheme['Name'], 'CostOrder' => $DomainScheme['CostOrder']);
}
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!$Settings['IsSchemesOnly'] || SizeOf($Zones) == 0) {
#-------------------------------------------------------------------------------
$DomainZones = System_XML('config/DomainZones.xml');
if (Is_Error($DomainZones)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
foreach ($DomainZones as $DomainZone) {
$Zones[$DomainZone['Name']] = array('Name' => $DomainZone['Name'], 'CostOrder' => '-');
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Row = $Scripts = $JsonOut = array();
#-------------------------------------------------------------------------------
foreach (array('Название домена', 'Статус', 'Цена в год', 'Сделать заказ') as $Text) {
$Row[] = new Tag('TD', array('class' => 'Head'), $Text);
示例8: DB_Delete
$IsDelete = DB_Delete('Contracts', array('ID' => $Contract['ID']));
if (Is_Error($IsDelete)) {
return ERROR | @Trigger_Error(500);
}
#-----------------------------------------------------------------------
continue;
}
#-------------------------------------------------------------------------
$Profiles = DB_Select('Profiles', '*', array('Where' => SPrintF("`UserID` = %u AND `TemplateID` = 'Natural'", $Contract['UserID'])));
#-------------------------------------------------------------------------
switch (ValueOf($Profiles)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
#---------------------------------------------------------------------
$Template = System_XML('profiles/Natural.xml');
if (Is_Error($Template)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------
$Params = $Template['Attribs'];
#---------------------------------------------------------------------
$Attribs = array();
#---------------------------------------------------------------------
foreach (Array_Keys($Params) as $ParamID) {
$Attribs[$ParamID] = $Params[$ParamID]['Value'];
}
#---------------------------------------------------------------------
$Name = Explode(' ', $User['Name']);
#---------------------------------------------------------------------
$Attribs['Name'] = Current($Name);
示例9: array
$__args_list = array('TemplateID', 'Addition');
eval(COMP_INIT);
$Chain = array();
$PatternID = $TemplateID;
do {
$Pattern = System_XML(SPrintF('tables/%s.xml', $PatternID));
if (Is_Error($Pattern)) {
return ERROR | @Trigger_Error(500);
}
Array_UnShift($Chain, $Pattern);
$PatternID = isset($Pattern['RootID']) ? $Pattern['RootID'] : FALSE;
} while ($PatternID);
if (!Is_Null($Addition)) {
$Chain[] = $Addition;
}
$Template = System_XML('tables/Common.xml');
if (Is_Error($Template)) {
return ERROR | @Trigger_Error(500);
}
foreach ($Chain as $Pattern) {
if (isset($Pattern['Cut'])) {
Array_Cut($Template, $Pattern['Cut']);
}
Array_Union($Template, $Pattern);
}
$Columns =& $Template['Columns'];
foreach (Array_Keys($Columns) as $ColumnID) {
$Column = $Template['Column'];
$Add = $Column['Add'];
if (isset($Column['Cut'])) {
Array_Cut($Add, $Column['Cut']);
示例10: Is_Array
}
}
}
}
#-------------------------------------------------------------------------
if (isset($User['Profiles'])) {
#-----------------------------------------------------------------------
$Profiles = $User['Profiles'];
#-----------------------------------------------------------------------
$Profiles = Is_Array($Profiles) ? $Profiles : array();
#-----------------------------------------------------------------------
foreach ($Profiles as $Profile) {
#---------------------------------------------------------------------
$pAttribs = (array) $Profile['Attribs'];
#---------------------------------------------------------------------
$Template = System_XML(SPrintF('profiles/%s.xml', $Profile['TemplateID']));
if (Is_Error($Template)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------
$tAttribs = $Template['Attribs'];
#---------------------------------------------------------------------
foreach (Array_Keys($tAttribs) as $AttribID) {
#-------------------------------------------------------------------
if (!isset($pAttribs[$AttribID])) {
$pAttribs[$AttribID] = $tAttribs[$AttribID]['Value'];
}
}
#---------------------------------------------------------------------
$Replace = Array_ToLine($pAttribs, '%');
#---------------------------------------------------------------------
示例11: DB_Types
function DB_Types($Row, $ActionID = 'Compress')
{
/******************************************************************************/
$__args_types = array('array', 'string');
#-------------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/******************************************************************************/
$Types = System_XML('config/TypesDB.xml');
if (!Is_Error($Types)) {
#-------------------------------------------------------------------------------
foreach (Array_Keys($Types) as $ColumnID) {
#-------------------------------------------------------------------------------
$Type = $Types[$ColumnID];
#-------------------------------------------------------------------------------
if (!isset($Row[$ColumnID])) {
continue;
}
#-------------------------------------------------------------------------------
$Column =& $Row[$ColumnID];
#-------------------------------------------------------------------------------
if (Is_Null($Column)) {
continue;
}
#-------------------------------------------------------------------------------
$Column = Comp_Load(SPrintF('Formats/%s/%s', $ActionID, $Type), $Column);
if (Is_Error($Column)) {
return ERROR | @Trigger_Error('[DB_Types]: не удалось отформатировать значение');
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Row;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
}
示例12: Wizard_ToString
function Wizard_ToString($Amount, $Base = 'RUR')
{
/****************************************************************************/
$__args_types = array('double', 'string', 'string');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$Base = System_XML(SPrintF('config/%s.xml', $Base));
if (Is_Error($Base)) {
return ERROR | @Trigger_Error('[Wizard_ToString]: не удалось загрузить шаблоны');
}
#-----------------------------------------------------------------------------
$Discharges = $Base['Discharges'];
#-----------------------------------------------------------------------------
$Result = array();
#-----------------------------------------------------------------------------
$j = 0;
#-----------------------------------------------------------------------------
$Integer = (int) $Amount;
#-----------------------------------------------------------------------------
while ($Integer > 0) {
#---------------------------------------------------------------------------
$Section = array();
#---------------------------------------------------------------------------
$Discharge = $Discharges[SPrintF('ID%u', $j++)];
#---------------------------------------------------------------------------
$Integer = $Integer / $Base['Separate'];
#---------------------------------------------------------------------------
$String = SPrintF(SPrintF('%%0%uu', StrLen($Base['Separate']) - 1), (string) Round(($Integer - (int) $Integer) * 1000));
#---------------------------------------------------------------------------
$Char0 = $String[0];
$Char1 = $String[1];
$Char2 = $String[2];
#---------------------------------------------------------------------------
$Digit = $Char0;
#---------------------------------------------------------------------------
if ($Digit) {
$Section[] = $Discharge[SPrintF('ID%u', $Digit)]['ID2'];
}
#---------------------------------------------------------------------------
$Digit = SPrintF('%s%s', $Char1, $Char2);
#---------------------------------------------------------------------------
$IsSimple = $Digit < 20 && $Digit > 10;
#---------------------------------------------------------------------------
$Digit = $Char1;
#---------------------------------------------------------------------------
if ($Digit) {
$Section[] = $Discharge[$IsSimple ? SPrintF('ID%u', $Char2) : SPrintF('ID%u', $Digit)][$IsSimple ? 'ID3' : 'ID1'];
}
#---------------------------------------------------------------------------
if (!$IsSimple) {
#-------------------------------------------------------------------------
$Digit = $Char2;
#-------------------------------------------------------------------------
if ($Digit) {
$Section[] = $Discharge[SPrintF('ID%s', $Digit)]['ID0'];
}
}
#---------------------------------------------------------------------------
$Section[] = $Discharge[SPrintF('ID%u', $String[2])][SPrintF('ID%u', 9 - ($IsSimple ? -1 : 2))];
#---------------------------------------------------------------------------
Array_UnShift($Result, Implode(' ', $Section));
#---------------------------------------------------------------------------
$Integer = (int) $Integer;
}
#-----------------------------------------------------------------------------
return SPrintF('%s %02u %s', Implode(' ', $Result), Round(($Amount - (int) $Amount) * 100), $Base['Residue']);
}
示例13: array
#-------------------------------------------------------------------------------
$Table[] = array('Протокол', $Server['Protocol']);
#-------------------------------------------------------------------------------
$Table[] = array('Адрес сервера', $Server['Address']);
#-------------------------------------------------------------------------------
$Table[] = array('Порт', $Server['Port']);
#-------------------------------------------------------------------------------
$Table[] = array('Логин', $Server['Login']);
#-------------------------------------------------------------------------------
# TODO проверять опцию конфига - показывать или нет
#$Table[] = Array('Пароль',$Server['Password']);
$Table[] = array('Пароль', $Settings['PasswordShow'] ? $Server['Password'] : '************');
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Template = System_XML(SPrintF('servers/%s.xml', $Server['TemplateID']));
if (Is_Error($Template)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (isset($Template['Attribs'])) {
#-------------------------------------------------------------------------------
foreach (Array_Keys($Template['Attribs']) as $AttribID) {
#-------------------------------------------------------------------------------
$Attrib = $Template['Attribs'][$AttribID];
#-------------------------------------------------------------------------------
switch ($Template['Attribs'][$AttribID]['Type']) {
case 'Input':
# No more...
# No more...
case 'Hidden':
示例14: WhoIs_Check
function WhoIs_Check($DomainName, $ZoneName, $IsAvalible = FALSE)
{
#-------------------------------------------------------------------------------
Debug(SPrintF('[system/libs/WhoIs]: run function WhoIs_Check, Domain = %s.%s', $DomainName, $ZoneName));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$CacheID = SPrintF('WhoIs-%s.%s', $DomainName, $ZoneName);
#-------------------------------------------------------------------------------
$Answer = CacheManager::get($CacheID);
#-------------------------------------------------------------------------------
if (!$Answer) {
#-------------------------------------------------------------------------------
# смотрим доменную зону, на предмет того использовать ли данные whois сервера, или юзать запросы к регистратору
$DomainZones = System_XML('config/DomainZones.xml');
if (Is_Error($DomainZones)) {
return ERROR | @Trigger_Error('[comp/www/API/WhoIs]: не удалось загрузить базу WhoIs серверов');
}
#-------------------------------------------------------------------------------
$IsSuppoted = FALSE;
#-------------------------------------------------------------------------------
foreach ($DomainZones as $Zone) {
#-------------------------------------------------------------------------------
if ($Zone['Name'] == $ZoneName) {
#-------------------------------------------------------------------------------
$IsSuppoted = TRUE;
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
if (!$IsSuppoted || $Zone['IsUseRegistratorWhoIs']) {
#-------------------------------------------------------------------------------
if (!$IsSuppoted) {
Debug(SPrintF('[comp/www/API/WhoIs]: доменная зона не поддерживается'));
}
#-------------------------------------------------------------------------------
if ($IsSuppoted && $Zone['IsUseRegistratorWhoIs']) {
Debug(SPrintF('[comp/www/API/WhoIs]: принудительное использование WhoIs регистратора'));
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# чекаем доменную зону
$Regulars = Regulars();
#-------------------------------------------------------------------------------
if (!Preg_Match($Regulars['DomainZone'], $ZoneName)) {
return ERROR | @Trigger_Error(SPrintF('[comp/www/API/WhoIs]: неверная доменная зона (%s)', $ZoneName));
}
#-------------------------------------------------------------------------------
# достаём список серверов на которых есть такой тариф
$Servers = DB_Select('DomainSchemes', array('ServerID'), array('Where' => SPrintF('`Name` = "%s"', $ZoneName)));
#-------------------------------------------------------------------------------
switch (ValueOf($Servers)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return new gException('REGISTRATOR_SERVER_NOT_FOUND', 'Не найдены активные сервера регистраторов');
case 'array':
#-------------------------------------------------------------------------------
$Array = array();
#-------------------------------------------------------------------------------
foreach ($Servers as $Server) {
$Array[] = $Server['ServerID'];
}
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
# достаём список активных серверов регистраторов
$Servers = DB_Select('Servers', array('ID', 'Address', 'Params'), array('Where' => array(SPrintF('`ID` IN (%s)', Implode(',', $Array)), '`IsActive` = "yes"'), 'SortOn' => 'Address'));
#-------------------------------------------------------------------------------
switch (ValueOf($Servers)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return new gException('REGISTRATOR_SERVER_NOT_FOUND', 'Не найдены активные сервера регистраторов');
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
# перебираем регистраторов
$UseServer = FALSE;
#-------------------------------------------------------------------------------
foreach ($Servers as $iServer) {
#-------------------------------------------------------------------------------
# если это не проверка доступности и в настройках сервера не стоит галка про получение WhoIs - пропускаем
if (!$IsAvalible) {
if (!$iServer['Params']['IsFetchWhoIs']) {
continue;
}
}
#-------------------------------------------------------------------------------
# достаём использованные запросы к регистратору, на данную минуту
//.........这里部分代码省略.........
示例15: array
$Table[] = array('Пароль', $Comp);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($ServerID) {
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('name' => 'ServerID', 'type' => 'hidden', 'value' => $Server['ID'], 'style' => 'width: 100%;'));
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Form->AddChild($Comp);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Template = System_XML(SPrintF('servers/%s.xml', $TemplateID));
if (Is_Error($Template)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Template['Attribs'])) {
#-------------------------------------------------------------------------------
$Attribs = $Template['Attribs'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Replace = Array_ToLine($__USER, '%');
#-------------------------------------------------------------------------------
foreach (Array_Keys($Attribs) as $AttribID) {
#-------------------------------------------------------------------------------
$Attrib = $Attribs[$AttribID];