Login   Register  
PHP Classes
elePHPant
Icontem

File: Server.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Peter  >  Users  >  Server.php  >  Download  
File: Server.php
Role: Example script
Content type: text/plain
Description: Example class script
Class: Users
Manage user records stored in files
Author: By
Last change:
Date: 2011-05-11 06:58
Size: 1,059 bytes
 

Contents

Class file image Download
<?php

require 'Users.php';

class 
Server extends Users{
    
    protected 
$users;
    protected 
$workspaces;
    protected 
$expired;

    public function 
Initialization(){
        
$this->users = array(
            
'Peter',
            
'Iron',
            
'Jack',
            
'John',
            
'Tom',
            
'David',
            
'Ausir',
            
'Mary',
            
'Alex',
            
'Bob',
            
'Selina'
        
);
        
        
$this->workspaces '/tmp/Users';
        
$this->expired 5;
    }
    
    public function 
createUsers(){
        
$this->setWorkspaces($this->workspaces);
        
$this->setExpired($this->expired);
        
        foreach(
$this->users as $user):
            
$this->createUser($user);
        endforeach; 
        
        
$response['responseStatus'] = true;
        
$response['responseText'] = array('users' => $this->users);
        echo 
json_encode($response);
    }
    
    public function 
__construct(){
        
$this->Initialization();
    }
}

$Server = new Server();
$Server->createUsers();

?>