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


PHP F::Live方法代码示例

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


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

示例1: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description <k> tag 
 * @package Codeine
 * @version 8.x
 */
setFn('Parse', function ($Call) {
    if (preg_match_all('@<treekey(.*)>(.*)</treekey>@SsUu', $Call['Value'], $Call['Parsed'])) {
        foreach ($Call['Parsed'][2] as $IX => $Match) {
            $Root = simplexml_load_string('<forkey' . $Call['Parsed'][1][$IX] . '></forkey>');
            $Output = '';
            $Key = (string) $Root->attributes()->key;
            if (($Matched = F::Live(F::Dot($Call['Data'], $Key))) !== null) {
                if (is_array($Matched)) {
                    $Rows = [];
                    F::Map($Matched, function ($Key, $Value, $Data, $NewFullKey, $Array) use(&$Rows) {
                        if (!is_array($Value)) {
                            $Rows[] = [substr($NewFullKey, 1), $Value];
                        }
                    });
                    foreach ($Rows as $Row) {
                        $Output .= strtr($Match, ['<treek/>' => $Row[0], '<treev/>' => $Row[1]]);
                    }
                    $Call['Value'] = str_replace($Call['Parsed'][0][$IX], $Output, $Call['Value']);
                }
            } else {
                $Call['Value'] = str_replace($Call['Parsed'][0][$IX], '', $Call['Value']);
            }
        }
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:TreeKey.php

示例2: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Log', function ($Call) {
    return log($Call['X'], F::Live($Call['Base']));
});
开发者ID:trickyplan,项目名称:codeine,代码行数:11,代码来源:Standart.php

示例3: setFn

setFn('GET', function ($Call) {
    $Call['Layouts'][] = ['Scope' => 'Parser', 'ID' => 'URL'];
    return $Call;
});
setFn('POST', function ($Call) {
    $Call['URL'] = $Call['Request']['Data']['URL'];
    $Call['Data'] = F::Run('Parser.URL', 'Parse', $Call);
    $Call['Output']['Content'][] = ['Type' => 'Block', 'Value' => j($Call['Data'])];
    return $Call;
});
setFn('Parse', function ($Call) {
    if ($Call['Schema'] = F::Run('Parser', 'Discovery', $Call)) {
        F::Log('Schema is ' . $Call['Schema'], LOG_INFO);
        $Schema = F::loadOptions('Parser/' . $Call['Schema']);
        $Call = F::Merge($Call, $Schema);
        $Result = F::Live($Call['Parser']['URL']['Backend'], ['Where' => ['ID' => $Call['URL']]]);
        $Result = array_pop($Result);
        $Call = F::Run('Parser', 'Do', $Call, ['Markup' => $Result]);
        $Slices = explode('/', $Call['Schema']);
        $Call['Entity'] = array_pop($Slices);
        $Call['Data']['Source'] = $Call['URL'];
        if (isset($Call['Parser']['Create']['Auto']) && $Call['Parser']['Create']['Auto']) {
            $Call['Data'] = F::Run('Entity', 'Create', $Call, ['One' => true]);
        }
        if (isset($Call['Data']['ID'])) {
            $Call = F::Run('System.Interface.HTTP', 'Redirect', $Call, ['Redirect' => '/control/' . $Call['Entity'] . '/Show/' . $Call['Data']['ID']]);
        }
    } else {
        $Call['Data'] = null;
    }
    return $Call['Data'];
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:URL.php

示例4: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    if (isset($Call['Service']) && $Call['View']['Renderer'] == 'View.HTML') {
        if (in_array($Call['Service'], $Call['No SEO Audit'])) {
            F::Log('SEO Audit skipped', LOG_INFO, 'Marketing');
        } else {
            if (isset($Call['View']['HTML']) && !isset($Call['Headers']['Location:'])) {
                foreach ($Call['Auditors'] as $Auditor) {
                    $Call = F::Live($Auditor, $Call);
                }
            }
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:22,代码来源:Audit.php

示例5: foreach

    $Call['Node']['Options'] = F::Live($Call['Node']['Options']);
    $Data = [];
    foreach ($Call['Value'] as $Value) {
        if (($Value = array_search($Value, $Call['Node']['Options'])) !== false) {
            $Data[] = $Value;
        }
    }
    return $Data;
});
setFn('Read', function ($Call) {
    $Call['Node']['Options'] = F::Live($Call['Node']['Options']);
    if (is_array($Call['Value'])) {
        foreach ($Call['Value'] as &$Value) {
            if (isset($Call['Node']['Options'][$Value])) {
                $Value = $Call['Node']['Options'][$Value];
            }
        }
    }
    return $Call['Value'];
});
setFn('Where', function ($Call) {
    $Call['Node']['Options'] = F::Live($Call['Node']['Options']);
    $Data = [];
    foreach ($Call['Value'] as &$Value) {
        $Data[] = (int) array_search($Value, $Call['Node']['Options']);
    }
    return $Data;
});
setFn('Populate', function ($Call) {
    return [array_rand(F::Live($Call['Node']['Options']))];
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Enum.php

示例6: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Get', function ($Call) {
    if (isset($Call['Modes'][$Call['Mode']])) {
    } else {
        $Call['Mode'] = 'Normal';
    }
    return F::Live($Call['Modes'][$Call['Mode']], $Call) + $Call['Increment'];
});
开发者ID:trickyplan,项目名称:codeine,代码行数:15,代码来源:Time.php

示例7: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 7.4
 */
setFn('Do', function ($Call) {
    $Call = F::Hook('beforeVerifyDo', $Call);
    if (isset($Call['Where'])) {
        $Call['Where'] = F::Live($Call['Where']);
    }
    // FIXME
    return F::Run(null, $Call['HTTP']['Method'], $Call);
});
setFn('GET', function ($Call) {
    $Call = F::Hook('beforeVerifyGet', $Call);
    if (!isset($Call['Failure'])) {
        $Call['Output']['Content']['Form Widget'] = ['Type' => 'Form', 'Submit' => 'Verify'];
        $Call['Tag'] = isset($Call['Scope']) ? $Call['Scope'] : null;
        $Call['Scope'] = isset($Call['Scope']) ? $Call['Entity'] . '/' . $Call['Scope'] : $Call['Entity'];
        $Call['Layouts'][] = ['Scope' => $Call['Entity'], 'ID' => isset($Call['Custom Layouts']['Verify']) ? $Call['Custom Layouts']['Verify'] : 'Verify', 'Context' => $Call['Context']];
        // Загрузить предопределённые данные и умолчания
        $Call['Data'] = F::Run('Entity', 'Read', $Call, ['Time' => microtime(true)]);
        if (null === $Call['Data']) {
            $Call = F::Hook('onEntityVerifyNotFound', $Call);
        } else {
            foreach ($Call['Data'] as $IX => $cData) {
                foreach ($Call['Nodes'] as $Name => $Node) {
                    if (isset($Node['Verifiable']) && $Node['Verifiable'] && isset($cData[$Name])) {
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Verify.php

示例8: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Send', function ($Call) {
    $Subscribes = F::Run('Entity', 'Read', ['Entity' => 'Subscribe', 'Where' => ['Event' => $Call['Event']]]);
    if (empty($Subscribes)) {
    } else {
        foreach ($Subscribes as $Subscribe) {
            F::Run('IO', 'Write', ['Storage' => $Subscribe['Transport'], 'Scope' => $Subscribe['Target'], 'Data' => F::Live($Subscribe['Message'], $Call)]);
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:18,代码来源:Event.php

示例9:

                    $Widget['Options'] = F::Live($Widget['Options'], $Call);
                } else {
                    $Widget['Options'] = [];
                }
                /*                    if($ic == 0)
                                      $Widget['Autofocus'] = true;*/
                // Если есть значение, добавляем
                if (isset($Call['Data'])) {
                    if (($Widget['Value'] = F::Dot($Call['Data'], $Name)) === null) {
                        if (isset($Node['Default'])) {
                            $Widget['Value'] = F::Live($Node['Default']);
                        }
                    }
                }
                // Упростить
                if (isset($Widget['Value'])) {
                    $Widget['Value'] = F::Live($Widget['Value']);
                } else {
                    $Widget['Value'] = null;
                }
                // Помещаем виджет в поток
                $ic++;
                $Call = F::Apply('Entity.Form.Layout.' . $Call['FormLayout'], 'Add', $Call, ['IC' => $ic, 'Name' => $Name, 'Widget' => $Widget]);
                $Call['Widget'] = null;
            }
        }
    }
    // Вывести
    $Call = F::Hook('afterFilterDo', $Call);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Filter.php

示例10: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description: Фронт контроллер
 * @package Codeine
 * @version 8.x
 * @date 31.08.11
 * @time 1:12
 */
setFn('Run', function ($Call) {
    $Call = F::Live($Call['Apps'][$Call['Step']], $Call);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:14,代码来源:Wizard.php

示例11: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Write', function ($Call) {
    $Call['Value'] = $_FILES['file'];
    $Call['ID'] = F::Run('Security.UID', 'Get', $Call);
    $Call['Data'] = file_get_contents($_FILES['file']['tmp_name']);
    $Call['Name'] = F::Live($Call['Naming'], $Call);
    F::Run('IO', 'Write', $Call, ['Storage' => 'Uploader', 'Scope' => 'wysiwyg', 'Where' => $Call['Name']]);
    $Call['Output']['Content']['filelink'] = '/uploads/wysiwyg/' . $Call['Name'];
    // FIXME Scope support
    return $Call;
});
setFn('Read', function ($Call) {
    $Call['Output']['Content'] = F::Run('IO', 'Read', $Call, ['Storage' => 'Upload', 'Scope' => 'WYSIWYG']);
    if (empty($Call['Output']['Content'])) {
        $Call = F::Hook('onUploaderNotFound', $Call);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:25,代码来源:Uploader.php

示例12: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    F::Log('CLI Interface Started', LOG_NOTICE);
    $Call = F::Hook('beforeInterfaceRun', $Call);
    $Call['HTTP']['IP'] = F::Live($Call['HTTP']['IP'], $Call);
    if (isset($Call['Project']['Hosts'][F::Environment()])) {
        $Call['HTTP']['Host'] = $Call['Project']['Hosts'][F::Environment()];
    }
    $Call['HTTP']['Proto'] = 'https';
    $Call['HTTP']['URL'] = '/';
    if (isset($Call['Skip Run'])) {
        F::Log('Run Skipped, because ' . $Call['Skip Run'], LOG_INFO);
    } else {
        F::Log($Call['Service'] . ':' . $Call['Method'] . ' started', LOG_NOTICE);
        $Call = F::Apply($Call['Service'], $Call['Method'], $Call);
    }
    $Call = F::Hook('afterInterfaceRun', $Call);
    if (is_array($Call) && isset($Call['Output'])) {
        F::Run('IO', 'Write', $Call, ['Storage' => 'Output', 'Where' => $Call['Service'] . ':' . $Call['Method'], 'Data' => $Call['Output']]);
        if (isset($Call['Failure']) && $Call['Failure']) {
            $Call['Return Code'] = 1;
        }
    }
    F::Log('CLI Finished', LOG_NOTICE);
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:CLI.php

示例13: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Live Enum', function ($Call) {
    if (isset($Call['Skip Enum Live'])) {
    } else {
        $Call['Node']['Options'] = F::Live($Call['Node']['Options'], ['Node' => $Call['Node'], 'Name' => $Call['Name'], 'Data' => isset($Call['Data']) ? $Call['Data'] : []]);
    }
    return $Call;
});
setFn('Write', function ($Call) {
    $Call = F::Apply(null, 'Live Enum', $Call);
    if (empty($Call['Node']['Options'])) {
        return null;
    } else {
        return array_search($Call['Value'], $Call['Node']['Options']);
    }
});
setFn('Read', function ($Call) {
    $Call = F::Apply(null, 'Live Enum', $Call);
    if (is_scalar($Call['Value']) && isset($Call['Node']['Options'][$Call['Value']])) {
        return $Call['Node']['Options'][$Call['Value']];
    } else {
        return $Call['Value'];
    }
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Enum.php

示例14: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    return F::Live($Call['Modes'][$Call['Mode']], $Call);
});
开发者ID:trickyplan,项目名称:codeine,代码行数:11,代码来源:Detect.php

示例15: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description HTML Textfield Driver 
 * @package Codeine
 * @version 8.x
 */
setFn('Make', function ($Call) {
    $Options = [];
    $NavlistScope = isset($Call['Scope']) ? $Call['Scope'] : 'Navlist';
    if (isset($Call['Value'])) {
        $Call['Value'] = F::Live($Call['Value']);
    } else {
        $Call['Value'] = 0;
    }
    $Call['Options'] = F::Live($Call['Options']);
    foreach ($Call['Options'] as $Key => $Value) {
        if (is_array($Value)) {
            $Options[] = F::Run('View', 'Load', $Call, ['Scope' => $Call['View']['HTML']['Widget Set'] . '/Widgets', 'ID' => $NavlistScope . '/Element', 'Data' => $Value]);
        } else {
            $Options[] = F::Run('View', 'Load', $Call, ['Scope' => $Call['View']['HTML']['Widget Set'] . '/Widgets', 'ID' => $NavlistScope . '/Header', 'Data' => ['Title' => $Value]]);
        }
    }
    $Call['Value'] = implode('', $Options);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:27,代码来源:Navlist.php


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