Exemplo n.º 1
0
 /**
  * Creates filestructure for information exchange via sftp.
  * @return bool
  */
 public static function createFeedFileStructure()
 {
     $sftpDir = self::getSftpPath();
     $directory = new Directory($sftpDir);
     if (!$directory->isExists()) {
         $directory->create();
     }
     foreach (array("product", "inventory", "image", "order-ack", "shipment") as $feedType) {
         $feedDir = new Directory($sftpDir . "/" . $feedType);
         if (!$feedDir->isExists()) {
             $feedDir->create();
         }
         foreach (array("xml", "tmp", "zip") as $stage) {
             $stageDir = new Directory($sftpDir . "/" . $feedType . "/" . $stage);
             if (!$stageDir->isExists()) {
                 $stageDir->create();
             }
         }
     }
     return true;
 }