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


PHP eZSys::siteDir方法代码示例

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


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

示例1: sendMail

 function sendMail(ezcMail $mail)
 {
     $separator = "/";
     $mail->appendExcludeHeaders(array('to', 'subject'));
     $headers = rtrim($mail->generateHeaders());
     // rtrim removes the linebreak at the end, mail doesn't want it.
     if (count($mail->to) + count($mail->cc) + count($mail->bcc) < 1) {
         throw new ezcMailTransportException('No recipient addresses found in message header.');
     }
     $additionalParameters = "";
     if (isset($mail->returnPath)) {
         $additionalParameters = "-f{$mail->returnPath->email}";
     }
     $sys = eZSys::instance();
     $fname = time() . '-' . rand() . '.mail';
     $qdir = eZSys::siteDir() . eZSys::varDirectory() . $separator . 'mailq';
     $data = $headers . ezcMailTools::lineBreak();
     $data .= ezcMailTools::lineBreak();
     $data .= $mail->generateBody();
     $data = preg_replace('/(\\r\\n|\\r|\\n)/', "\r\n", $data);
     $success = eZFile::create($fname, $qdir, $data);
     if ($success === false) {
         throw new ezcMailTransportException('The email could not be sent by sendmail');
     }
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:25,代码来源:eznewsletterfiletransport.php

示例2: number_format

        if ($cacheItem['path'] == 'var/cache/ini') {
            $cachedir = eZSys::siteDir() . '/' . $cacheItem['path'];
        } else {
            $cachedir = eZSys::cacheDirectory() . '/' . $cacheItem['path'];
        }
        $count = sysInfoTools::countFilesInDir($cachedir);
        $cacheFilesList[$cacheItem['name']]['count'] = $count;
        if ($count) {
            $cacheFilesList[$cacheItem['name']]['size'] = number_format(sysInfoTools::countFilesSizeInDir($cachedir));
        } else {
            $cacheFilesList[$cacheItem['name']]['size'] = "";
        }
    }
}
// q: are we 100% sure that the eZ5 cache is always at that location?
if (class_exists('Symfony\\Component\\HttpKernel\\Kernel') && is_dir($ezp5CacheDir = eZSys::siteDir() . '/../ezpublish/cache')) {
    foreach (glob($ezp5CacheDir . '/*', GLOB_ONLYDIR) as $envDir) {
        $env = basename($envDir);
        foreach (glob($envDir . '/*', GLOB_ONLYDIR) as $cacheDir) {
            $cache = basename($cacheDir);
            $cacheName = "Symfony/{$env}/{$cache}";
            $count = sysInfoTools::countFilesInDir($cacheDir);
            $cacheFilesList[$cacheName] = array('path' => "ezpublish/cache/{$env}/{$cache}", 'size' => $count ? number_format(sysInfoTools::countFilesSizeInDir($cacheDir)) : "", 'count' => $count);
        }
    }
}
if ($Params['viewmode'] == 'json') {
    $response_type = $Params['viewmode'];
    $response_data = $cacheFilesList;
    return;
}
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:cachestats.php

示例3: str_replace

/**
 * Display a log file
 *
 * @author G. Giunta
 * @copyright (C) G. Giunta 2014-2016
 * @license Licensed under GNU General Public License v2.0. See file license.txt
 *
 * @todo add support for if-modified-since, etag headers
 */
$module = $Params['Module'];
$desiredLog = str_replace(':', '/', $Params['logfile']);
$logName = '';
$isDebugLog = false;
$desiredLogPath = dirname($desiredLog);
if ($desiredLogPath != 'var/log' && $desiredLogPath != eZSys::varDirectory() . '/' . $ini->variable('FileSettings', 'LogDir') && $desiredLogPath != 'symfony') {
    return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
}
if ($desiredLogPath == 'symfony') {
    $logfile = eZSys::siteDir() . '/../ezpublish/logs/' . basename($desiredLog);
} else {
    $logfile = eZSys::siteDir() . '/' . $desiredLog;
}
if (!file_exists($logfile)) {
    return $module->handleError(eZError::KERNEL_NOT_FOUND, 'kernel');
} else {
    $mdate = gmdate('D, d M Y H:i:s', filemtime($logfile)) . ' GMT';
    header('Content-Type: text/plain');
    header("Last-Modified: {$mdate}");
    readfile($logfile);
    eZExecution::cleanExit();
}
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:customlogview.php

示例4: exit

        $parameters['pass'] = $mailSettings->variable($account, 'Password');
    }
    if (testConnection($parameters)) {
        $serverlist[$i] = $parameters;
        $i++;
    }
}
if (count($serverlist) == 0) {
    $cli->output("No valid mailserver accounts found!");
    exit(1);
}
$cli->output("Available accounts: " . count($serverlist));
// get mail-files
$sys = eZSys::instance();
$separator = $sys->osType() == 'win32' ? "\\" : "/";
$qdir = eZSys::siteDir() . eZSys::varDirectory() . $separator . 'mailq' . $separator;
$cli->output("Fetching mail source files");
$mailFiles = glob($qdir . '*.mail');
$cli->output("Sending " . count($mailFiles) . " emails");
$robinCounter = 0;
$active_server = 1;
$time_start = microtime_float2();
$smtp = getConnection($active_server, $serverlist);
$allowPersistent = $mailSettings->variable('SMTPClusterSettings', 'PersistentConnection') == 'enabled' ? true : false;
for ($i = 0; $i < count($mailFiles); $i++) {
    // sending message
    $email = file_get_contents($mailFiles[$i]);
    $lines = file($mailFiles[$i]);
    // get from and to
    $regex = regexEmail();
    $expression = "/({$regex})/";
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:cluster_send.php

示例5: createFile

 function createFile($message)
 {
     $sys = eZSys::instance();
     $lineBreak = $sys->osType() == 'win32' ? "\r\n" : "\n";
     $separator = $sys->osType() == 'win32' ? "\\" : "/";
     $fname = time() . '-' . rand() . '.sms';
     $qdir = eZSys::siteDir() . eZSys::varDirectory() . $separator . 'mailq';
     $data = $message;
     $data = preg_replace('/(\\r\\n|\\r|\\n)/', "\r\n", $data);
     // echo 'eZFile::create('.$fname.', '.$qdir.', '.$data.');';
     eZFile::create($fname, $qdir, $data);
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:12,代码来源:ezsms.php

示例6: foreach

foreach (scandir('var/log') as $log) {
    $logfile = "var/log/{$log}";
    if (is_file($logfile) && substr($log, -4) == '.log' && !in_array($log, array('error.log', 'warning.log', 'debug.log', 'notice.log', 'strict.log'))) {
        $logFilesList[$log] = array('path' => $logfile, 'count' => '[1]', 'size' => filesize($logfile), 'modified' => filemtime($logfile), 'link' => 'sysinfo/customlogview/' . str_replace(array('/', '\\'), ':', $logfile));
    }
}
$logDir = eZSys::varDirectory() . '/' . $ini->variable('FileSettings', 'LogDir');
foreach (scandir($logDir) as $log) {
    $logfile = "{$logDir}/{$log}";
    if (is_file($logfile) && substr($log, -4) == '.log') {
        $logFilesList[$log] = array('path' => $logfile, 'count' => '[1]', 'size' => filesize($logfile), 'modified' => filemtime($logfile), 'link' => 'sysinfo/customlogview/' . str_replace(array('/', '\\'), ':', $logfile));
    }
}
// q: are we 100% sure that the eZ5 logs are always at that location?
if (class_exists('Symfony\\Component\\HttpKernel\\Kernel') && is_dir($ezp5CacheDir = eZSys::siteDir() . '/../ezpublish/cache')) {
    $logDir = eZSys::siteDir() . '/../ezpublish/logs';
    foreach (scandir($logDir) as $log) {
        $logfile = "{$logDir}/{$log}";
        if (is_file($logfile) && substr($log, -4) == '.log') {
            $logFilesList[$log] = array('path' => "Symfony/{$log}", 'count' => '[1]', 'size' => filesize($logfile), 'modified' => filemtime($logfile), 'link' => 'sysinfo/customlogview/' . 'symfony:' . $log);
        }
    }
}
// windows friendly
foreach ($logFilesList as &$desc) {
    $desc['path'] = str_replace('\\', '/', $desc['path']);
}
if ($Params['viewmode'] == 'json') {
    $response_type = $Params['viewmode'];
    $response_data = $logFilesList;
    return;
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:logstats.php

示例7: foreach

foreach ($cacheList as $cacheItem) {
    if ($cacheItem['path'] != false && $cacheItem['enabled']) {
        $cacheDirsList[$cacheItem['id']] = $cacheItem['path'];
        $cacheDirsList2[$cacheItem['id']] = false;
    }
}
if ($http->hasPostVariable('SearchText') && $http->hasPostVariable('SearchCaches')) {
    $ini = eZINI::instance();
    $cachedir = eZSys::cacheDirectory();
    //$cachedir .= "/" .$ini->variable( 'ContentSettings', 'CacheDir' );
    $searchtext = $http->postVariable('SearchText');
    $is_regexp = $http->hasPostVariable('SearchType') && $http->postVariable('SearchType') == 'Regexp';
    foreach ($http->postVariable('SearchCaches') as $cache) {
        if (array_key_exists($cache, $cacheDirsList)) {
            // take care: this is hardcoded from knowledge of cache structure...
            if ($cacheDirsList[$cache] == 'var/cache/ini') {
                $filelist = array_merge($filelist, sysInfoTools::searchInFiles($searchtext, eZSys::siteDir() . '/' . $cacheDirsList[$cache], $is_regexp));
            } else {
                $filelist = array_merge($filelist, sysInfoTools::searchInFiles($searchtext, $cachedir . '/' . $cacheDirsList[$cache], $is_regexp));
            }
            $cacheDirsList2[$cache] = true;
        }
    }
    //print_r($filelist);
}
$tpl->setVariable('filelist', $filelist);
$tpl->setVariable('list_count', count($filelist));
$tpl->setVariable('searchtext', $searchtext);
$tpl->setVariable('cachelist', $cacheDirsList2);
$tpl->setVariable('deletedfiles', $deletedfiles);
$tpl->setVariable('is_regexp', $is_regexp);
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:cachesearch.php


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