Ejemplo n.º 1
0
$group_model = new GroupModel();
$group_ids = array();
for ($i = 0; $i < 100; $i++) {
    echo "Creating Group {$i}\n";
    $group_ids[$i] = $group_model->addGroup("Group{$i}", $user_ids[$i], PUBLIC_JOIN, GROUP_READ_WRITE);
}
// add lots of users to group 1
for ($i = 0; $i < 100; $i++) {
    $user_id = $user_ids[$i + 2];
    $group_model->addUserGroup($user_id, $group_ids[1], ACTIVE_STATUS);
}
// add lots of roles
$role_model = new RoleModel();
$user_id = $user_ids[2];
for ($i = 0; $i < 100; $i++) {
    echo "Creating Role {$i}\n";
    $role_model->addRole("Role{$i}");
    $role_id = $role_model->getRoleId("Role{$i}");
    $role_model->addUserRole($user_id, $role_id);
}
$crawl_model = new CrawlModel();
$mix = array();
$mix['TIMESTAMP'] = time();
$mix['FRAGMENTS'] = array();
$mix['OWNER_ID'] = ROOT_ID;
$mix['PARENT'] = -1;
for ($i = 0; $i < 100; $i++) {
    $mix['TIMESTAMP']++;
    $mix['NAME'] = "Mix{$i}";
    $crawl_model->setCrawlMix($mix);
}