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


PHP fs_director::CheckFileExists方法代码示例

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


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

示例1: doInstallModule

 static function doInstallModule()
 {
     self::$error_message = "";
     self::$error = false;
     if ($_FILES['modulefile']['error'] > 0) {
         self::$error_message = "Couldn't upload the file, " . $_FILES['modulefile']['error'] . "";
     } else {
         $archive_ext = fs_director::GetFileExtension($_FILES['modulefile']['name']);
         $module_folder = fs_director::GetFileNameNoExtentsion($_FILES['modulefile']['name']);
         $module_dir = ctrl_options::GetSystemOption('sentora_root') . 'modules/' . $module_folder;
         if (!fs_director::CheckFolderExists($module_dir)) {
             if ($archive_ext != 'zpp') {
                 self::$error_message = "Package type was not detected as a .zpp (Sentora Package) archive.";
             } else {
                 if (fs_director::CreateDirectory($module_dir)) {
                     if (sys_archive::Unzip($_FILES['modulefile']['tmp_name'], $module_dir . '/')) {
                         if (!fs_director::CheckFileExists($module_dir . '/module.xml')) {
                             self::$error_message = "No module.xml file found in the unzipped archive.";
                         } else {
                             ui_module::ModuleInfoToDB($module_folder);
                             $extra_config = $module_dir . "/deploy/install.run";
                             if (fs_director::CheckFileExists($extra_config)) {
                                 exec(ctrl_options::GetSystemOption('php_exer') . " " . $extra_config . "");
                             }
                             self::$ok = true;
                         }
                     } else {
                         self::$error_message = "Couldn't unzip the archive (" . $_FILES['modulefile']['tmp_name'] . ") to " . $module_dir . '/';
                     }
                 } else {
                     self::$error_message = "Couldn't create module folder in " . $module_dir;
                 }
             }
         } else {
             self::$error_message = "The module " . $module_folder . " is already installed on this server!";
         }
     }
     return;
 }
开发者ID:bbspike,项目名称:sentora-core,代码行数:39,代码来源:controller.ext.php

示例2: fileExists

 static function fileExists($combinedPath)
 {
     if (!fs_director::CheckFileExists($combinedPath)) {
         self::setFlashMessage('debug', 'file does not exist');
         return false;
     }
     self::setFlashMessage('debug', 'file exists');
     return true;
 }
开发者ID:bbspike,项目名称:sentora-core,代码行数:9,代码来源:controller.ext.php

示例3: COUNT

/*
 * Calculate the bandwidth used for each user.
 */
$checksql = $zdbh->query("SELECT COUNT(*) AS total FROM x_vhosts WHERE vh_deleted_ts IS NULL")->fetch();
echo fs_filehandler::NewLine() . "START Calculating bandwidth usage for all client accounts.." . fs_filehandler::NewLine();
if ($checksql['total'] > 0) {
    $domainssql = $zdbh->query("SELECT vh_acc_fk, vh_name_vc FROM x_vhosts WHERE vh_deleted_ts IS NULL");
    while ($domain = $domainssql->fetch()) {
        $domainowner = ctrl_users::GetUserDetail($domain['vh_acc_fk']);
        $bandwidthlog = ctrl_options::GetSystemOption('log_dir') . 'domains/' . $domainowner['username'] . '/' . $domain['vh_name_vc'] . '-bandwidth.log';
        $snapshotfile = ctrl_options::GetSystemOption('log_dir') . 'domains/' . $domainowner['username'] . '/' . $domain['vh_name_vc'] . '-snapshot.bw';
        $bandwidth = 0;
        echo "Processing domain \"" . $domain['vh_name_vc'] . "\"" . fs_filehandler::NewLine();
        if (fs_director::CheckFileExists($bandwidthlog)) {
            fs_filehandler::CopyFile($bandwidthlog, $snapshotfile);
            if (fs_director::CheckFileExists($snapshotfile)) {
                fs_filehandler::ResetFile($bandwidthlog);
                echo "Generating bandwidth.. " . fs_filehandler::NewLine();
                $bandwidth = sys_bandwidth::CalculateFromApacheLog($snapshotfile);
                if (file_exists($snapshotfile)) {
                    @unlink($snapshotfile);
                    echo "usage: " . $bandwidth . " (" . fs_director::ShowHumanFileSize($bandwidth) . ")" . fs_filehandler::NewLine();
                }
            }
        }
        if (!fs_director::CheckForEmptyValue($bandwidth)) {
            //$zdbh->query("UPDATE x_bandwidth SET bd_transamount_bi=(bd_transamount_bi+" . $bandwidth . ") WHERE bd_acc_fk = " . $domain['vh_acc_fk'] . " AND bd_month_in = " . date("Ym") . "");
            $numrows = $zdbh->prepare("UPDATE x_bandwidth SET bd_transamount_bi=(bd_transamount_bi+:bandwidth) WHERE bd_acc_fk = :vh_acc_fk AND bd_month_in = :date");
            $numrows->bindParam(':bandwidth', $bandwidth);
            $date = date("Ym");
            $numrows->bindParam(':date', $date);
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:31,代码来源:OnDaemonRun.hook.php


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