Exemplo n.º 1
0
 /**
  * Commit File with given message to the given path
  *
  * @access public
  * @author Cédric Alfonsi, <*****@*****.**>
  * @param  File resource
  * @param  string message
  * @param  string path
  * @param  boolean recursive
  * @return boolean
  * @see core_kernel_versioning_File::commit()
  */
 public function commit(core_kernel_file_File $resource, $message, $path, $recursive = false)
 {
     $returnValue = (bool) false;
     $startTime = helpers_Time::getMicroTime();
     if ($resource->getRepository()->authenticate()) {
         $paths = is_array($path) ? $path : array($path);
         $returnValue = svn_commit($message, $paths);
         $returnValue = $returnValue === false ? false : true;
     }
     $endTime = helpers_Time::getMicroTime();
     common_Logger::i("svn_commit (" . $path . ') recursive=' . ($recursive == true ? 'true' : 'false') . '-> ' . ($endTime - $startTime) . 's');
     return (bool) $returnValue;
 }
Exemplo n.º 2
0
 protected static function write($decodedArray)
 {
     // Update Version
     if (isset($decodedArray[0]['attribs']['version'])) {
         $versionNumberStr = $decodedArray[0]['attribs']['version'];
         if (@intval($versionNumberStr) != null) {
             // Increment Version Number
             $versionNumberInt = intval($versionNumberStr) + 1;
             $decodedArray[0]['attribs']['version'] = $versionNumberInt;
         }
     }
     // Encode XML
     $xmlEncoder = new XMLEncoder();
     $xmlFileContent = $xmlEncoder->encode($decodedArray);
     // Write To File
     $file = fopen('sites.xml', 'w+');
     fputs($file, iconv('UTF-8', 'ISO-8859-1//TRANSLIT//IGNORE', $xmlFileContent));
     fclose($file);
     // Commit New Changes
     svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, SITES_XML_SVN_USERNAME);
     svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, SITES_XML_SVN_PASSWORD);
     svn_commit('PHP Commit', './');
 }
Exemplo n.º 3
0
 protected function svnCommit(array $target, $message)
 {
     return svn_commit($message, $target);
 }