Swift is an object storage service of OpenStack. In the php-opencloud library, access the ObjectStore class (OpenStack or Rackspace) created by the connection object. For example, $ cloud = new \ OpenCloud \ OpenStack (array ('username' => '{username}', 'Password' => '{password }')); $ swift = $ cloud-> ObjectStore ('cloudfiles', 'dfw'); using the newly created $ swift, you can use different object storage components. The instance of the highest level object storage component is Container, and Container is the Set Name of the object, which is similar to the directory and folder in the file system (in fact not the same ). All objects are saved in the Container. List all Container ContainerList objects in an object storage instance as a collection of Container objects. List all containers in an OSS instance: $ containers = $ swift-> ContainerList (); while ($ Container = $ containers-> Next ()) printf ("% s \ n", $ container-> name); like other object sets, this also supports the First (), Next (), and Size () methods. Create a new iner using the Container () method of the newly created $ swift object above to create a new (empty) Container. $ Mycontainer = $ swift-> Container (); Save the Container to an OSS instance and use the Create () method: $ mycontainer-> Create ('mycontainername '); name is not required in the Create () method, if the name has been set. It is convenient to specify a name directly in the method. $ Mycontainer-> name = 'myininername'; $ mycontainer-> Create (); search for existing Container. If you pass a parameter to the Container () method of the ObjectStore object, you can retrieve an existing Container: $ oldcontainer = $ swift-> Container ('someoldcontainer '). In this case, information about SomeOldContainer is retrieved. This includes the metadata information of the Container. Printf ("Container % s has % d object (s) consuming % d bytes \ n", $ oldcontainer-> name, $ oldcontainer-> count, $ oldcontainer-> bytes ); the Delete iner Delete () method deletes Container $ oldcontainer-> Delete (). Note that the Container must be empty when it is deleted, that is, no object must be associated with it. Update the Container in the background. The Container creation and update methods are the same. You can use the Create () method to Update the Container. However, the Update () method is also used as the alias of the Create () method, this may be different in semantics (in your program): $ oldcontainer-> metadata-> update_time = time (); $ oldcontainer-> Update ();