• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP setFn函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中setFn函数的典型用法代码示例。如果您正苦于以下问题:PHP setFn函数的具体用法?PHP setFn怎么用?PHP setFn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('beforeOperation', function ($Call) {
    if (isset($Call['EV'])) {
        $Call['Data']['EV'] = $Call['EV'];
    } else {
        $Call['Data']['EV'] = 0;
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:16,代码来源:EV.php


示例2: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Calculate', function ($Call) {
    if (preg_match_all('/href=\\=/', $Call['Value'], $Pockets)) {
        return count($Pockets) * $Call['Antispam']['Link']['Weight'];
    } else {
        return 0;
    }
});
开发者ID:trickyplan,项目名称:codeine,代码行数:15,代码来源:Links.php


示例3: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    if (isset($Call['Request'])) {
        foreach ($Call['HTTP']['Filter']['Request']['Rules'] as $FilterName => $Filter) {
            foreach ($Filter['Match'] as $Match) {
                if (F::Diff($Match, $Call['Request']) === null) {
                    if ($Filter['Decision']) {
                    } else {
                        F::Log('HTTP Request Filter *' . $FilterName . '* matched', LOG_WARNING, 'Security');
                        return false;
                    }
                }
            }
        }
    }
    return true;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:24,代码来源:Request.php


示例4: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description Exec Parslet 
 * @package Codeine
 * @version 6.0
 */
setFn('Parse', function ($Call) {
    foreach ($Call['Parsed'][2] as $IX => $Match) {
        $Root = simplexml_load_string('<root ' . $Call['Parsed'][1][$IX] . '></root>');
        $Engine = isset($Root->attributes()->engine) ? (string) $Root->attributes()->engine : 'Date';
        // TODO Due bug 13744 at w3c validator, time tag temporary diabled.
        // $Outer = '<time datetime="'.date(DATE_ISO8601, $Match).'">'.date($Format, $Inner).'</time>';
        $Outer = ['Value' => $Match];
        if (isset($Root->attributes()->format)) {
            $Outer['Format'] = (string) $Root->attributes()->format;
        }
        $Outer = F::Run('Formats.Date.' . $Engine, 'Format', $Outer);
        $Call['Output'] = str_replace($Call['Parsed'][0][$IX], $Outer, $Call['Output']);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:23,代码来源:Datetime.php


示例5: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Catch', function ($Call) {
    $Call['Run'] = ['Service' => 'Error.Page', 'Method' => 'Do', 'Call' => ['Code' => 403]];
    return $Call;
});
setFn('Do', function ($Call) {
    $Call['Page']['Title'] = $Call['Code'];
    $Call['Page']['Description'] = 'TODO';
    $Call['Page']['Keywords'] = array('TODO');
    $Call['Layouts'] = [['Scope' => 'Default', 'ID' => 'Main'], ['Scope' => 'Project', 'ID' => 'Zone']];
    if (isset($Call['Reason'])) {
        $Call['Output']['Content'] = [['Type' => 'Template', 'Scope' => 'Error/' . $Call['Code'], 'ID' => $Call['Reason']]];
    } else {
        $Call['Output']['Content'] = [['Type' => 'Template', 'Scope' => 'Error', 'ID' => $Call['Code']]];
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:24,代码来源:Page.php


示例6: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    $Call = F::Apply(null, 'Input', $Call);
    $Call = F::Apply(null, 'Render', $Call);
    $Call = F::Apply(null, 'Output', $Call);
    return $Call;
});
setFn('Input', function ($Call) {
    return $Call;
});
setFn('Render', function ($Call) {
    return $Call;
});
setFn('Output', function ($Call) {
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:23,代码来源:Ad.php


示例7: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description: Simple HTML Renderer
 * @package Codeine
 * @version 8.x
 */
setFn('Render', function ($Call) {
    $finfo = new finfo(FILEINFO_MIME);
    if (is_array($Call['Output']['Content'])) {
        $Call['Output']['Content'] = implode('', $Call['Output']['Content']);
    }
    $Call['Output'] = $Call['Output']['Content'];
    $Call['HTTP']['Headers']['Content-type:'] = $finfo->buffer($Call['Output']);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:17,代码来源:RAW.php


示例8: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 7.6,2
 */
setFn('Widget', function ($Call) {
    return F::Apply($Call['Modes'][$Call['Mode']], 'Widget', $Call);
});
setFn('Check', function ($Call) {
    if (!isset($Call['CAPTCHA']['Bypass'])) {
        if (!F::Run($Call['Modes'][$Call['Mode']], 'Check', $Call)) {
            F::Log('CAPTCHA Failed from IP ' . F::Live($Call['HTTP']['IP']), LOG_ERR, 'Security');
            $Call['Failure'] = true;
            $Call = F::Hook('CAPTCHA.Failed', $Call);
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:21,代码来源:CAPTCHA.php


示例9: foreach

        foreach ($Locations as $Location) {
            if (!isset($Call['Location']['Slug']) or null === $Call['Location']['Slug']) {
                $Location['URL'] = '/' . $Location['Slug'];
            } else {
                if (preg_match('@^/' . $Call['Location']['Slug'] . '@Ssuu', $Call['HTTP']['URL'])) {
                    $Location['URL'] = str_replace($Call['Location']['Slug'], $Location['Slug'], $Call['HTTP']['URL']);
                } else {
                    $Location['URL'] = '/' . $Location['Slug'];
                }
            }
            $Location['URL'] = $Call['HTTP']['Proto'] . $Call['HTTP']['Host'] . $Location['URL'];
            if (isset($Call['Location']['ID']) && $Location['ID'] == $Call['Location']['ID']) {
                $Call['Output']['Content'][] = '<option selected value="' . $Location['Slug'] . '"><a href="' . $Location['Slug'] . '">' . $Location['Title'] . '</a></option>';
            } else {
                $Call['Output']['Content'][] = '<option value="' . $Location['Slug'] . '"><a href="' . $Location['Slug'] . '">' . $Location['Title'] . '</a></option>';
            }
        }
    }
    return $Call;
});
setFn('Select', function ($Call) {
    if ($Call['Location'] != $Call['Session']['Location']) {
        F::Run('Session', 'Write', $Call, ['Session Data' => ['Location' => $Call['Location']]]);
    }
    if (isset($_SERVER['HTTP_REFERER'])) {
        $Call = F::Apply('System.Interface.HTTP', 'Redirect', $Call, ['Location' => $_SERVER['HTTP_REFERER']]);
    } else {
        $Call = F::Apply('System.Interface.HTTP', 'Redirect', $Call, ['Location' => '/']);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Select.php


示例10: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    $Call['HTTP']['Agent'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
    F::Log($Call['HTTP']['Agent'], LOG_INFO);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:13,代码来源:Agent.php


示例11: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Write', function ($Call) {
    $Output = $Call['Data'][0];
    $Output = preg_replace('/\\*(.*)\\*/SsUu', '$1', implode(PHP_EOL, (array) $Output));
    return $Output;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:13,代码来源:RAW.php


示例12: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    time_nanosleep($Call['Seconds'], $Call['Seconds'] - round($Call['Seconds']) * 1000000000);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:12,代码来源:Nano.php


示例13: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    if (is_string($Call['Value'])) {
        $Call['Value'] = strip_tags($Call['Value']);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:14,代码来源:StripTags.php


示例14: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    $Call = F::Hook('beforeIncreaseDo', $Call);
    $Call = F::Run('Entity', 'Load', $Call);
    if (isset($Call['Nodes'][$Call['Key']]['Widgets']['Write']) or isset($Call['Nodes'][$Call['Key']]['Widgets']['Update'])) {
        $Data = F::Run('Entity', 'Read', $Call, ['One' => true]);
        $Data = F::Dot($Data, $Call['Key'], F::Dot($Data, $Call['Key']) + $Call['Value']);
        F::Run('Entity', 'Update', $Call, ['Data' => $Data]);
        $Call['Output']['Content'][] = 'OK';
    }
    $Call = F::Hook('afterIncreaseDo', $Call);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:20,代码来源:Increase.php


示例15: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 7.0
 */
setFn('Parse', function ($Call) {
    foreach ($Call['Parsed'][0] as $Ix => $Match) {
        $Round = simplexml_load_string($Match);
        // FIXME Абстрагировать этот пиздец
        $Call['Output'] = str_replace($Call['Parsed'][0][$Ix], round((double) $Round, (int) $Round->attributes()->precision), $Call['Output']);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:16,代码来源:Round.php


示例16: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Process', function ($Call) {
    $Call['Value'] = preg_replace('/\\(r\\)/', '®', $Call['Value']);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:12,代码来源:Registered.php


示例17: setFn

setFn('Write', function ($Call) {
    if (isset($Call['Link'])) {
    } else {
        $Call['Link'] = F::Run(null, 'Open', $Call);
    }
    self::$_Perfect = false;
    if (isset($Call['From'])) {
        $Screen = $Call['From'];
    } elseif (isset($Call['Project']['Title'])) {
        $Screen = $Call['Project']['Title'] . ' <' . $Call['Username'] . '>';
    } else {
        $Screen = 'Codeine <' . $Call['Username'] . '>';
    }
    $Call['Headers']['From'] = $Screen;
    $Call['Headers']['To'] = $Call['Scope'];
    $Call['Headers']['Subject'] = $Call['Where']['ID'];
    $mime = new Mail_mime();
    // Setting the body of the email
    $mime->setParam('html_charset', 'utf-8');
    $mime->setParam('text_charset', 'utf-8');
    $mime->setParam('head_charset', 'utf-8');
    if (is_array($Call['Data'])) {
        $Call['Data'] = implode(PHP_EOL, $Call['Data']);
    }
    if (isset($Call['HTML Mail']) && $Call['HTML Mail']) {
        $mime->setHTMLBody($Call['Data']);
        $Call['Headers']['Content-Type'] = 'text/html; charset=utf-8';
    } else {
        $mime->setTXTBody(strip_tags($Call['Data']));
    }
    $Call['Data'] = $mime->get(['text_charset' => 'utf-8']);
    $Call['Headers'] = $mime->headers($Call['Headers']);
    F::Log('Sending mail "' . $Call['Where']['ID'] . '" to ' . $Call['Scope'] . ' with ' . $Call['Server'], LOG_INFO, 'Administrator');
    $Result = $Call['Link']->send($Call['Scope'], $Call['Headers'], $Call['Data']);
    if ($Result instanceof PEAR_Error) {
        F::Log($Result->getMessage(), LOG_ERR, 'Administrator');
    }
    // Temp.
    return $Call['Data'];
});
开发者ID:trickyplan,项目名称:codeine,代码行数:40,代码来源:SMTP.php


示例18: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('beforeIOWrite', function ($Call) {
    if (F::Dot($Call, 'Storages.' . $Call['Storage'] . '.Journal') == true) {
        F::Log([F::Dot($Call, 'Storage'), F::Dot($Call, 'Where'), F::Dot($Call, 'Data'), F::Dot($Call, 'Reason')], LOG_WARNING, 'Administrator');
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:14,代码来源:Journal.php


示例19: setFn

/* Codeine
 * @author [email protected]
 * @description: Фронт контроллер
 * @package Codeine
 * @version 8.x
 * @date 31.08.11
 * @time 1:12
 */
setFn('Run', function ($Call) {
    // В этом месте, практически всегда, происходит роутинг.
    $Call = F::Hook('beforeFrontRun', $Call);
    // Если передан нормальный вызов, совершаем его
    F::Log('Front Controlled *' . $Call['Service'] . ':' . $Call['Method'] . '* started', LOG_NOTICE);
    if (F::Dot($Call, 'Skip Front')) {
        F::Log('Front Skip Enabled', LOG_NOTICE);
    } else {
        if (F::isCall($Call['Run'])) {
            if (!isset($Call['Run']['Method'])) {
                $Call['Run']['Method'] = 'Do';
            }
            list($Call['Service'], $Call['Method']) = [$Call['Run']['Service'], $Call['Run']['Method']];
            if (isset($Call['Run']['Call'])) {
                F::Log($Call['Run']['Call'], LOG_INFO);
            }
            $Call = F::Live($Call['Run'], $Call);
        }
    }
    // А здесь - рендеринг
    $Call = F::Hook('afterFrontRun', $Call);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Front.php


示例20: setFn

<?php

/* Codeine
 * @author [email protected]
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Process', function ($Call) {
    if (isset($Call['Map']) && is_array($Call['Map'])) {
        if (preg_match_all('@var\\("(.*)"\\)@SsUu', $Call['Value'], $Pockets)) {
            foreach ($Pockets[1] as $IX => $Match) {
                if (isset($Call['Map'][$Match])) {
                    $Call['Value'] = str_replace($Pockets[0][$IX], $Call['Map'][$Match], $Call['Value']);
                }
            }
        }
    }
    return $Call['Value'];
});
开发者ID:trickyplan,项目名称:codeine,代码行数:20,代码来源:Variables.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP setGlobal函数代码示例发布时间:2022-05-15
下一篇:
PHP setFlash函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap