예제 #1
0
 public static function newInstance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #2
0
function butler_delete_activated_users($days = 30, $limit = 1000)
{
    $users = ModelButler::newInstance()->inactivatedUsers($days, $limit);
    $mUsers = User::newInstance();
    $numSuccess = 0;
    foreach ($users as $user) {
        $success = $mUsers->deleteUser($user['pk_i_id']);
        if ($success) {
            $numSuccess++;
        }
    }
    osc_set_preference('activated_users', (int) osc_get_preference('activated_users', 'butler') + $numSuccess, 'butler', 'INTEGER');
}