Renaming functions
This commit is contained in:
parent
dff92c2d58
commit
a90cc995ff
2 changed files with 47 additions and 41 deletions
|
@ -14,51 +14,57 @@ $opt['minDisk'] = 1;
|
|||
$opt['protected'] = false;
|
||||
$opt['minRam'] = 10;
|
||||
|
||||
//$new_image = $image->create_image($opt);
|
||||
//$new_image = $image->createImage($opt);
|
||||
|
||||
//Liste des images
|
||||
$images = $image["listImages"];
|
||||
$images = $image->listImage();
|
||||
|
||||
echo "Images présentes :";
|
||||
echo "</br>";
|
||||
|
||||
foreach($images as $i){
|
||||
echo $i->name;
|
||||
if($i->name == "Test"){
|
||||
$id_image = $i->id;
|
||||
$list = $i->tags;
|
||||
echo $i->status;
|
||||
if(isset($images)){
|
||||
echo "Images présentes :";
|
||||
echo "</br>";
|
||||
foreach($images as $i){
|
||||
echo $i->name;
|
||||
if($i->name == "Test"){
|
||||
$id_image = $i->id;
|
||||
$list = $i->tags;
|
||||
echo $i->status;
|
||||
}
|
||||
echo "</br>";
|
||||
}
|
||||
echo "</br>";
|
||||
}
|
||||
echo "</br>";
|
||||
|
||||
if(isset($list)){
|
||||
foreach ($list as $l) {
|
||||
echo $l;
|
||||
echo "</br>";
|
||||
}
|
||||
if(isset($list)){
|
||||
foreach ($list as $l) {
|
||||
echo $l;
|
||||
echo "</br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo "Aucune image présente\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Détails Image
|
||||
//$details = $image->image_details($id_image);
|
||||
//$details = $image->imageDetails($id_image);
|
||||
|
||||
//$image->delete_image('123456');
|
||||
//$image->deleteImage('123456');
|
||||
|
||||
//$image->desactivate_image($id_image);
|
||||
//$image->reactivate_image($id_image);
|
||||
//$image->desactivateImage($id_image);
|
||||
//$image->reactivateImage($id_image);
|
||||
|
||||
//$file_name = "/home/yogg/Downloads/TinyCore-6.4.1.iso";
|
||||
//$image->upload_image($id_image, $file_name);
|
||||
//$image->uploadImage($id_image, $file_name);
|
||||
|
||||
//$image->download_image($id_image);
|
||||
//$image->downloadImage($id_image);
|
||||
|
||||
/*
|
||||
$opt_update = Array();
|
||||
$opt_update['name'] = "Test";
|
||||
$opt_update['tags'] = null;
|
||||
|
||||
$update = $image->update_image($id_image, $opt_update);
|
||||
$update = $image->updateImage($id_image, $opt_update);
|
||||
echo $update->name;
|
||||
*/
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ use OpenStack\Common\Error;
|
|||
* ADD CLASS DESCRIPTION
|
||||
*
|
||||
*/
|
||||
class image implements Core{
|
||||
class image {
|
||||
//implements Core
|
||||
|
||||
/** @var App $app protected, contains the main app object */
|
||||
|
@ -45,7 +45,7 @@ class image implements Core{
|
|||
}
|
||||
|
||||
|
||||
$images = array();
|
||||
private $images = array();
|
||||
|
||||
/**
|
||||
* Details about an image
|
||||
|
@ -54,7 +54,7 @@ class image implements Core{
|
|||
* options for the image creation
|
||||
*
|
||||
**/
|
||||
public function create_image(array $opt){
|
||||
public function createImage(array $opt){
|
||||
// VOIR SI MAUVAIS TYPE
|
||||
$options = Array();
|
||||
if(isset($opt['name'])){ // string, rendre le nom obligatoire, vérifier nom pas déjà pris
|
||||
|
@ -100,7 +100,7 @@ class image implements Core{
|
|||
*
|
||||
* @return the list with all images on the server
|
||||
*/
|
||||
$images["listImages"] = function() {
|
||||
public function listImage(){
|
||||
// vérifier si au moins une image
|
||||
$this->libClass->listImages();
|
||||
//return $l;
|
||||
|
@ -113,7 +113,7 @@ class image implements Core{
|
|||
* identifier of the image
|
||||
*
|
||||
**/
|
||||
public function image_details($id){
|
||||
public function detailsImage($id){
|
||||
//vérifier existence image
|
||||
$service = $this->libClass;
|
||||
$image = $service->getImage($id);
|
||||
|
@ -129,7 +129,7 @@ class image implements Core{
|
|||
* @param array $opt
|
||||
* options for the image creation
|
||||
**/
|
||||
public function update_image($id, array $opt){
|
||||
public function updateImage($id, array $opt){
|
||||
//vérifier existence image
|
||||
$service = $this->libClass;
|
||||
$image = $service->getImage($id);
|
||||
|
@ -165,7 +165,7 @@ class image implements Core{
|
|||
* @param string $id
|
||||
* identifier of the image
|
||||
**/
|
||||
public function delete_image($id){
|
||||
public function imageDelete($id){
|
||||
// si protected = true, demander de le mettre a false
|
||||
// vérifier existence image
|
||||
$service = $this->libClass;
|
||||
|
@ -178,7 +178,7 @@ class image implements Core{
|
|||
* @param string $id
|
||||
* identifier of the image
|
||||
**/
|
||||
public function reactivate_image($id){
|
||||
public function reactivateImage($id){
|
||||
// vérifier existence image
|
||||
$service = $this->libClass;
|
||||
$image = $service->getImage($id);
|
||||
|
@ -191,7 +191,7 @@ class image implements Core{
|
|||
* @param string $id
|
||||
* identifier of the image
|
||||
**/
|
||||
public function desactivate_image($id){
|
||||
public function desactivateImage($id){
|
||||
// vérifier existence image
|
||||
$service = $this->libClass;
|
||||
$image = $service->getImage($id);
|
||||
|
@ -207,7 +207,7 @@ class image implements Core{
|
|||
* @param string $file_name
|
||||
* path of the image
|
||||
**/
|
||||
public function upload_image($id, $file_name){
|
||||
public function uploadImage($id, $file_name){
|
||||
// vérifier existence image
|
||||
$service = $this->libClass;
|
||||
$image = $service->getImage($id);
|
||||
|
@ -221,7 +221,7 @@ class image implements Core{
|
|||
* @param string $id
|
||||
* identifier of the image
|
||||
**/
|
||||
public function download_image($id){
|
||||
public function downloadImage($id){
|
||||
// vérifier existence image
|
||||
$service = $this->libClass;
|
||||
$image = $service->getImage($id);
|
||||
|
@ -238,7 +238,7 @@ class image implements Core{
|
|||
* @param string $member_id
|
||||
* identifier of the member
|
||||
**/
|
||||
public function add_member($image_id, $member_id){
|
||||
public function addMemberImage($image_id, $member_id){
|
||||
// vérifier existence image
|
||||
// on doit être le proprio de l'image
|
||||
// vérifier membre existe
|
||||
|
@ -253,7 +253,7 @@ class image implements Core{
|
|||
* @param string $image_id
|
||||
* identifier of the image
|
||||
**/
|
||||
public function list_member($image_id, $member_id){
|
||||
public function listMemberImage($image_id, $member_id){
|
||||
// vérifier existence image
|
||||
$service = $this->libClass;
|
||||
$image = $service->getImage($image_id);
|
||||
|
@ -270,7 +270,7 @@ class image implements Core{
|
|||
* @param string $member_id
|
||||
* identifier of the member
|
||||
**/
|
||||
public function detail_member($image_id, $member_id){
|
||||
public function detailMemberImage($image_id, $member_id){
|
||||
// vérifier existence image
|
||||
// on doit être le proprio de l'image
|
||||
// vérifier membre existe
|
||||
|
@ -288,7 +288,7 @@ class image implements Core{
|
|||
* @param string $member_id
|
||||
* identifier of the member
|
||||
**/
|
||||
public function remove_member($image_id, $member_id){
|
||||
public function removeMemberImage($image_id, $member_id){
|
||||
// vérifier existence image
|
||||
// on doit être le proprio de l'image
|
||||
// vérifier membre existe
|
||||
|
@ -308,7 +308,7 @@ class image implements Core{
|
|||
* @param string $status
|
||||
* new status for the member
|
||||
**/
|
||||
public function update_member($image_id, $member_id, $status){
|
||||
public function updateMemberImage($image_id, $member_id, $status){
|
||||
// vérifier existence image
|
||||
// on doit être le proprio de l'image
|
||||
// vérifier membre existe
|
||||
|
|
Loading…
Add table
Reference in a new issue