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


PHP Lib::recurseCopy方法代码示例

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


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

示例1: copyDirectory

 public static function copyDirectory($from, $to)
 {
     if (self::$_files) {
         return 'Can\'t write storage in commit mode';
     }
     $to = Lib::normalizePath($to);
     if (is_file($from)) {
         return 'Origin path is a file';
     }
     if (!is_dir($from)) {
         return 'File not found';
     }
     if (is_file($to)) {
         return 'Destination path is a file';
     }
     if (is_dir($to)) {
         return 'Destination path already exists';
     }
     try {
         Lib::recurseCopy($from, $to);
     } catch (Exception $e) {
         return 'Internal server error';
     }
     return 'true';
 }
开发者ID:KasaiDot,项目名称:SharkDev,代码行数:25,代码来源:user.php

示例2: createUserLinkedProject

 public static function createUserLinkedProject($toUser, $fromUser, $fromProject, $confidentialityLevel = 'private')
 {
     chdir(__DIR__);
     global $shark;
     global $db;
     $toUser = Lib::normalizePath($toUser);
     $fromUser = Lib::normalizePath($fromUser);
     if ($confidentialityLevel !== 'public' && $confidentialityLevel !== 'private') {
         return $shark['msg']['bad-request'];
     }
     if (!self::existsUser($fromUser) && $fromUser !== '.model') {
         return 'User doesn\'t exists';
     }
     if (!is_dir('users/' . $fromUser . '/public/' . $fromProject)) {
         return 'Project not found';
     }
     try {
         mkdir('users/' . $toUser . '/' . $confidentialityLevel . '/' . $fromProject);
         Lib::recurseCopy('users/' . $fromUser . '/public/' . $fromProject, 'users/' . $toUser . '/' . $confidentialityLevel . '/' . $fromProject);
     } catch (Exception $e) {
         return $shark['msg']['API-error'];
     }
     return $shark['msg']['API-done'];
 }
开发者ID:KasaiDot,项目名称:SharkDev,代码行数:24,代码来源:API.php

示例3: elseif

    } elseif (!isset($_POST['agree-terms']) || !$_POST['agree-terms']) {
        $err = 'You must agree terms and privacy';
    } else {
        $user = DataBase::get('users', array(), array('pseudo' => $_POST['pseudo']));
        if (count($user) && $user !== false) {
            $err = 'This pseudo is already used !';
        } else {
            $user = DataBase::get('users', array(), array('email' => $_POST['email']));
            if (count($user) && $user !== false) {
                $err = 'This email is already used !';
            } else {
                $token = md5(uniqid(rand(), true)) . md5(uniqid(rand(), true));
                if (DataBase::insert('users', array('pseudo' => $_POST['pseudo'], 'password' => hash('sha384', $_POST['password']), 'email' => $_POST['email'], 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'fullname' => $_POST['firstname'] . ' ' . $_POST['lastname'], 'activated' => 0, 'rights' => 1, 'register' => 'NOW()', 'reputation' => 0, 'token' => $token))) {
                    try {
                        chdir(__DIR__ . '/server/users');
                        Lib::recurseCopy('.model', $_POST['pseudo']);
                        sendMail($_POST['email'], Config::get('SITE_TITLE'), Config::get('SITE_EMAIL'), 'Activate your account', 'Dear ' . $_POST['firstname'] . ' ' . $_POST['lastname'] . ",<br /><br />You've just created an account. To activate it, use the link below.<br /><br /><a href=\"http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}?activate=" . $token . "\">Activate your account</a><br /><br /><small>Sent from Skyer</small>");
                        $registered = true;
                    } catch (Exception $e) {
                        $err = 'Internal disk error. Please try again.';
                    }
                } else {
                    $err = 'DataBase error. Please try again.';
                }
            }
        }
    }
}
?>
<style type="text/css">body{padding-bottom: 20px;}</style>
<div class="middle-box text-center loginscreen   animated fadeInDown">
开发者ID:KasaiDot,项目名称:SharkDev,代码行数:31,代码来源:register.php


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