path, $destination . basename($this->path)); // return xlink:href return $destination . basename($this->path); } */ protected static function getNextNumber(){ return self::$objNumber++; } public function copyTo($destination) { $obj = 'Object ' . self::getNextNumber(); $newObjPath = $destination. $obj; if(!is_dir($newObjPath)) { mkdir($newObjPath); } $unzip = sfConfig::get('app_sfOpenOfficePlugin_unzip_cmd', 'unzip -o'); $tmpObjPath = $newObjPath . DIRECTORY_SEPARATOR . 'tmp'; mkdir($tmpObjPath); @copy($this->path, $tmpObjPath.DIRECTORY_SEPARATOR. 'a.zip'); $document = basename($this->path); chdir($tmpObjPath); exec("$unzip a.zip", $output, $status); @copy('content.xml', '../content.xml'); @copy('styles.xml', '../styles.xml'); chdir($newObjPath); exec("rm -rf tmp", $output, $status); // return xlink:href return $obj; } }