コード例 #1
0
ファイル: sync.php プロジェクト: brthiess/rockstat_final
function update_id($team, $event_teams)
{
    $found_team = false;
    foreach ($event_teams as $event_team) {
        //echo "\n\n******Comparing Teams*******\n";
        $event_team->print_team();
        $team->print_team();
        //echo "\nTeam ID: " . $event_team->team_id;
        if (teams_match($team, $event_team)) {
            //echo "\nTeams Match";
            $team->team_id = $event_team->team_id;
            $found_team = true;
            break;
        } else {
            //echo "\nTeams Don't Match";
        }
        //pause(" ");
    }
    if (!$found_team) {
        echo "\n\n***ERROR: No Match for team***";
        pause("");
    }
}
コード例 #2
0
ファイル: airtime-upgrade.php プロジェクト: nidzix/Airtime
    pause();
}
if (strcmp($version, "2.0.2") < 0) {
    passthru("php --php-ini {$SCRIPTPATH}/../airtime-php.ini {$SCRIPTPATH}/../upgrades/airtime-2.0.2/airtime-upgrade.php");
    pause();
}
if (strcmp($version, "2.0.3") < 0) {
    passthru("php --php-ini {$SCRIPTPATH}/../airtime-php.ini {$SCRIPTPATH}/../upgrades/airtime-2.0.3/airtime-upgrade.php");
    pause();
}
if (strcmp($version, "2.1.0") < 0) {
    passthru("php --php-ini {$SCRIPTPATH}/../airtime-php.ini {$SCRIPTPATH}/../upgrades/airtime-2.1.0/airtime-upgrade.php");
    pause();
}
if (strcmp($version, "2.1.1") < 0) {
    passthru("php --php-ini {$SCRIPTPATH}/../airtime-php.ini {$SCRIPTPATH}/../upgrades/airtime-2.1.1/airtime-upgrade.php");
    pause();
}
if (strcmp($version, "2.1.2") < 0) {
    passthru("php --php-ini {$SCRIPTPATH}/../airtime-php.ini {$SCRIPTPATH}/../upgrades/airtime-2.1.2/airtime-upgrade.php");
    pause();
}
if (strcmp($version, "2.1.3") < 0) {
    passthru("php --php-ini {$SCRIPTPATH}/../airtime-php.ini {$SCRIPTPATH}/../upgrades/airtime-2.1.3/airtime-upgrade.php");
    pause();
}
if (strcmp($version, "2.2.0") < 0) {
    passthru("php --php-ini {$SCRIPTPATH}/../airtime-php.ini {$SCRIPTPATH}/../upgrades/airtime-2.2.0/airtime-upgrade.php");
    pause();
}
echo "******************************* Upgrade Complete *******************************" . PHP_EOL;
コード例 #3
0
ファイル: index.php プロジェクト: felixmc/spotilocal
<?php

require_once __DIR__ . "/helpers.php";
// pause the track
// =====================================
var_dump(pause());
print PHP_EOL . PHP_EOL;
// sleep
sleep(3);
// resume the track
// =====================================
var_dump(resume());
print PHP_EOL . PHP_EOL;
// sleep
sleep(3);
// play the track
// =====================================
// our spotify track url
var_dump(play("spotify:track:4Tyv7nnNTHC6mR1pTubIrw"));
print PHP_EOL . PHP_EOL;
// sleep
sleep(30);
// play the playlist
// =====================================
// our spotify track url
var_dump(play("spotify:user:djekl:playlist:1AIZcUvQ6f8rnGx7vSGPHN"));
print PHP_EOL . PHP_EOL;
コード例 #4
0
ファイル: parse_wct.php プロジェクト: brthiess/rockstat_final
function get_event_wct($html)
{
    $event_name = $html->find(".wctlight")[0]->plaintext;
    //Common Sense check
    if (strlen($event_name) <= 3) {
        echo "\n\n*****ERROR: Short Event name found\n";
        pause("");
    }
    $event_location = $html->find(".wctlight")[1]->plaintext;
    //Common Sense check
    if (strlen($event_location) <= 3) {
        echo "\n\n****ERROR: Short Event location found*****\n\n";
        pause("");
    }
    //Get the event date
    $event_date_html = str_replace("&nbsp;", "", $html->find(".wctlight")[3]->plaintext);
    $start_date = get_date_wct($event_date_html, "start");
    $end_date = get_date_wct($event_date_html, "end");
    //Get the event purse
    $event_purse = get_purse_wct($html->find(".wctlight")[5]->plaintext);
    $event_currency = get_currency_wct($html->find(".wctlight")[5]->plaintext);
    $event_gender = get_gender_wct($html);
    return new Event($event_location, $start_date, $end_date, $event_purse, $event_currency, $event_name, $event_gender);
}
コード例 #5
0
ファイル: wct_event.php プロジェクト: brthiess/rockstat_final
function get_event_purse_wct($schedule_html, $event_url)
{
    $dom_lower = get_event_dom_block_lower_wct($schedule_html, $event_url);
    $purse_string = $dom_lower->find("td")[1]->plaintext;
    $purse = -1;
    $purse = intval(preg_replace("/[^0-9]/", "", $purse_string));
    if ($purse == -1) {
        echo "\n\n***ERROR: Purse is \$-1";
        pause("");
    }
    return $purse;
}
コード例 #6
0
ファイル: setup.php プロジェクト: Beasta/Wicker
function resetdb()
{
    global $data;
    require_once "Config.class.php";
    $data["database"]["url"] = $config->getDBURL();
    $data["database"]["username"] = $config->getDBUser();
    $data["database"]["password"] = $config->getDBPass();
    $data["database"]["name"] = $config->getDBName();
    echo "Checking if database exists";
    pause();
    $dbh = new PDO('mysql:host=' . $data["database"]["url"] . ';dbname=INFORMATION_SCHEMA', $data["database"]["username"], $data["database"]["password"], array(PDO::ATTR_TIMEOUT => "3"));
    // Check if database exists
    $query = $dbh->query("SELECT * FROM `SCHEMATA` WHERE `SCHEMA_NAME` = '" . $data["database"]["name"] . "'");
    if ($query->rowCount() == 0) {
        echo R . "Database was not found (or your credentials don't have valid permissions)\n\n" . W;
        $found = false;
    } else {
        echo G . "Database was found\n\n" . W;
        $found = true;
    }
    if ($found) {
        // Check for tables
        echo "Checking tables";
        pause();
        $dbh = new PDO('mysql:host=' . $data["database"]["url"] . ';dbname=' . $data["database"]["name"], $data["database"]["username"], $data["database"]["password"], array(PDO::ATTR_TIMEOUT => "3"));
        $query = $dbh->query("show tables");
        while ($results = $query->fetch()) {
            $tables[] = $results[0];
        }
        if ($tables == null) {
            echo G . "Database is empty" . W . "\n";
            importWickerTables(0, 0);
        } else {
            echo O . "Database is occupied" . W . "\n\n";
            echo "Listing tables in database.\n" . G . "Green" . W . " = Wicker tables\n" . R . "Red  " . W . " = Other tables\n----------\n";
            $good = 0;
            $bad = 0;
            foreach ($tables as $table) {
                if (in_array($table, array("aps", "attacks", "caps", "clients", "scans"))) {
                    echo G . $table . W . "\n";
                    $good++;
                } else {
                    echo R . $table . W . "\n";
                    $bad++;
                }
            }
            echo "----------\n";
            importWickerTables($good, $bad);
        }
        print_r($results);
    } else {
        $dbh = new PDO('mysql:host=' . $data["database"]["url"], $data["database"]["username"], $data["database"]["password"], array(PDO::ATTR_TIMEOUT => "3"));
        echo "Attemping to create database";
        pause();
        $dbh->query("CREATE DATABASE IF NOT EXISTS " . $data["database"]["name"]);
        if ($dbh->errorCode() != "00000") {
            echo R . "An error has occured while attempting to create the database.\nPlease verify that the credentials supplied have valid database creation permissions." . W . "\n";
            die;
        } else {
            echo G . "Database " . O . $data["database"]["name"] . G . " was created successfully!" . W . "\n";
        }
        // Import tables
        importWickerTables(0, 0);
    }
}
コード例 #7
0
ファイル: CLI.php プロジェクト: hbnro/habanero
 public static function wait($text = 'Press any key')
 {
     if (is_numeric($text)) {
         while (1) {
             if (($text -= 1) < 0) {
                 break;
             }
             static::write($len = strlen("{$text}..."));
             static::back($len);
             pause(1);
         }
     } else {
         static::writeln($text);
         static::readln();
     }
 }
コード例 #8
0
include_once "db/input.php";
include_once "fake_data.php";
// Create DOM from URL or file
$schedule_url = 'http://www.worldcurl.com/schedule.php?eventtypeid=21&eventyear=2015';
$schedule_html = get_html($schedule_url);
$next_event_url = get_next_event_url($schedule_html, null);
while ($next_event_url != null) {
    $parsed_event_html = parse_event_html($schedule_html, $next_event_url);
    //$parsed_event_html = fake_event_data();
    pause("Press Enter");
    if ($parsed_event_html != null) {
        input_html($parsed_event_html);
    }
    $next_event_url = get_next_event_url($schedule_html, $next_event_url);
    echo "\n\n\n\n***Moving on to new event***";
    pause("");
}
//Gets the html dom object from the given url
function get_html($url)
{
    while (true) {
        try {
            $html = file_get_html($url);
            break;
        } catch (Exception $e) {
            echo "\n**Failed to get html.  Trying again**\n";
        }
    }
    return replace_links_with_base_url(get_base_url($url), $html);
}
//Is given the url for an event page, and returns
コード例 #9
0
ファイル: module.php プロジェクト: Heavyshield/SDI31
 break;	
 */
 //action type player: active/désactive met en pause la lecture + le son-------------------------------------------------------------------------
 case 'playerStatus':
     echo playerStatus();
     break;
 case 'currentTitle':
     currentTitle();
     break;
 case 'play':
     //lance le player exemple: play ->ok
     $mySqueezeCLI = new SqueezeCLI(play());
     break;
 case 'pause':
     //met en pause le player exemple: pause ->ok
     $mySqueezeCLI = new SqueezeCLI(pause());
     break;
 case 'stop':
     //stop le player exemple: stop ->ok
     $mySqueezeCLI = new SqueezeCLI(stop());
     break;
 case 'volumeUp':
     //augmente le volume du mixer de +5 ->ok
     $mySqueezeCLI = new SqueezeCLI(volumeUp());
     break;
 case 'volumeDown':
     //réduit le volume du mixer de -5 ->ok
     $mySqueezeCLI = new SqueezeCLI(volumeDown());
     break;
 case 'setVolume':
     //set le volume exemple: volumeSet_100 ->ok
コード例 #10
0
 public function run()
 {
     //The preprocessing before the actual iteration loop:
     try {
         if (($this->stopEmulator & 2) == 0) {
             if (($this->stopEmulator & 1) == 1) {
                 $this->stopEmulator = 0;
                 $this->clockUpdate();
                 //Frame skip and RTC code.
                 //If no HALT... Execute normally
                 if (!$this->halt) {
                     $this->executeIteration();
                     //If we bailed out of a halt because the iteration ran down its timing.
                 } else {
                     $this->CPUTicks = 1;
                     Opcode::run($this, 0x76);
                     //Execute Interrupt:
                     $this->runInterrupt();
                     //Timing:
                     $this->updateCore();
                     $this->executeIteration();
                 }
                 //We can only get here if there was an internal error, but the loop was restarted.
             } else {
                 echo 'Iterator restarted a faulted core.' . PHP_EOL;
                 pause();
             }
         }
     } catch (\Exception $error) {
         if ($error->getMessage() != 'HALT_OVERRUN') {
             echo 'GameBoy runtime error' . PHP_EOL;
         }
     }
 }