Jump to:

4938 Posts in 16696 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » lokal (win) -> remote (linux), problems

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2569 Views
  • steffik
    Community Member
    15 Posts

    Re: lokal (win) -> remote (linux), problems Link to this post

    wiping the database doesn't really sound like a good solution to me - and i think my client won't like the idea as well.

    So i started writing that php script. I have very limited php skills, but this is what i have for now:

    At the moment the str_replace(...) Function doesn't always lead to the correct result, but i'm not sure where that comes from...

    $dbFileName = "dumpTest.sql";
    $csvFileName = "TableNames.csv";

    repairFile($dbFileName, $csvFileName);

    function repairFile($dbFileName, $csvFileName) {
       $sqlFileHandle = fopen($dbFileName, "r");
       $contents = fread($sqlFileHandle, filesize($dbFileName));
       $csvFileHandle = fopen ($csvFileName,"r"); // Datei zum Lesen √∂ffnen
       while ( ($data = fgetcsv ($csvFileHandle, 1000, ";")) !== FALSE ) {
          print $data[0].' -> '.$data[1].'<br>';
          $contents = str_replace($data[0], $data[1], $contents, $count);
          print $count.'<br>';

       $sqlResultFileHandle = fopen($dbFileName, "w");
    if (!fwrite($sqlResultFileHandle, $contents)) {
    print "Can't write File $dbFileName";
       unset($contents, $sqlFileHandle, $csvFileHandle);
       unset($GLOBALS['contents'], $GLOBALS['sqlFileHandle'], $GLOBALS['csvFileHandle']);


Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.