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


PHP F::Log方法代码示例

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


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

示例1: setFn

 * @author bergstein@trickyplan.com
 * @description Exec Parslet 
 * @package Codeine
 * @version 8.x
 */
setFn('Parse', function ($Call) {
    foreach ($Call['Parsed'][2] as $IX => $Match) {
        $Root = simplexml_load_string('<root ' . $Call['Parsed'][1][$IX] . '></root>');
        if ($Root->attributes()->type !== null) {
            $Type = (string) $Root->attributes()->type;
        } else {
            $Type = $Call['Parslet']['Exec']['Type'];
        }
        $Match = F::Run('Formats.' . $Type, 'Read', ['Value' => trim($Call['Parsed'][2][$IX])]);
        if ($Match) {
            F::Log($Match, LOG_INFO);
            foreach ($Call['Parslet']['Exec']['Inherited'] as $Key) {
                if (isset($Call[$Key])) {
                    $Match[$Key] = $Call[$Key];
                } else {
                    $Match[$Key] = null;
                }
            }
            if (isset($Match['Exec TTL'])) {
                $RTTL = $Match['Exec TTL'];
            } else {
                $RTTL = 0;
            }
            $Application = F::Run('Code.Flow.Application', 'Run', ['RTTL' => $RTTL, 'Run' => $Match]);
            /*if (F::Environment() == 'Development')
                  $Application['Output'] = '<div class="exec-cached">'.$Application['Output'].'</div>';
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Exec.php

示例2: Mail_mime

        $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,代码行数:31,代码来源:SMTP.php

示例3: setFn

setFn('Do', function ($Call) {
    $IP = $_SERVER['REMOTE_ADDR'];
    foreach ($Call['IP']['Headers'] as $Header) {
        if (isset($_SERVER['HTTP_' . $Header])) {
            $IP = $_SERVER['HTTP_' . $Header];
            break;
        }
    }
    if ($IP == '127.0.0.1' && isset($Call['IP']['Pingback'])) {
        if (($IP = F::Run('IO', 'Read', $Call, ['Storage' => 'Cookie', 'Where' => 'DeveloperIP'])) == null) {
            $Pingback = F::Run('IO', 'Read', ['Storage' => 'Web', 'Where' => $Call['IP']['Pingback'], 'IO One' => true]);
            if (preg_match($Call['IP']['Regex'], $Pingback, $Pockets)) {
                $IP = $Pockets[0];
            } else {
                $IP = '127.0.0.1';
            }
            F::Run('IO', 'Write', $Call, ['Storage' => 'Cookie', 'Where' => 'DeveloperIP', 'Data' => $IP]);
            F::Log('Pingback IP: *' . $IP . '* from *' . $Call['IP']['Pingback'] . '*', LOG_INFO);
        } else {
            F::Log('Pingback IP: *' . $IP . '* from *Cookie*', LOG_INFO);
        }
    } else {
        if (isset($Call['IP']['Substitute'][$IP])) {
            F::Log('IP substituted from *' . $IP . '* to ' . $Call['IP']['Substitute'][$IP], LOG_INFO);
            $IP = $Call['IP']['Substitute'][$IP];
        }
    }
    $Call['HTTP']['IP'] = $IP;
    F::Log('User IP: ' . $IP, LOG_INFO);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:IP.php

示例4: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @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

示例5: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @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

示例6: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Length', function ($Call) {
    if (isset($Call['View']['HTML']['Keywords']) && is_string($Call['View']['HTML']['Keywords'])) {
        $Length = mb_strlen($Call['View']['HTML']['Keywords']);
        if ($Length > $Call['SEO']['Audit']['Keywords']['Length']['Maximum']) {
            $Call = F::Hook('SEO.Audit.Keywords.TooLong', $Call);
            F::Log('SEO Keywords is too long *' . $Length . ' chars* over *' . $Call['SEO']['Audit']['Keywords']['Length']['Maximum'] . '*', LOG_WARNING, 'Marketing');
        } elseif ($Length < $Call['SEO']['Audit']['Keywords']['Length']['Minimum']) {
            $Call = F::Hook('SEO.Audit.Keywords.TooShort', $Call);
            F::Log('SEO Keywords is too short *' . $Length . ' chars* over *' . $Call['SEO']['Audit']['Keywords']['Length']['Minimum'] . '*', LOG_WARNING, 'Marketing');
        } else {
            F::Log('SEO Keywords length is optimal ', LOG_NOTICE, 'Marketing');
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:23,代码来源:Keywords.php

示例7: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 7.x
 */
setFn('Do', function ($Call) {
    $Command = 'jpegoptim ' . $Call['Image']['Cached Filename'] . ' --strip-all';
    F::Log($Command, LOG_INFO);
    F::Log(shell_exec($Command), LOG_INFO);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:14,代码来源:JPEGOptim.php

示例8: proc_open

    if ($Call['JS']['Compress']['JSMin']['Enabled']) {
        $Pipes = [];
        $JSMinCompressor = proc_open($Call['JS']['Compress']['JSMin']['Command'], $Call['JS']['Compress']['JSMin']['Descriptors'], $Pipes);
        if (is_resource($JSMinCompressor)) {
            if ($Call['JS']['Compress']['JSMin']['Expose']) {
                $Compressed = '// JSMin Compressed' . PHP_EOL;
            } else {
                $Compressed = '';
            }
            fwrite($Pipes[0], $Call['JS']['Source']);
            fclose($Pipes[0]);
            $Compressed .= trim(stream_get_contents($Pipes[1]));
            fclose($Pipes[1]);
            if (($Code = proc_close($JSMinCompressor)) == 0) {
                $Call['JS']['Source'] = $Compressed;
                F::Log('[JSMin] ' . $Call['JS']['Fullpath'] . ' compressed', LOG_DEBUG);
            } else {
                F::Log('[JSMin] ' . $Call['JS']['Fullpath'] . ' not compressed', LOG_INFO);
                F::Log('Return code for ' . $Call['JS']['Compress']['JSMin']['Command'] . ': ' . $Code, LOG_DEBUG);
                if ($Call['JS']['Compress']['JSMin']['Disable On Error']) {
                    $Call['JS']['Compress']['JSMin']['Enabled'] = false;
                    // Codeine Magic: Dynamic Reconfiguration FGJ
                    F::Log('[JSMin] Disabled by error', LOG_INFO);
                }
            }
        } else {
            F::Log('[JSMin] Not resource', LOG_WARNING);
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:JSMin.php

示例9: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Run', function ($Call) {
    if (sys_getloadavg()[0] > $Call['Throttler']['CPU Limit']) {
        F::Run('System.Sleep', 'Do', ['Seconds' => $Call['Throttler']['Seconds']]);
        F::Log('Throttled on ' . $Call['Throttler']['Seconds'] . ' seconds', LOG_INFO);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:15,代码来源:Throttler.php

示例10: setFn

 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    $Call['User Agents'] = ["Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0", "Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14", "Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 12.14", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0) Opera 12.14", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/4.0; InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64)", "Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)", "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))", "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; chromeframe/13.0.782.215)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; chromeframe/11.0.696.57)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) chromeframe/10.0.648.205", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.1; SV1; .NET CLR 2.8.52393; WOW64; en-US)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; chromeframe/11.0.696.57)"];
    if (file_exists(Root . '/proxy_http_ip.txt')) {
        F::Log(Root . '/proxy_http_ip.txt detected ', LOG_WARNING);
        $List = file(Root . '/proxy_http_ip.txt');
        foreach ($List as $Line) {
            if (!empty($Line)) {
                $Call['Proxies'][] = trim($Line);
            }
        }
        F::Log(count($Call['Proxies']) . ' proxies loaded', LOG_WARNING);
    }
    foreach ($Call['Proxies'] as $Proxy) {
        F::Log($Proxy, LOG_WARNING);
        $Call['Proxy'] = [];
        list($Call['Proxy']['Host'], $Call['Proxy']['Port']) = explode(':', $Proxy);
        $Call['Agent'] = $Call['User Agents'][array_rand($Call['User Agents'])];
        F::Log('UA: ' . $Call['Agent'] . ' selected', LOG_WARNING);
        F::Log($Call['URL'] . ' fetching', LOG_WARNING);
        $MT = microtime(true);
        $Result = F::Run('IO', 'Read', $Call, ['No Memo' => true, 'Storage' => 'Web', 'Where' => $Call['URL']]);
        $Call['Body'] = array_pop($Result);
        F::Log($Call['URL'] . ' fetched by ' . round((microtime(true) - $MT) * 1000) . ' ms', LOG_WARNING);
        sleep(rand(0, 6));
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Poll.php

示例11: setFn

        } else {
            $Result = null;
        }
    }
    return $Result;
});
setFn('Access Token', function ($Call) {
    $Result = null;
    if (isset($Call['Data']['Facebook']['Auth'])) {
        F::Log('Using FB Token from Data', LOG_INFO);
        $Result['Auth'] = $Call['Data']['Facebook']['Auth'];
    } elseif (isset($Call['Session']['User']['Facebook']['Auth'])) {
        F::Log('Using FB Token from Session', LOG_INFO);
        $Result['Auth'] = $Call['Session']['User']['Facebook']['Auth'];
    } else {
        F::Log('Using FB Token from random users', LOG_INFO);
        $Donor = F::Run('Entity', 'Read', ['Entity' => 'User', 'Where' => ['Facebook.Active' => true], 'Limit' => ['From' => 0, 'To' => 1], 'Sort' => ['Modified' => false], 'One' => true]);
        $Result = $Donor['Facebook'];
        if (isset($Result['Expire']) && $Result['Expire'] > time()) {
        } elseif (isset($Result['Auth'])) {
            $URL = 'https://graph.facebook.com/oauth/access_token';
            $ResultFB = F::Run('IO', 'Read', ['Storage' => 'Web', 'Where' => $URL, 'Data' => ['client_id' => $Call['Facebook']['AppID'], 'client_secret' => $Call['Facebook']['Secret'], 'grant_type' => 'fb_exchange_token', 'fb_exchange_token' => $Result['Auth']]]);
            if ((array) $ResultFB === $ResultFB) {
                $ResultFB = array_pop($ResultFB);
                parse_str($ResultFB, $ResultFB);
            }
            if (isset($ResultFB['access_token'])) {
                F::Run('Entity', 'Update', ['Entity' => 'User', 'Where' => ['Facebook.ID' => $Result['ID']], 'Data' => ['Facebook' => ['Auth' => $ResultFB['access_token'], 'Expire' => time() + $ResultFB['expires']]], 'No' => ['beforeEntityWrite' => true], 'One' => true]);
                F::Run('Code.Run.Delayed', 'Run', ['Delayed Mode' => 'Dirty', 'Run' => ['Service' => 'Entity', 'Method' => 'Update', 'Call' => ['Entity' => 'User', 'Where' => ['Facebook.ID' => $Result['ID']], 'Data' => ['Facebook' => ['Auth' => $ResultFB['access_token'], 'Expire' => time() + $ResultFB['expires']]], 'No' => ['beforeEntityWrite' => true]]]]);
                $Result['Auth'] = $ResultFB['access_token'];
                $Result['Expire'] = $ResultFB['expires'];
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Facebook.php

示例12: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description: 
 * @package Codeine
 * @version 8.x
 */
setFn('Read', function ($Call) {
    $Result = jd($Call['Value'], true);
    if (json_last_error() > 0) {
        F::Log('JSON: ' . json_last_error_msg(), LOG_ERR);
        F::Log($Call['Value'], LOG_ERR);
    }
    return $Result;
});
setFn('Write', function ($Call) {
    return j($Call['Value'], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
});
setFn('Write.Call', function ($Call) {
    $Call['Value'] = j($Call['Value']);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:23,代码来源:JSON.php

示例13: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    if (isset($Call['Current Image']['Thumb']) && !empty($Call['Current Image']['Data'])) {
        try {
            $GImage = new Gmagick();
            $GImage->readimageblob($Call['Current Image']['Data']);
            /*            $GImage->setCompressionQuality($Call['Image']['Quality']);*/
            if (!isset($Call['Current Image']['Height'])) {
                $Call['Current Image']['Height'] = ceil($Call['Current Image']['Width'] / $GImage->getimagewidth() * $GImage->getimageheight());
            }
            if (!isset($Call['Current Image']['Width'])) {
                $Call['Current Image']['Width'] = ceil($Call['Current Image']['Height'] / $GImage->getimageheight() * $GImage->getimagewidth());
            }
            $GImage->cropthumbnailimage($Call['Current Image']['Width'], $Call['Current Image']['Height']);
            $Call['Current Image']['Data'] = $GImage->getImageBlob();
        } catch (Exception $e) {
            F::Log($e->getMessage(), LOG_ERR);
            F::Log($Call['Current Image'], LOG_ERR);
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:29,代码来源:Thumb.php

示例14: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    if (isset($Call['Current Image']['Resample']) && !empty($Call['Current Image']['Data'])) {
        try {
            $GImage = new Gmagick();
            $GImage->readimageblob($Call['Current Image']['Data']);
            if (isset($Call['Current Image']['Height'])) {
            } else {
                $Call['Current Image']['Height'] = ceil($Call['Current Image']['Width'] / $GImage->getimagewidth() * $GImage->getimageheight());
            }
            if (isset($Call['Current Image']['Width'])) {
            } else {
                $Call['Current Image']['Width'] = ceil($Call['Current Image']['Height'] / $GImage->getimageheight() * $GImage->getimagewidth());
            }
            $GImage->resizeImage($Call['Current Image']['Width'], $Call['Current Image']['Height'], Gmagick::FILTER_LANCZOS, 1);
            $Call['Current Image']['Data'] = $GImage->getImageBlob();
        } catch (Exception $e) {
            F::Log($e->getMessage(), LOG_ERR);
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:29,代码来源:Resample.php

示例15: setFn

 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) or isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' or isset($_SERVER['HTTP_X_HTTPS']) && $_SERVER['HTTP_X_HTTPS']) {
        $Call['HTTP']['Proto'] = 'https://';
    } else {
        $Call['HTTP']['Proto'] = 'http://';
    }
    if (isset($Call['HTTP']['Force SSL']) && $Call['HTTP']['Force SSL']) {
        if ($Call['HTTP']['Proto'] !== 'https://') {
            $Call = F::Run('System.Interface.HTTP', 'Remote Redirect', $Call, ['Redirect' => 'https://' . $Call['HTTP']['Host'] . $Call['HTTP']['URI']]);
        }
        if (isset($Call['HTTP']['HSTS']['Enabled']) && $Call['HTTP']['HSTS']['Enabled']) {
            $Header = 'max-age=' . $Call['HTTP']['HSTS']['Expire'];
            if (isset($Call['HTTP']['HSTS']['Subdomains']) && $Call['HTTP']['HSTS']['Subdomains']) {
                $Header .= '; includeSubdomains';
            }
            if (isset($Call['HTTP']['HSTS']['Preload']) && $Call['HTTP']['HSTS']['Preload']) {
                $Header .= '; preload';
            }
            $Call['HTTP']['Headers']['Strict-Transport-Security:'] = $Header;
        }
    }
    if (empty($Call['HTTP']['Proto'])) {
        F::Log('Protocol is *empty*!', LOG_INFO);
    } else {
        F::Log('Protocol is *' . $Call['HTTP']['Proto'] . '*', LOG_INFO);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Protocol.php


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