Compare module statuses of different Drupal sites

Compare module statuses of different Drupal sites

http://www.ac-brno.org/?pycka=%D8%B3%D9%88%D9%82-%D8%A7%D9%84%D8%A7%D8%B3%D9%87%D9%85-%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A-%D8%A7%D9%84%D8%A8%D9%86%D9%83-%D8%A7%EF%BB%B7%D9%87%D9%84%D9%8A&978=6c Recently I have had a problem that occurred on one of a suite of multilingual Drupal sites all based form the same code base, this was reasonably annoying as I knew it must be something to do with the configuration of modules in the database and that I would have to manually check the differences. 

ثنائي الربح الخيارات السماسرة

http://parts.powercut.co.uk/?risep=%D8%A7%D9%84%D8%B1%D9%88%D8%A8%D9%88%D8%AA%D8%A7%D8%AA-%D8%AE%D9%8A%D8%A7%D8%B1-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9-%D8%A7%D9%84%D8%AA%D9%8A-%D8%AA%D8%B9%D9%85%D9%84&3e8=9d To make this job easier and to provide myself with a useful tool in case this ever happens again I decided to make a script that did all the work of comparing the differences for me.    

اسعار الذهب في البنجلاديش

http://skylarkstudios.co.uk/?pomulyyko=%D9%83%D9%8A%D9%81-%D8%A7%D8%B3%D8%AA%D8%B7%D9%8A%D8%B9-%D8%A8%D9%8A%D8%B9-%D8%A7%D8%B3%D9%87%D9%85-%D9%82%D8%AF%D9%8A%D9%85%D9%87-%D8%A8%D8%A7%D9%84%D8%A7%D9%86%D8%AA%D8%B1-%D9%86%D8%AA&85d=fa This is at this time by no means a finished or perfect solution to the issue of how to compare the status of different modules across different sites, just a first step to what if I need can become a useful tool for comparing the differences between the status of modules on different sites. 

انظر هنا This can be useful if you have many sites all using similar modules or multilingual sites where you have a different database for each site. 

مرتبطة هنا If I get the time and if I have the need I would make this a lot more useful by making this basic code in to a class with some useful methods for restricting the results to those I deem relevant for any given situation and perhaps adding in some spreadsheet functions to the end of each row. 

http://asect.org.uk/?ilyminaciya=%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9-%D9%85%D8%B1%D8%A7%D8%AC%D8%B9%D8%A9-%D8%A7%D9%84%D9%82%D9%86%D8%A7%D8%A9&f0b=68 The spreadsheet this generates is a CSV but this really became useful to me after I manually added some spreadsheet function to the outputted CSV. 

دعوة الخيار ثنائي سبيل المثال Anyway I imagine there would be other people in a similar situation so I have published the result on my GitHub

سوق الاسهم بدبي The basis for this comparison is the drush pml output for each site. To use this tool all you have to do at the moment is pipe this output to a file for each site and then edit the file locations array to match the output files you want to scan. 

http://i3group.com.au/?klykva=%D8%A5%D8%B4%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D9%81%D9%88%D8%B1%D9%83%D8%B3-%D8%A7%D9%84%D8%AA%D8%AC%D8%B1%D9%8A%D8%A8%D9%8A%D8%A9-%D8%A7%D9%84%D9%85%D8%AC%D8%A7%D9%86%D9%8A%D8%A9&31f=ff If you are a PHP or Drupal developer then this will all make sense and if you are not then I would be interested as to how you came across this page ;) 

http://www.juegosfriv.co.com/?yorkos=%D8%A3%D9%81%D8%B6%D9%84-%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9-%D9%88%D8%B3%D8%B7%D8%A7%D8%A1-%D8%A7%D9%84%D9%85%D9%85%D9%84%D9%83%D8%A9-%D8%A7%D9%84%D9%85%D8%AA%D8%AD%D8%AF%D8%A9&996=83 Contact me if you would like to know anything about this script and how to use it and I hope it helps someone. 

الذهاب هنا For access to the full codebase go to Tom Gould GitHub profile and more specifically to the pml_compare repo. 

http://huntnewsnu.com/?santaklays=%D9%83%D9%8A%D9%81-%D8%A7%D8%B4%D8%AA%D8%B1%D9%8A-%D8%A7%D8%B3%D9%87%D9%85 Here's a sample from the main worker.

تحقق من مصدر بلدي <?php   /** * @file * Compare output from pml from different sites in a CSV * * This is very rough as I wrote it quickly to do a specific job ;) * * To use this tol you need to write the output for the sites you want to compare * to files by using drush pml eg: * * drush --uri=demo.com pml > demo.com.txt * * Do this for all the sites you want to compare then put these files somewhere * readable like the pml_output directory * * When you have the files edit the pml_compare.php file to include these * file locations and the execute the script with PHP on the CLI eg: * * $ cd /var/www/pml_compare * $ php pml_compare.php * * This will then write a CSV to the ./csv folder * */   $sites = array( 'TomGould' => parse_pml('pml_output/tom-gould.txt'), 'site1' => parse_pml('pml_output/site1.com.pml.txt'), 'site2' => parse_pml('pml_output/site2.com.pml.txt'), 'site3' => parse_pml('pml_output/site3.com.pml.txt'), );   // Make the container for the CSV and the first column data (module name) $container = array('Headings' => array('Module')); foreach ($sites as $site => $array) { foreach ($array as $module_key => $module_values) { $container[$module_key] = array($module_key); } } ksort($container);   // Foreach site add the sites' module data to the CSV array foreach ($sites as $site => $array) { $container['Headings'][] = $site . ' Status'; $container['Headings'][] = $site . ' Version'; foreach ($container as $key => $value) { if (!empty($array[$key]) && $key !== 'Headings') { $container[$key][] = $array[$key]['Status']; $container[$key][] = $array[$key]['Version']; } else { if ($key !== 'Headings') { $container[$key][] = 'Empty'; $container[$key][] = 'Empty'; } } } }   // Make a CSV $fp = fopen('csv/module_differences.csv', 'w'); foreach ($container as $fields) { fputcsv($fp, $fields); } fclose($fp);   /** * Parses the PML Output read form a file into a usable array * * @param type $array * @return type */ function parse_pml($file_path) { // Get the PML statuses of the sitesl $pml = file_get_contents($file_path);   // Explode to array of lines $array = explode("\n", $pml);   // Empty arrays to hold more detialed info $response = array();   // Parse the array of lines foreach ($array as $line) { $key = string_get_last($line, '(', ')'); if ($key !== FALSE) { $tmp = array_filter(explode(' ', $line)); $columns = array( 'Package' => trim(array_shift($tmp)), 'Name' => trim(array_shift($tmp)), 'Type' => trim(array_shift($tmp)), 'Status' => trim(array_shift($tmp)), 'Version' => trim(array_shift($tmp)), ); $response[$key] = $columns; } }   return $response; }   /** * Returns text by specifying a start and end point * @param str $str * The text to search * @param str $start * The beginning identifier * @param str $end * The ending identifier */ function string_get_last($str, $start, $end) { $str = "|" . $str . "|"; $len = mb_strlen($start); if (mb_strpos($str, $start) > 0) { // Check to make sire that this is the last occurance if (mb_strpos( right($str, mb_strlen($str) - mb_strpos($str, $end) ), $start) > 0 ) { return string_get_last( right($str, mb_strlen($str) - mb_strpos($str, $end) - 1), $start, $end ); } $int_start = mb_strpos($str, $start) + $len; $temp = right($str, (mb_strlen($str) - $int_start)); $int_end = mb_strpos($temp, $end); $return = trim(left($temp, $int_end)); return $return; } else { return FALSE; } }   /** * Replacement for ASP right function * @param str $str * the string to cut * @param int $count * the length to cut */ function right($str, $count) { return mb_substr($str, ($count * -1)); }   /** * Replacement for ASP left function * @param str $str * the string to cut * @param int $count * the length to cut */ function left($str, $count) { return mb_substr($str, 0, $count); }   <code>

Comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.