示例#1
0
 public function onCommand(CommandSender $player, Command $command, $label, array $args)
 {
     // TODO - 명령어처리용
     if (strtolower($command) == $this->db->get("")) {
         // TODO <- 빈칸에 명령어
         if (!isset($args[0])) {
             // TODO - 명령어만 쳤을경우 도움말 표시
             return true;
         }
         switch (strtlower($args[0])) {
             case $this->db->get(""):
                 // TODO ↗ 빈칸에 세부명령어
                 // TODO 세부명령어 실행시 원하는 작업 실행
                 break;
             case $this->db->get(""):
                 // TODO ↗ 빈칸에 세부명령어
                 // TODO 세부명령어 실행시 원하는 작업 실행
                 break;
             default:
                 // TODO - 잘못된 명령어 입력시 도움말 표시
                 break;
         }
         return true;
     }
 }
function formatstatus($status)
{
    $valid_values = getstatuscodes();
    if (in_array(strtlower($status), $valid_values)) {
        return strtolower($status);
    }
    return false;
}
示例#3
0
 private function normalizeTableName($tableName)
 {
     $tableNameParts = explode('.', $tableName);
     if (count($tableNameParts) == 1) {
         return strtolower($this->database) . '.' . $tableName;
     } else {
         if (count($tableNameParts) == 2) {
             // table is in format [database name].[table name]
             // make database to lower case...
             $tableNameParts[0] = strtolower($tableNameParts[0]);
             return $tableNameParts[0] . '.' . $tableNameParts[1];
         } else {
             throw new \browserfs\Exception('Un-normalizable table name: ' . strtlower($tableName));
         }
     }
 }
示例#4
0
 public function SaveNuspec($nupkgFile, $e)
 {
     global $loginController;
     $nugetDb = new NuGetDb();
     $os = new PhpNugetObjectSearch();
     $query = "Id eq '" . $e->Id . "' orderby Version desc";
     $os->Parse($query, $nugetDb->GetAllColumns());
     $res = $nugetDb->GetAllRows(999999, 0, $os);
     if (sizeof($res) > 0 && !$loginController->Admin) {
         $id = $res[0]->UserId;
         if ($id != $e->UserId) {
             throw new Exception("Unauthorized!");
         }
     } else {
         if (sizeof($res) > 0 && $loginController->Admin) {
             $e->UserId = $res[0]->UserId;
         }
     }
     $e->IsPreRelease = indexOf($e->Version, "-") > 0;
     if ($nugetDb->AddRow($e, false)) {
         $destination = Path::Combine(Settings::$PackagesRoot, $e->Id . "." . $e->Version . ".nupkg");
         if (strtolower($nupkgFile) != strtolower($destination)) {
             if (file_exists($destination)) {
                 unlink($destination);
             }
             rename($nupkgFile, $destination);
         }
     } else {
         if (strtlower($nupkgFile) != strtlower($destination)) {
             if (file_exists($nupkgFile)) {
                 unlink($nupkgFile);
             }
         }
     }
 }