text:
:root {
  font-size: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.tc-videoController {
  display: none;
}

html,
body {
  margin: 0;
  font-family: 'Arimo', 'Helvetica Neue', sans-serif;
  position: relative;
  height: 100%;
}

.container {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
}

video {
  min-width: 100%;
  max-width: 100%;
  width: auto;
  min-height: 100%;
  height: auto;
  background-size: cover;
  z-index: 0;
  overflow-y: hidden;
}

.black-bg {
  background: rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

header.main-header {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
          flex-wrap: wrap;
  z-index: 3;
  height: 83vh;
  max-height: 100%;
  max-width: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow-x: hidden;
}

header.main-header .top-navbar {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
          flex-wrap: wrap;
  width: 100%;
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
  height: 10%;
}

header.main-header .top-navbar .logo {
  background-image: url(http://foundersfund.com/wp-content/uploads/2014/05/airbnb-logo.png);
  background-repeat: no-repeat;
  background-size: contain;
  height: 110px;
  width: 110px;
  margin-top: 15px;
  margin-left: 15px;
}

header.main-header .top-navbar .main-nav {
  list-style: none;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  margin-top: 15px;
  height: 30px;
}

header.main-header .top-navbar .main-nav li {
  margin: 0 11px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  padding: 13px 10px;
}

header.main-header .top-navbar .main-nav li a {
  font-size: 0.9rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 400;
}

header.main-header .top-navbar .main-nav li:first-child {
  border: 2px solid #ffffff;
}

header.main-header .top-navbar .main-nav li:first-child:hover {
  background: rgba(0, 0, 0, 0.4);
}

header.main-header .flex-container {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  height: 70%;
}

header.main-header .flex-container h1, header.main-header .flex-container h3 {
  color: #ffffff;
}

header.main-header .flex-container h1 {
  margin: 0;
  font-size: 3.85rem;
  text-transform: uppercase;
}

header.main-header .flex-container h3 {
  margin: 10px 0 20px 0;
  font-size: 1.1rem;
}

header.main-header .flex-container a.btn {
  padding: 12px 24px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(192, 192, 192, 0.7);
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

header.main-header .flex-container a.btn:hover {
  background: rgba(0, 0, 0, 0.3);
}

header.main-header .bottom-navbar {
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  border: none;
  outline: none;
  margin: 0;
  padding: 1.5rem;
}

header.main-header .bottom-navbar > * {
  outline: none;
  border: none;
}

header.main-header .bottom-navbar input[placeholder] {
  color: #a7a7a7;
}

header.main-header .bottom-navbar input {
  padding: 0.5rem;
  width: 19%;
  border: 0 1px 0 0;
  border-right: 1px solid lightgray;
}

header.main-header .bottom-navbar input[type="text"] {
  width: 30%;
}

header.main-header .bottom-navbar input[type="date"] {
  width: 10%;
}

header.main-header .bottom-navbar select {
  color: #a7a7a7;
  width: 8%;
}

header.main-header .bottom-navbar .submit-btn {
  padding: 0.5rem 2rem;
  background-color: #ff5a5f;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
}

header.main-header .bottom-navbar .submit-btn:hover {
  background-color: #ff7e82;
}

section.main-section {
  width: 100%;
  max-width: 100%;
  background-color: #eee;
  padding: 4rem 0;
  z-index: 3;
  position: absolute;
  top: 597px;
  height: 291vh;
  margin-top: 20px;
}

section.main-section .hosting-section {
  background: #ffffff;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  max-width: 100%;
  height: 45vh;
}

section.main-section .hosting-section .hosting-img {
  background-image: url(../images/airbnb/airbnb-host.jpg);
  background-position: center;
  background-size: cover;
  width: 65%;
  max-width: 70%;
  height: 100%;
}

section.main-section .hosting-section .hosting-description {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: space-around;
      -ms-flex-pack: distribute;
          justify-content: space-around;
  padding: 4rem 2.5rem;
  width: 35%;
}

section.main-section .hosting-section .hosting-description h2 {
  font-size: 1.5rem;
}

section.main-section .hosting-section .hosting-description .hosting-button {
  padding: 12px 30px;
  background: #007a87;
  color: #ffffff;
  font-weight: 700;
  font-size: .95rem;
}

section.main-section .hosting-section .hosting-description .hosting-button:hover {
  background: #0091a1;
}

section.main-section .flex-container {
  padding: 3rem 0;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

section.main-section .flex-container h2 {
  font-size: 2rem;
  color: #5a5a5a;
}

section.main-section .flex-container p {
  color: gray;
  margin-top: 10px;
}

section.main-section .city-images {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
          flex-wrap: wrap;
  -webkit-flex-direction: row;
      -ms-flex-direction: row;
          flex-direction: row;
  width: 100%;
  height: 100%;
  max-width: 100%;
}

section.main-section .city-images .new-york-city {
  background: url(../images/airbnb/new-york.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  max-width: 100%;
  width: 64%;
  height: 50vh;
  margin-right: 2%;
  margin-bottom: 2%;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

section.main-section .city-images .new-york-city h2 {
  font-size: 2rem;
  color: #ffffff;
}

section.main-section .city-images .stockholm-city {
  background: url(../images/airbnb/stockholm-hostel.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  max-width: 100%;
  width: 32%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  position: relative;
}

section.main-section .city-images .stockholm-city .stockholm-host-img {
  background: url(../images/airbnb/host-image.jpg);
  background-position: center;
  height: 60px;
  width: 60px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

section.main-section .city-images .stockholm-city h2, section.main-section .city-images .stockholm-city p {
  color: #ffffff;
}

section.main-section .city-images .stockholm-city h2 {
  font-size: 2rem;
}

section.main-section .city-images .stockholm-city .price {
  -webkit-align-self: flex-start;
      -ms-flex-item-align: start;
          align-self: flex-start;
  background: #5a5a5a;
  padding: 0.5rem;
  color: #ffffff;
  font-size: 1.5rem;
  position: absolute;
  bottom: 30px;
}

section.main-section .city-images .hawaii-city {
  background: url(../images/airbnb/hawaii.jpeg);
  background-repeat: no-repeat;
  background-size: cover;
  max-width: 100%;
  width: 31%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  text-align: center;
  margin-right: 2%;
  margin-bottom: 2%;
}

section.main-section .city-images .hawaii-city h2 {
  color: #ffffff;
  font-size: 2rem;
}

section.main-section .city-images .paris-city {
  background: url(../images/airbnb/paris.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 100%;
  width: 31%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  text-align: center;
  margin-right: 2%;
  margin-bottom: 2%;
}

section.main-section .city-images .paris-city h2 {
  color: #ffffff;
  font-size: 2rem;
}

section.main-section .city-images .barcelona-city {
  background: url(../images/airbnb/barcelona.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 100%;
  width: 34%;
  margin-bottom: 2%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  text-align: center;
  margin-bottom: 10px;
  transition: background 0.3s ease-in-out,
 background-position 0.1s ease-in-out;
}

section.main-section .city-images .barcelona-city h2 {
  color: #ffffff;
  font-size: 2rem;
}

section.main-section .city-images .barcelona-city:hover {
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)), url(../images/airbnb/barcelona.jpg);
  background-position: center right;
}

section.main-section .city-images .london-apartment {
  background: url(../images/airbnb/london-apartment.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 100%;
  width: 31%;
  margin-right: 2%;
  margin-bottom: 2%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  text-align: center;
  position: relative;
}

section.main-section .city-images .london-apartment .london-apartment-host {
  background: url(../images/airbnb/london-apartment-host.jpg);
  background-position: center;
  height: 60px;
  width: 60px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

section.main-section .city-images .london-apartment h2, section.main-section .city-images .london-apartment p {
  color: #ffffff;
}

section.main-section .city-images .london-apartment h2 {
  font-size: 2rem;
}

section.main-section .city-images .london-apartment .price {
  -webkit-align-self: flex-start;
      -ms-flex-item-align: start;
          align-self: flex-start;
  background: #5a5a5a;
  padding: 0.5rem;
  color: #ffffff;
  font-size: 1.5rem;
  position: absolute;
  bottom: 30px;
}

section.main-section .city-images .london-city {
  background: url(../images/airbnb/london.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 100%;
  width: 67%;
  height: 50vh;
  margin-bottom: 2%;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  transition: background 0.3s ease-in-out;
}

section.main-section .city-images .london-city h2 {
  color: #ffffff;
  font-size: 2rem;
}

section.main-section .city-images .san-francisco-city {
  background: url(../images/airbnb/san-francisco.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 100%;
  width: 31%;
  margin-right: 2%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

section.main-section .city-images .san-francisco-city h2 {
  color: #ffffff;
  font-size: 2rem;
}

section.main-section .city-images .berlin-city {
  background: url(../images/airbnb/berlin.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 100%;
  width: 32%;
  margin-right: 2%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

section.main-section .city-images .berlin-city h2 {
  color: #ffffff;
  font-size: 2rem;
}

section.main-section .city-images .budapest-city {
  background: url(../images/airbnb/budapest.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 100%;
  width: 33%;
  height: 50vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

section.main-section .city-images .budapest-city h2 {
  color: #ffffff;
  font-size: 2rem;
}

section.main-banner {
  background: url(../images/airbnb/host-welcomingjpg.jpg);
  background-position: center;
  background-size: cover;
  width: 100%;
  max-width: 100%;
  padding: 4rem 0;
  z-index: 3;
  height: 75vh;
  position: absolute;
  top: 368vh;
  background-color: lightblue;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

section.main-banner h1, section.main-banner h2 {
  color: #ffffff;
  margin: 0;
}

section.main-banner h1 {
  font-size: 4rem;
  text-transform: uppercase;
}

section.main-banner h2 {
  font-weight: 400;
}

section.main-banner .play-button {
  height: 80px;
  width: 80px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  margin-top: 30px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  cursor: pointer;
}

section.main-banner .play-button i {
  color: rgba(0, 0, 0, 0.3);
  font-size: 2rem;
  margin-left: 5px;
  margin-top: 5px;
}

section.main-banner .play-button:hover {
  background-color: white;
}

section.community-section {
  max-width: 100%;
  z-index: 3;
  height: 90vh;
  max-height: 100%;
  position: absolute;
  top: 443vh;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

section.community-section .community-heading-lead {
  font-size: 1.25rem;
  color: #5a5a5a;
  margin: 1rem;
}

section.community-section .community-services {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: space-around;
      -ms-flex-pack: distribute;
          justify-content: space-around;
  margin: 30px 0;
  width: 100%;
}

section.community-section .community-services .creating {
  background: #00D1C1;
  width: 24%;
  height: 65vh;
  margin: 0 1%;
  color: #ffffff;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-justify-content: space-around;
      -ms-flex-pack: distribute;
          justify-content: space-around;
  padding: 3rem 0;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

section.community-section .community-services .creating:hover {
  background: #009e92;
}

section.community-section .community-services .creating .create-logo {
  background: url(../images/airbnb/create-logo.png);
  background-repeat: no-repeat;
  height: 45px;
  width: 110px;
}

section.community-section .community-services .creating .create-img {
  background: url(../images/airbnb/create-img.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  height: 250px;
  width: 250px;
}

section.community-section .community-services .creating .create-support-title {
  text-align: center;
}

section.community-section .community-services .creating .create-support-title h3 {
  font-size: 1.5rem;
}

section.community-section .community-services .creating .create-support-title p {
  font-size: 0.95rem;
}

section.community-section .community-services .travelling {
  background: url(../images/airbnb/travelling-couple.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  width: 24%;
  height: 65vh;
  margin: 0 1%;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
  padding-bottom: 2rem;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

section.community-section .community-services .travelling:hover {
  background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3)), url(../images/airbnb/travelling-couple.jpg);
  background-repeat: no-repeat;
  background-size: cover;
}

section.community-section .community-services .travelling .travelling-header-label {
  background: #007a87;
  padding: 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
}

section.community-section .community-services .travelling .travelling-titles {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  height: 30%;
}

section.community-section .community-services .travelling .travelling-titles .travelling-main-titles {
  color: #ffffff;
}

section.community-section .community-services .travelling .travelling-titles .travelling-main-titles h2 {
  font-size: 2rem;
  text-align: center;
}

section.community-section .community-services .travelling .travelling-titles .travelling-main-titles p {
  font-size: 0.9rem;
  text-align: center;
  width: 80%;
  margin: 0 auto;
  line-height: 140%;
}

section.community-section .community-services .travelling .travelling-titles .travelling-title-link a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
}

section.community-section .community-services .travelling .travelling-titles .travelling-title-link a:hover {
  text-decoration: underline;
}

section.community-section .community-services .business-travelling {
  background: url(../images/airbnb/business-travelling-couple.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  width: 24%;
  height: 65vh;
  margin: 0 1%;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

section.community-section .community-services .business-travelling:hover {
  background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3)), url(../images/airbnb/business-travelling-couple.jpg);
  background-repeat: no-repeat;
  background-size: cover;
}

section.community-section .community-services .business-travelling .business-travelling-header-label {
  background: #393c3d;
  padding: 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
}

section.community-section .community-services .business-travelling .business-travelling-main-titles {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  color: #ffffff;
  height: 45%;
  text-align: center;
}

section.community-section .community-services .business-travelling .business-travelling-main-titles h2 {
  font-size: 1.9rem;
}

section.community-section .community-services .business-travelling .business-travelling-main-titles p {
  font-size: 0.9rem;
}

section.community-section .community-services .business-travelling .business-travelling-main-titles .business-travelling-sub-title-link {
  margin-top: 2rem;
}

section.community-section .community-services .business-travelling .business-travelling-main-titles .business-travelling-sub-title-link a {
  color: #ffffff;
  font-size: 0.9rem;
  text-decoration: none;
}

section.community-section .community-services .business-travelling .business-travelling-main-titles .business-travelling-sub-title-link a:hover {
  text-decoration: underline;
}

section.community-section .community-services .hosting {
  background: url(../images/airbnb/host-nina.jpg);
  background-position: no-repeat;
  background-size: cover;
  width: 24%;
  height: 65vh;
  margin: 0 1%;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  cursor: pointer;
  transition: background 0.3s ease-in-out;
}

section.community-section .community-services .hosting:hover {
  background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3)), url(../images/airbnb/host-nina.jpg);
  background-repeat: no-repeat;
  background-size: cover;
}

section.community-section .community-services .hosting .hosting-header-label {
  background: #7b0051;
  padding: 12px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

section.community-section .community-services .hosting .hosting-main-titles {
  color: #ffffff;
  text-align: center;
  height: 30%;
}

section.community-section .community-services .hosting .hosting-main-titles h2 {
  font-size: 2rem;
}

section.community-section .community-services .hosting .hosting-main-titles p {
  font-size: 0.9rem;
}

section.community-section .community-services .hosting .hosting-main-titles .hosting-sub-title-link {
  margin-top: 1.5rem;
}

section.community-section .community-services .hosting .hosting-main-titles .hosting-sub-title-link a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
}

section.community-section .community-services .hosting .hosting-main-titles .hosting-sub-title-link a:hover {
  text-decoration: underline;
}

footer.main-footer {
  background: #2b2d2e url(../images/airbnb/footer-bg.png);
  max-width: 100%;
  width: 100%;
  z-index: 3;
  height: 66.5vh;
  max-height: 100%;
  position: absolute;
  top: 528vh;
  padding: 3rem 0;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
}

footer.main-footer .flex-container {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  border-bottom: 1px solid rgba(192, 192, 192, 0.3);
  padding: 3rem 0;
  width: 100%;
}

footer.main-footer .flex-container .form-inputs {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: flex-start;
      -ms-flex-pack: start;
          justify-content: flex-start;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  width: 40%;
}

footer.main-footer .flex-container .form-inputs select {
  width: 60%;
  padding: 0.75rem;
  background: rgba(128, 128, 128, 0.5);
  color: #ffffff;
  margin-bottom: 1rem;
  outline: none;
  border: none;
  font-size: 1rem;
}

footer.main-footer .flex-container .company-nav,
footer.main-footer .flex-container .discover-nav,
footer.main-footer .flex-container .hosting-nav {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  width: 17%;
}

footer.main-footer .flex-container .company-nav h5, footer.main-footer .flex-container .company-nav a,
footer.main-footer .flex-container .discover-nav h5,
footer.main-footer .flex-container .discover-nav a,
footer.main-footer .flex-container .hosting-nav h5,
footer.main-footer .flex-container .hosting-nav a {
  color: #ffffff;
}

footer.main-footer .flex-container .company-nav h5,
footer.main-footer .flex-container .discover-nav h5,
footer.main-footer .flex-container .hosting-nav h5 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

footer.main-footer .flex-container .company-nav a,
footer.main-footer .flex-container .discover-nav a,
footer.main-footer .flex-container .hosting-nav a {
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.1rem 0;
}

footer.main-footer .flex-container .company-nav a:hover,
footer.main-footer .flex-container .discover-nav a:hover,
footer.main-footer .flex-container .hosting-nav a:hover {
  color: lightgray;
}

footer.main-footer .flex-container .hosting-nav {
  width: 26%;
}

footer.main-footer .flex-container2 {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  width: 100%;
  padding: 3rem 0;
  text-align: center;
  height: 220px;
}

footer.main-footer .flex-container2 h5, footer.main-footer .flex-container2 p, footer.main-footer .flex-container2 .social-links a {
  color: #ffffff;
  width: 100%;
}

footer.main-footer .flex-container2 h5 {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

footer.main-footer .flex-container2 a {
  text-decoration: none;
}

footer.main-footer .flex-container2 a i {
  font-size: 1.25rem;
  border: 1px solid rgba(192, 192, 192, 0.4);
  margin: 0 0.5rem;
  font-size: 1rem;
  padding: .6rem;
  border-radius: 50%;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 38px;
}

footer.main-footer .flex-container2 a:hover {
  color: #cccccc;
}

footer.main-footer .flex-container2 p {
  font-size: 0.8rem;
  color: gray;
  margin-top: 1rem;
}

footer.main-footer .flex-container2 p:last-child {
  margin-top: 0;
}


text:
<?php

namespace CodeIgniter\Database\Live;

use CodeIgniter\Database\Exceptions\DatabaseException;
use CodeIgniter\Database\Forge;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\DatabaseTestTrait;
use Config\Database;
use InvalidArgumentException;
use RuntimeException;

/**
 * @group DatabaseLive
 *
 * @internal
 */
final class ForgeTest extends CIUnitTestCase
{
    use DatabaseTestTrait;

    protected $refresh = true;
    protected $seed    = 'Tests\Support\Database\Seeds\CITestSeeder';

    /**
     * @var Forge
     */
    protected $forge;

    protected function setUp(): void
    {
        parent::setUp();
        $this->forge = Database::forge($this->DBGroup);
    }

    public function testCreateDatabase()
    {
        if ($this->db->DBDriver === 'OCI8') {
            $this->markTestSkipped('OCI8 does not support create database.');
        }
        $databaseCreated = $this->forge->createDatabase('test_forge_database');

        $this->assertTrue($databaseCreated);
    }

    public function testCreateDatabaseIfNotExists()
    {
        if ($this->db->DBDriver === 'OCI8') {
            $this->markTestSkipped('OCI8 does not support create database.');
        }
        $dbName = 'test_forge_database_exist';

        $databaseCreateIfNotExists = $this->forge->createDatabase($dbName, true);
        if ($this->db->DBDriver !== 'SQLite3') {
            $this->forge->dropDatabase($dbName);
        }

        $this->assertTrue($databaseCreateIfNotExists);
    }

    public function testCreateDatabaseIfNotExistsWithDb()
    {
        if ($this->db->DBDriver === 'OCI8') {
            $this->markTestSkipped('OCI8 does not support create database.');
        }
        $dbName = 'test_forge_database_exist';

        $this->forge->createDatabase($dbName);
        $databaseExists = $this->forge->createDatabase($dbName, true);
        if ($this->db->DBDriver !== 'SQLite3') {
            $this->forge->dropDatabase($dbName);
        }

        $this->assertTrue($databaseExists);
    }

    public function testDropDatabase()
    {
        if ($this->db->DBDriver === 'OCI8') {
            $this->markTestSkipped('OCI8 does not support drop database.');
        }
        if ($this->db->DBDriver === 'SQLite3') {
            $this->markTestSkipped('SQLite3 requires file path to drop database');
        }

        $databaseDropped = $this->forge->dropDatabase('test_forge_database');

        $this->assertTrue($databaseDropped);
    }

    public function testCreateDatabaseExceptionNoCreateStatement()
    {
        $this->setPrivateProperty($this->forge, 'createDatabaseStr', false);

        if ($this->db->DBDriver === 'SQLite3') {
            $databaseCreated = $this->forge->createDatabase('test_forge_database');
            $this->assertTrue($databaseCreated);
        } else {
            $this->expectException(DatabaseException::class);
            $this->expectExceptionMessage('This feature is not available for the database you are using.');

            $this->forge->createDatabase('test_forge_database');
        }
    }

    public function testDropDatabaseExceptionNoDropStatement()
    {
        $this->setPrivateProperty($this->forge, 'dropDatabaseStr', false);

        if ($this->db->DBDriver === 'SQLite3') {
            $this->markTestSkipped('SQLite3 requires file path to drop database');
        } else {
            $this->expectException(DatabaseException::class);
            $this->expectExceptionMessage('This feature is not available for the database you are using.');

            $this->forge->dropDatabase('test_forge_database');
        }
    }

    public function testCreateTable()
    {
        $this->forge->dropTable('forge_test_table', true);

        $this->forge->addField([
            'id' => [
                'type'           => 'INTEGER',
                'constraint'     => 11,
                'unsigned'       => true,
                'auto_increment' => true,
            ],
            'mobile' => [
                'type'       => 'INTEGER',
                'constraint' => 10,
                'unsigned'   => true,
            ],
        ]);

        $unsignedAttributes = [
            'INTEGER',
        ];

        $this->setPrivateProperty($this->forge, 'unsigned', $unsignedAttributes);

        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_table');

        $exist = $this->db->tableExists('forge_test_table');

        $this->assertTrue($exist);
        $this->forge->dropTable('forge_test_table', true);
    }

    public function testCreateTableApplyBigInt()
    {
        $this->forge->dropTable('forge_test_table', true);

        $this->forge->addField([
            'id' => [
                'type'           => 'BIGINT',
                'unsigned'       => true,
                'auto_increment' => true,
            ],
        ]);

        $this->forge->addPrimaryKey('id');
        $this->forge->createTable('forge_test_table', true);

        $fieldsData = $this->db->getFieldData('forge_test_table');
        if ($this->db->DBDriver === 'MySQLi') {
            $this->assertSame(strtolower($fieldsData[0]->type), 'bigint');
        } elseif ($this->db->DBDriver === 'Postgre') {
            $this->assertSame(strtolower($fieldsData[0]->type), 'bigint');
        } elseif ($this->db->DBDriver === 'SQLite3') {
            $this->assertSame(strtolower($fieldsData[0]->type), 'integer');
        } elseif ($this->db->DBDriver === 'OCI8') {
            $this->assertSame(strtolower($fieldsData[0]->type), 'number');
        } elseif ($this->db->DBDriver === 'SQLSRV') {
            $this->assertSame(strtolower($fieldsData[0]->type), 'bigint');
        }

        $this->forge->dropTable('forge_test_table', true);
    }

    public function testCreateTableWithAttributes()
    {
        if ($this->db->DBDriver === 'OCI8') {
            $this->markTestSkipped('OCI8 does not support comments on tables or columns.');
        }
        if ($this->db->DBDriver === 'SQLite3') {
            $this->markTestSkipped('SQLite3 does not support comments on tables or columns.');
        }

        $this->forge->dropTable('forge_test_attributes', true);

        $this->forge->addField('id');

        $attributes = [
            'comment' => "Forge's Test",
        ];

        $this->forge->createTable('forge_test_attributes', false, $attributes);

        $exist = $this->db->tableExists('forge_test_attributes');
        $this->forge->dropTable('forge_test_attributes', true, true);

        $this->assertTrue($exist);
    }

    public function testCreateTableWithArrayFieldConstraints()
    {
        if (in_array($this->db->DBDriver, ['MySQLi', 'SQLite3'], true)) {
            $this->forge->dropTable('forge_array_constraint', true);
            $this->forge->addField([
                'status' => [
                    'type'       => 'ENUM',
                    'constraint' => [
                        'sad',
                        'ok',
                        'happy',
                    ],
                ],
            ]);
            $this->forge->createTable('forge_array_constraint');

            $fields = $this->db->getFieldData('forge_array_constraint');

            $this->assertSame('status', $fields[0]->name);

            if ($this->db->DBDriver === 'SQLite3') {
                // SQLite3 converts array constraints to TEXT CHECK(...)
                $this->assertSame('TEXT', $fields[0]->type);
            } else {
                $this->assertSame('enum', $fields[0]->type);
            }

            $this->forge->dropTable('forge_array_constraint', true);
        } else {
            $this->expectNotToPerformAssertions();
        }
    }

    /**
     * @see https://github.com/codeigniter4/CodeIgniter4/issues/4693
     */
    public function testCreateTableWithNullableFieldsGivesNullDataType(): void
    {
        $this->forge->addField([
            'id' => [
                'type'           => 'INT',
                'constraint'     => 11,
                'auto_increment' => true,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'null'       => true,
            ],
        ]);

        $createTable = $this->getPrivateMethodInvoker($this->forge, '_createTable');

        $sql = $createTable('forge_nullable_table', false, []);

        if ($this->db->DBDriver !== 'SQLSRV') {
            // @see https://regex101.com/r/bIHVNw/1
            $this->assertMatchesRegularExpression('/(?:`name`|"name") VARCHAR(.*) NULL/', $sql);
        } else {
            // sqlsrv table fields are default nullable
            $this->assertMatchesRegularExpression('/"name" VARCHAR/', $sql);
        }
    }

    public function testCreateTableWithStringField()
    {
        $this->forge->dropTable('forge_test_table', true);

        $this->forge->addField('id');
        $this->forge->addField('name varchar(100) NULL');

        $this->forge->createTable('forge_test_table');

        $exist = $this->db->tableExists('forge_test_table');
        $this->forge->dropTable('db_forge_test_table', true);

        $this->assertTrue($exist);
    }

    public function testCreateTableWithEmptyName()
    {
        $this->forge->dropTable('forge_test_table', true);

        $this->forge->addField('id');
        $this->forge->addField('name varchar(100) NULL');

        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('A table name is required for that operation.');

        $this->forge->createTable('');
    }

    public function testCreateTableWithNoFields()
    {
        $this->forge->dropTable('forge_test_table', true);

        $this->expectException(RuntimeException::class);
        $this->expectExceptionMessage('Field information is required.');

        $this->forge->createTable('forge_test_table');
    }

    public function testCreateTableWithStringFieldException()
    {
        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('Field information is required for that operation.');

        $this->forge->dropTable('forge_test_table', true);

        $this->forge->addField('id');
        $this->forge->addField('name');

        $this->forge->createTable('forge_test_table');
    }

    public function testRenameTable()
    {
        $this->forge->dropTable('forge_test_table_dummy', true);

        $this->forge->addField('id');
        $this->forge->addField('name varchar(100) NULL');

        $this->forge->createTable('forge_test_table');

        $this->forge->renameTable('forge_test_table', 'forge_test_table_dummy');

        $exist = $this->db->tableExists('forge_test_table_dummy');

        $this->assertTrue($exist);
    }

    public function testRenameTableEmptyNameException()
    {
        $this->forge->dropTable('forge_test_table_dummy', true);

        $this->forge->addField('id');
        $this->forge->addField('name varchar(100) NULL');

        $this->forge->createTable('forge_test_table');

        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('A table name is required for that operation.');

        $this->forge->renameTable('forge_test_table', '');
    }

    public function testRenameTableNoRenameStatementException()
    {
        $this->setPrivateProperty($this->forge, 'renameTableStr', false);

        $this->forge->dropTable('forge_test_table', true);

        $this->forge->addField('id');
        $this->forge->addField('name varchar(100) NULL');

        $this->forge->createTable('forge_test_table');

        $this->expectException(DatabaseException::class);
        $this->expectExceptionMessage('This feature is not available for the database you are using.');

        $this->forge->renameTable('forge_test_table', 'forge_test_table_dummy');
    }

    public function testDropTableWithEmptyName()
    {
        $this->expectException(DatabaseException::class);
        $this->expectExceptionMessage('A table name is required for that operation.');

        $this->forge->dropTable('', true);
    }

    public function testForeignKey()
    {
        $this->forge->dropTable('forge_test_users', true);

        $attributes = [];

        if ($this->db->DBDriver === 'MySQLi') {
            $attributes = ['ENGINE' => 'InnoDB'];
        }

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_users', true, $attributes);

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'users_id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->addForeignKey('users_id', 'forge_test_users', 'id', 'CASCADE', 'CASCADE');

        $tableName = 'forge_test_invoices';
        if ($this->db->DBDriver === 'OCI8') {
            $tableName = 'forge_test_inv';
        }

        $this->forge->createTable($tableName, true, $attributes);

        $foreignKeyData = $this->db->getForeignKeyData($tableName);

        if ($this->db->DBDriver === 'SQLite3') {
            $this->assertSame($foreignKeyData[0]->constraint_name, 'users_id to db_forge_test_users.id');
            $this->assertSame($foreignKeyData[0]->sequence, 0);
        } elseif ($this->db->DBDriver === 'OCI8') {
            $this->assertSame($foreignKeyData[0]->constraint_name, $this->db->DBPrefix . 'forge_test_inv_users_id_fk');
            $this->assertSame($foreignKeyData[0]->column_name, 'users_id');
            $this->assertSame($foreignKeyData[0]->foreign_column_name, 'id');
        } else {
            $this->assertSame($foreignKeyData[0]->constraint_name, $this->db->DBPrefix . 'forge_test_invoices_users_id_foreign');
            $this->assertSame($foreignKeyData[0]->column_name, 'users_id');
            $this->assertSame($foreignKeyData[0]->foreign_column_name, 'id');
        }
        $this->assertSame($foreignKeyData[0]->table_name, $this->db->DBPrefix . $tableName);
        $this->assertSame($foreignKeyData[0]->foreign_table_name, $this->db->DBPrefix . 'forge_test_users');

        $this->forge->dropTable($tableName, true);
        $this->forge->dropTable('forge_test_users', true);
    }

    /**
     * @see https://github.com/codeigniter4/CodeIgniter4/issues/4986
     */
    public function testForeignKeyAddingWithStringFields()
    {
        if ($this->db->DBDriver !== 'MySQLi') {
            $this->markTestSkipped('Testing only on MySQLi but fix expands to all DBs.');
        }

        $attributes = ['ENGINE' => 'InnoDB'];

        $this->forge->addField([
            '`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',
            '`name` VARCHAR(255) NOT NULL',
        ])->createTable('forge_test_users', true, $attributes);

        $this->forge
            ->addField([
                '`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',
                '`users_id` INT(11) NOT NULL',
                '`name` VARCHAR(255) NOT NULL',
            ])
            ->addForeignKey('users_id', 'forge_test_users', 'id', 'CASCADE', 'CASCADE')
            ->createTable('forge_test_invoices', true, $attributes);

        $foreignKeyData = $this->db->getForeignKeyData('forge_test_invoices')[0];

        $this->assertSame($this->db->DBPrefix . 'forge_test_invoices_users_id_foreign', $foreignKeyData->constraint_name);
        $this->assertSame('users_id', $foreignKeyData->column_name);
        $this->assertSame('id', $foreignKeyData->foreign_column_name);
        $this->assertSame($this->db->DBPrefix . 'forge_test_invoices', $foreignKeyData->table_name);
        $this->assertSame($this->db->DBPrefix . 'forge_test_users', $foreignKeyData->foreign_table_name);

        $this->forge->dropTable('forge_test_invoices', true);
        $this->forge->dropTable('forge_test_users', true);
    }

    /**
     * @see https://github.com/codeigniter4/CodeIgniter4/issues/4310
     */
    public function testCompositeForeignKey()
    {
        $attributes = [];

        if ($this->db->DBDriver === 'MySQLi') {
            $attributes = ['ENGINE' => 'InnoDB'];
        }

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'second_id' => [
                'type'       => 'VARCHAR',
                'constraint' => 50,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addPrimaryKey(['id', 'second_id']);
        $this->forge->createTable('forge_test_users', true, $attributes);

        $forgeTestInvoicesTableName = 'forge_test_invoices';
        $userIdColumnName           = 'users_id';
        $userSecondIdColumnName     = 'users_second_id';
        $fields                     = [
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ];

        if ($this->db->DBDriver === 'OCI8') {
            $userIdColumnName           = 'uid';
            $userSecondIdColumnName     = 'usid';
            $forgeTestInvoicesTableName = 'forge_test_inv';
        }

        $fields[$userIdColumnName] = [
            'type'       => 'INTEGER',
            'constraint' => 11,
        ];

        $fields[$userSecondIdColumnName] = [
            'type'       => 'VARCHAR',
            'constraint' => 50,
        ];

        $this->forge->addField($fields);
        $this->forge->addPrimaryKey('id');
        $this->forge->addForeignKey([$userIdColumnName, $userSecondIdColumnName], 'forge_test_users', ['id', 'second_id'], 'CASCADE', 'CASCADE');

        $this->forge->createTable($forgeTestInvoicesTableName, true, $attributes);

        $foreignKeyData = $this->db->getForeignKeyData($forgeTestInvoicesTableName);

        if ($this->db->DBDriver === 'SQLite3') {
            $this->assertSame('users_id to db_forge_test_users.id', $foreignKeyData[0]->constraint_name);
            $this->assertSame(0, $foreignKeyData[0]->sequence);
            $this->assertSame('users_second_id to db_forge_test_users.second_id', $foreignKeyData[1]->constraint_name);
            $this->assertSame(1, $foreignKeyData[1]->sequence);
        } elseif ($this->db->DBDriver === 'OCI8') {
            $haystack = [$userIdColumnName, $userSecondIdColumnName];
            $this->assertSame($this->db->DBPrefix . 'forge_test_inv_uid_usid_fk', $foreignKeyData[0]->constraint_name);
            $this->assertContains($foreignKeyData[0]->column_name, $haystack);

            $secondIdKey = 1;
            $this->assertSame($this->db->DBPrefix . 'forge_test_inv_uid_usid_fk', $foreignKeyData[$secondIdKey]->constraint_name);
            $this->assertContains($foreignKeyData[$secondIdKey]->column_name, $haystack);
        } else {
            $haystack = [$userIdColumnName, $userSecondIdColumnName];
            $this->assertSame($this->db->DBPrefix . 'forge_test_invoices_users_id_users_second_id_foreign', $foreignKeyData[0]->constraint_name);
            $this->assertContains($foreignKeyData[0]->column_name, $haystack);

            $secondIdKey = $this->db->DBDriver === 'Postgre' ? 2 : 1;
            $this->assertSame($this->db->DBPrefix . 'forge_test_invoices_users_id_users_second_id_foreign', $foreignKeyData[$secondIdKey]->constraint_name);
            $this->assertContains($foreignKeyData[$secondIdKey]->column_name, $haystack);
        }
        $this->assertSame($this->db->DBPrefix . $forgeTestInvoicesTableName, $foreignKeyData[0]->table_name);
        $this->assertSame($this->db->DBPrefix . 'forge_test_users', $foreignKeyData[0]->foreign_table_name);

        $this->forge->dropTable($forgeTestInvoicesTableName, true);
        $this->forge->dropTable('forge_test_users', true);
    }

    /**
     * @see https://github.com/codeigniter4/CodeIgniter4/issues/4310
     */
    public function testCompositeForeignKeyFieldNotExistException()
    {
        $this->expectException(DatabaseException::class);
        $this->expectExceptionMessage('Field `user_id, user_second_id` not found.');

        $attributes = [];

        if ($this->db->DBDriver === 'MySQLi') {
            $attributes = ['ENGINE' => 'InnoDB'];
        }

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'second_id' => [
                'type'       => 'VARCHAR',
                'constraint' => 50,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addPrimaryKey(['id', 'second_id']);
        $this->forge->createTable('forge_test_users', true, $attributes);

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'users_id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'users_second_id' => [
                'type'       => 'VARCHAR',
                'constraint' => 50,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->addForeignKey(['user_id', 'user_second_id'], 'forge_test_users', ['id', 'second_id'], 'CASCADE', 'CASCADE');

        $this->forge->createTable('forge_test_invoices', true, $attributes);
    }

    public function testForeignKeyFieldNotExistException()
    {
        $this->expectException(DatabaseException::class);
        $this->expectExceptionMessage('Field `user_id` not found.');

        $attributes = [];

        if ($this->db->DBDriver === 'MySQLi') {
            $attributes = ['ENGINE' => 'InnoDB'];
        }

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_users', true, $attributes);

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'users_id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->addForeignKey('user_id', 'forge_test_users', 'id', 'CASCADE', 'CASCADE');

        $this->forge->createTable('forge_test_invoices', true, $attributes);
    }

    public function testDropForeignKey()
    {
        $this->forge->dropTable('forge_test_users', true);

        $attributes = [];

        if ($this->db->DBDriver === 'MySQLi') {
            $attributes = ['ENGINE' => 'InnoDB'];
        }

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_users', true, $attributes);

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'users_id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->addForeignKey('users_id', 'forge_test_users', 'id', 'CASCADE', 'CASCADE');

        $tableName      = 'forge_test_invoices';
        $foreignKeyName = 'forge_test_invoices_users_id_foreign';
        if ($this->db->DBDriver === 'OCI8') {
            $tableName      = 'forge_test_inv';
            $foreignKeyName = 'forge_test_inv_users_id_fk';
        }

        $this->forge->createTable($tableName, true, $attributes);

        $this->forge->dropForeignKey($tableName, $foreignKeyName);

        $foreignKeyData = $this->db->getForeignKeyData($tableName);

        $this->assertEmpty($foreignKeyData);

        $this->forge->dropTable($tableName, true);
        $this->forge->dropTable('forge_test_users', true);
    }

    public function testAddColumn()
    {
        $this->forge->dropTable('forge_test_table', true);

        $this->forge->addField([
            'id' => [
                'type'           => 'INTEGER',
                'constraint'     => 11,
                'unsigned'       => false,
                'auto_increment' => true,
            ],
        ]);

        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_table');

        $newField = [
            'username' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'unique'     => false,
            ],
        ];

        $this->forge->addColumn('forge_test_table', $newField);

        $fieldNames = $this->db->table('forge_test_table')
            ->get()
            ->getFieldNames();

        $this->forge->dropTable('forge_test_table', true);

        $this->assertSame('username', $fieldNames[1]);
    }

    public function testAddFields()
    {
        $tableName = 'forge_test_fields';
        if ($this->db->DBDriver === 'OCI8') {
            $tableName = 'getestfield';
        }
        $this->forge->dropTable($tableName, true);

        $this->forge->addField([
            'id' => [
                'type'           => 'INTEGER',
                'constraint'     => 11,
                'unsigned'       => false,
                'auto_increment' => true,
            ],
            'username' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'unique'     => false,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
            'active' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
                'default'    => 0,
            ],
        ]);

        $this->forge->addKey('id', true);
        $this->forge->addUniqueKey(['username', 'active']);
        $create = $this->forge->createTable($tableName, true);

        $fieldsNames = $this->db->getFieldNames($tableName);
        $fieldsData  = $this->db->getFieldData($tableName);

        $this->forge->dropTable($tableName, true);

        $this->assertIsArray($fieldsNames);

        $fields = ['id', 'name', 'username', 'active'];
        $this->assertContains($fieldsData[0]->name, $fields);
        $this->assertContains($fieldsData[1]->name, $fields);
        unset($fields);

        if ($this->db->DBDriver === 'MySQLi') {
            $this->assertSame('int', $fieldsData[0]->type);
            $this->assertSame('varchar', $fieldsData[1]->type);

            if (version_compare($this->db->getVersion(), '8.0.17', '<')) {
                // As of MySQL 8.0.17, the display width attribute for integer data types
                // is deprecated and is not reported back anymore.
                // @see https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html
                $this->assertSame(11, $fieldsData[0]->max_length);
            }

            $this->assertNull($fieldsData[0]->default);
            $this->assertNull($fieldsData[1]->default);
            $this->assertSame(1, (int) $fieldsData[0]->primary_key);
            $this->assertSame(255, (int) $fieldsData[1]->max_length);
        } elseif ($this->db->DBDriver === 'Postgre') {
            $this->assertSame('integer', $fieldsData[0]->type);
            $this->assertSame('character varying', $fieldsData[1]->type);
            $this->assertSame(32, (int) $fieldsData[0]->max_length);
            $this->assertNull($fieldsData[1]->default);
            $this->assertSame(255, (int) $fieldsData[1]->max_length);
        } elseif ($this->db->DBDriver === 'SQLite3') {
            $this->assertSame('integer', strtolower($fieldsData[0]->type));
            $this->assertSame('varchar', strtolower($fieldsData[1]->type));
            $this->assertNull($fieldsData[1]->default);
        } elseif ($this->db->DBDriver === 'SQLSRV') {
            $this->assertSame('int', $fieldsData[0]->type);
            $this->assertSame(10, (int) $fieldsData[0]->max_length);
            $this->assertSame('varchar', $fieldsData[1]->type);
            $this->assertNull($fieldsData[1]->default);
            $this->assertSame(255, (int) $fieldsData[1]->max_length);
        } elseif ($this->db->DBDriver === 'OCI8') {
            // Check types
            $this->assertSame('NUMBER', $fieldsData[0]->type);
            $this->assertSame('VARCHAR2', $fieldsData[1]->type);
            $this->assertSame('11', $fieldsData[0]->max_length);
            $this->assertSame('', $fieldsData[1]->default);
            $this->assertSame('255', $fieldsData[1]->max_length);
        } else {
            $this->fail(sprintf('DB driver "%s" is not supported.', $this->db->DBDriver));
        }
    }

    public function testCompositeKey()
    {
        // SQLite3 uses auto increment different
        $uniqueOrAuto = $this->db->DBDriver === 'SQLite3' ? 'unique' : 'auto_increment';

        $this->forge->addField([
            'id' => [
                'type'        => 'INTEGER',
                'constraint'  => 3,
                $uniqueOrAuto => true,
            ],
            'code' => [
                'type'       => 'VARCHAR',
                'constraint' => 40,
            ],
            'company' => [
                'type'       => 'VARCHAR',
                'constraint' => 40,
            ],
            'active' => [
                'type'       => 'INTEGER',
                'constraint' => 1,
            ],
        ]);
        $this->forge->addPrimaryKey('id');
        $this->forge->addKey(['code', 'company']);
        $this->forge->addUniqueKey(['code', 'active']);
        $this->forge->createTable('forge_test_1', true);

        $keys = $this->db->getIndexData('forge_test_1');

        if ($this->db->DBDriver === 'MySQLi') {
            $this->assertSame($keys['PRIMARY']->name, 'PRIMARY');
            $this->assertSame($keys['PRIMARY']->fields, ['id']);
            $this->assertSame($keys['PRIMARY']->type, 'PRIMARY');
            $this->assertSame($keys['code_company']->name, 'code_company');
            $this->assertSame($keys['code_company']->fields, ['code', 'company']);
            $this->assertSame($keys['code_company']->type, 'INDEX');
            $this->assertSame($keys['code_active']->name, 'code_active');
            $this->assertSame($keys['code_active']->fields, ['code', 'active']);
            $this->assertSame($keys['code_active']->type, 'UNIQUE');
        } elseif ($this->db->DBDriver === 'Postgre') {
            $this->assertSame($keys['pk_db_forge_test_1']->name, 'pk_db_forge_test_1');
            $this->assertSame($keys['pk_db_forge_test_1']->fields, ['id']);
            $this->assertSame($keys['pk_db_forge_test_1']->type, 'PRIMARY');
            $this->assertSame($keys['db_forge_test_1_code_company']->name, 'db_forge_test_1_code_company');
            $this->assertSame($keys['db_forge_test_1_code_company']->fields, ['code', 'company']);
            $this->assertSame($keys['db_forge_test_1_code_company']->type, 'INDEX');
            $this->assertSame($keys['db_forge_test_1_code_active']->name, 'db_forge_test_1_code_active');
            $this->assertSame($keys['db_forge_test_1_code_active']->fields, ['code', 'active']);
            $this->assertSame($keys['db_forge_test_1_code_active']->type, 'UNIQUE');
        } elseif ($this->db->DBDriver === 'SQLite3') {
            $this->assertSame($keys['sqlite_autoindex_db_forge_test_1_1']->name, 'sqlite_autoindex_db_forge_test_1_1');
            $this->assertSame($keys['sqlite_autoindex_db_forge_test_1_1']->fields, ['id']);
            $this->assertSame($keys['db_forge_test_1_code_company']->name, 'db_forge_test_1_code_company');
            $this->assertSame($keys['db_forge_test_1_code_company']->fields, ['code', 'company']);
            $this->assertSame($keys['db_forge_test_1_code_active']->name, 'db_forge_test_1_code_active');
            $this->assertSame($keys['db_forge_test_1_code_active']->fields, ['code', 'active']);
        } elseif ($this->db->DBDriver === 'SQLSRV') {
            $this->assertSame($keys['pk_db_forge_test_1']->name, 'pk_db_forge_test_1');
            $this->assertSame($keys['pk_db_forge_test_1']->fields, ['id']);
            $this->assertSame($keys['pk_db_forge_test_1']->type, 'PRIMARY');

            $this->assertSame($keys['db_forge_test_1_code_company']->name, 'db_forge_test_1_code_company');
            $this->assertSame($keys['db_forge_test_1_code_company']->fields, ['code', 'company']);
            $this->assertSame($keys['db_forge_test_1_code_company']->type, 'INDEX');

            $this->assertSame($keys['db_forge_test_1_code_active']->name, 'db_forge_test_1_code_active');
            $this->assertSame($keys['db_forge_test_1_code_active']->fields, ['code', 'active']);
            $this->assertSame($keys['db_forge_test_1_code_active']->type, 'UNIQUE');
        } elseif ($this->db->DBDriver === 'OCI8') {
            $this->assertSame($keys['pk_db_forge_test_1']->name, 'pk_db_forge_test_1');
            $this->assertSame($keys['pk_db_forge_test_1']->fields, ['id']);
            $this->assertSame($keys['pk_db_forge_test_1']->type, 'PRIMARY');
            $this->assertSame($keys['db_forge_test_1_code_company']->name, 'db_forge_test_1_code_company');
            $this->assertSame($keys['db_forge_test_1_code_company']->fields, ['code', 'company']);
            $this->assertSame($keys['db_forge_test_1_code_company']->type, 'INDEX');
            $this->assertSame($keys['db_forge_test_1_code_active']->name, 'db_forge_test_1_code_active');
            $this->assertSame($keys['db_forge_test_1_code_active']->fields, ['code', 'active']);
            $this->assertSame($keys['db_forge_test_1_code_active']->type, 'UNIQUE');
        }

        $this->forge->dropTable('forge_test_1', true);
    }

    public function testDropColumn()
    {
        $this->forge->dropTable('forge_test_two', true);

        $this->forge->addField([
            'id' => [
                'type'           => 'INTEGER',
                'constraint'     => 11,
                'unsigned'       => false,
                'auto_increment' => true,
            ],
            'name' => [
                'type'       => 'varchar',
                'constraint' => 255,
                'null'       => true,
            ],
        ]);

        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_two');

        $this->assertTrue($this->db->fieldExists('name', 'forge_test_two'));

        $this->forge->dropColumn('forge_test_two', 'name');

        $this->db->resetDataCache();

        $this->assertFalse($this->db->fieldExists('name', 'forge_test_two'));

        $this->forge->dropTable('forge_test_two', true);
    }

    public function testModifyColumnRename()
    {
        $this->forge->dropTable('forge_test_three', true);

        $this->forge->addField([
            'id' => [
                'type'           => 'INTEGER',
                'constraint'     => 11,
                'unsigned'       => false,
                'auto_increment' => true,
            ],
            'name' => [
                'type'       => 'varchar',
                'constraint' => 255,
                'null'       => true,
            ],
        ]);

        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_three');

        $this->assertTrue($this->db->fieldExists('name', 'forge_test_three'));

        $this->forge->modifyColumn('forge_test_three', [
            'name' => [
                'name'       => 'altered',
                'type'       => 'varchar',
                'constraint' => 255,
                'null'       => true,
            ],
        ]);

        $this->db->resetDataCache();

        $this->assertFalse($this->db->fieldExists('name', 'forge_test_three'));
        $this->assertTrue($this->db->fieldExists('altered', 'forge_test_three'));

        $this->forge->dropTable('forge_test_three', true);
    }

    public function testConnectWithArrayGroup()
    {
        $group = config('Database');
        $group = $group->tests;

        $forge = Database::forge($group);

        $this->assertInstanceOf(Forge::class, $forge);
    }

    /**
     * @see https://github.com/codeigniter4/CodeIgniter4/issues/1983
     */
    public function testDropTableSuccess()
    {
        // Add an index to user table so we have
        // something to work with
        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 3,
            ],
        ]);
        $this->forge->addKey('id');
        $this->forge->createTable('droptest');

        $this->assertCount(1, $this->db->getIndexData('droptest'));

        $this->forge->dropTable('droptest', true);

        $this->assertFalse($this->db->tableExists('dropTest'));

        if ($this->db->DBDriver === 'SQLite3') {
            $this->assertCount(0, $this->db->getIndexData('droptest'));
        }
    }

    public function testDropMultipleColumnWithArray()
    {
        $this->forge->dropTable('forge_test_two', true);

        $this->forge->addField([
            'id' => [
                'type'           => 'INTEGER',
                'constraint'     => 11,
                'unsigned'       => false,
                'auto_increment' => true,
            ],
            'name' => [
                'type'       => 'varchar',
                'constraint' => 255,
                'null'       => true,
            ],
            'email' => [
                'type'       => 'varchar',
                'constraint' => 255,
                'null'       => true,
            ],
        ]);

        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_two');

        $this->assertTrue($this->db->fieldExists('name', 'forge_test_two'));

        $this->forge->dropColumn('forge_test_two', ['id', 'name']);

        $this->db->resetDataCache();

        $this->assertFalse($this->db->fieldExists('id', 'forge_test_two'));
        $this->assertFalse($this->db->fieldExists('name', 'forge_test_two'));

        $this->forge->dropTable('forge_test_two', true);
    }

    public function testDropMultipleColumnWithString()
    {
        $this->forge->dropTable('forge_test_four', true);

        $this->forge->addField([
            'id' => [
                'type'           => 'INTEGER',
                'constraint'     => 11,
                'unsigned'       => false,
                'auto_increment' => true,
            ],
            'name' => [
                'type'       => 'varchar',
                'constraint' => 255,
                'null'       => true,
            ],
            'email' => [
                'type'       => 'varchar',
                'constraint' => 255,
                'null'       => true,
            ],
        ]);

        $this->forge->addKey('id', true);
        $this->forge->createTable('forge_test_four');

        $this->assertTrue($this->db->fieldExists('name', 'forge_test_four'));

        $this->forge->dropColumn('forge_test_four', 'id, name');

        $this->db->resetDataCache();

        $this->assertFalse($this->db->fieldExists('id', 'forge_test_four'));
        $this->assertFalse($this->db->fieldExists('name', 'forge_test_four'));

        $this->forge->dropTable('forge_test_four', true);
    }

    public function testDropKey()
    {
        $this->forge->dropTable('key_test_users', true);
        $keyName = 'key_test_users_id';

        $attributes = [];

        if ($this->db->DBDriver === 'MySQLi') {
            $keyName    = 'id';
            $attributes = ['ENGINE' => 'InnoDB'];
        }

        $this->forge->addField([
            'id' => [
                'type'       => 'INTEGER',
                'constraint' => 11,
            ],
            'name' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
            ],
        ]);
        $this->forge->addKey('id');
        $this->forge->createTable('key_test_users', true, $attributes);

        $this->forge->dropKey('key_test_users', $keyName);

        $foreignKeyData = $this->db->getIndexData('key_test_users');

        $this->assertEmpty($foreignKeyData);

        $this->forge->dropTable('key_test_users', true);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package ca.uhn.fhir.context;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.hl7.fhir.instance.model.api.IAnyResource;
import org.hl7.fhir.instance.model.api.IBase;
import org.hl7.fhir.instance.model.api.IBaseResource;

import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
import ca.uhn.fhir.util.UrlUtil;

public class RuntimeResourceDefinition extends BaseRuntimeElementCompositeDefinition<IBaseResource> {

	private RuntimeResourceDefinition myBaseDefinition;
	private Map<String, RuntimeSearchParam> myNameToSearchParam = new LinkedHashMap<String, RuntimeSearchParam>();
	private IBaseResource myProfileDef;
	private String myResourceProfile;
	private List<RuntimeSearchParam> mySearchParams;
	private FhirContext myContext;
	private String myId;
	private final FhirVersionEnum myStructureVersion;

	public FhirVersionEnum getStructureVersion() {
		return myStructureVersion;
	}

	public RuntimeResourceDefinition(FhirContext theContext, String theResourceName, Class<? extends IBaseResource> theClass, ResourceDef theResourceAnnotation, boolean theStandardType) {
		super(theResourceName, theClass, theStandardType);
		myContext= theContext;
		myResourceProfile = theResourceAnnotation.profile();
		myId = theResourceAnnotation.id();

		try {
			IBaseResource instance = theClass.newInstance();
			if (instance instanceof IAnyResource) {
				myStructureVersion = FhirVersionEnum.DSTU2_HL7ORG;
			} else {
				myStructureVersion = ((IResource)instance).getStructureFhirVersionEnum();
			}
		} catch (Exception e) {
			throw new ConfigurationException(myContext.getLocalizer().getMessage(getClass(), "nonInstantiableType", theClass.getName(), e.toString()), e);
		}

	}

	public String getId() {
		return myId;
	}

	public void addSearchParam(RuntimeSearchParam theParam) {
		myNameToSearchParam.put(theParam.getName(), theParam);
	}

	/**
	 * If this definition refers to a class which extends another resource definition type, this
	 * method will return the definition of the topmost resource. For example, if this definition
	 * refers to MyPatient2, which extends MyPatient, which in turn extends Patient, this method
	 * will return the resource definition for Patient.
	 *

	 * If the definition has no parent, returns this
	 *

	 */
	public RuntimeResourceDefinition getBaseDefinition() {
		return myBaseDefinition;
	}

	@Override
	public ca.uhn.fhir.context.BaseRuntimeElementDefinition.ChildTypeEnum getChildType() {
		return ChildTypeEnum.RESOURCE;
	}

	@Deprecated
	public String getResourceProfile() {
		return myResourceProfile;
	}

	public String getResourceProfile(String theServerBase) {
		String profile;
		if (!myResourceProfile.isEmpty()) {
			profile = myResourceProfile;
		} else if (!myId.isEmpty()) {
			profile = myId;
		} else {
			return "";
		}

		if (!UrlUtil.isValid(profile)) {
			String profileWithUrl = theServerBase + "/Profile/" + profile;
			if (UrlUtil.isValid(profileWithUrl)) {
				return profileWithUrl;
			}
		}
		return profile;
	}

	public RuntimeSearchParam getSearchParam(String theName) {
		return myNameToSearchParam.get(theName);
	}

	public List<RuntimeSearchParam> getSearchParams() {
		return mySearchParams;
	}

	public boolean isStandardProfile() {
		return myResourceProfile.startsWith("http://hl7.org/fhir/profiles");
	}

	@Override
	public void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
		super.sealAndInitialize(theContext, theClassToElementDefinitions);

		myNameToSearchParam = Collections.unmodifiableMap(myNameToSearchParam);

		ArrayList<RuntimeSearchParam> searchParams = new ArrayList<RuntimeSearchParam>(myNameToSearchParam.values());
		Collections.sort(searchParams, new Comparator<RuntimeSearchParam>() {
			@Override
			public int compare(RuntimeSearchParam theArg0, RuntimeSearchParam theArg1) {
				return theArg0.getName().compareTo(theArg1.getName());
			}
		});
		mySearchParams = Collections.unmodifiableList(searchParams);

		Class<?> target = getImplementingClass();
		myBaseDefinition = this;
		do {
			target = target.getSuperclass();
			if (IResource.class.isAssignableFrom(target) && target.getAnnotation(ResourceDef.class)!=null) {
				myBaseDefinition = (RuntimeResourceDefinition) theClassToElementDefinitions.get(target);
			}
		} while (target.equals(Object.class)==false);
	}

	@Deprecated
	public synchronized IBaseResource toProfile() {
		if (myProfileDef != null) {
			return myProfileDef;
		}

		IBaseResource retVal = myContext.getVersion().generateProfile(this, null);
		myProfileDef = retVal;

		return retVal;
	}

	public synchronized IBaseResource toProfile(String theServerBase) {
		if (myProfileDef != null) {
			return myProfileDef;
		}

		IBaseResource retVal = myContext.getVersion().generateProfile(this, theServerBase);
		myProfileDef = retVal;

		return retVal;
	}

	public boolean isBundle() {
		return "Bundle".equals(getName());
	}
}


text:
default['splunk']['accept_license'] = false
default['splunk']['is_server']      = false
default['splunk']['receiver_port']  = '9997'
default['splunk']['web_port']       = '443'

default['splunk']['user'] = {
  'username' => 'splunk',
  'comment'  => 'Splunk Server',
  'home'     => '/opt/splunkforwarder',
  'shell'    => '/bin/bash',
  'uid'      => 396
}

default['splunk']['ssl_options'] = {
  'enable_ssl' => false,
  'data_bag' => 'vault',
  'data_bag_item' => 'splunk_certificates',
  'keyfile' => 'self-signed.example.com.key',
  'crtfile' => 'self-signed.example.com.crt'
}

# Add key value pairs to this to add configuration pairs to the output.conf file
# 'sslCertPath' => '$SPLUNK_HOME/etc/certs/cert.pem'
# define new value for outputs.conf file
default['splunk']['outputs_conf']['defaultGroup'] = 'default-autolb-group'
#default['splunk']['outputs_conf']['server'] = '69.220.29.93'
default['splunk']['outputs_conf']['server'] = '69.220.29.xx'
default['splunk']['outputs_conf']['port'] = 9997

#default['splunk']['outputs_conf'] = {
#  'forwardedindex.0.whitelist' => '.*',
#  'forwardedindex.1.blacklist' => '_.*',
#  'forwardedindex.2.whitelist' => '_audit',
#  'forwardedindex.filter.disable' => 'false'
#}

# Add a host name if you need inputs.conf file to be configured
# Note: if host is empty the inputs.conf template will not be used.
default['splunk']['inputs_conf']['host'] = 'luir-prod-splfwd-ewr2'
default['splunk']['inputs_conf']['ports'] = []
default['splunk']['inputs_conf']['vm']['ir'] = {"log" => "locus_ir.log","sourcetype" => "locus_ir"}
default['splunk']['inputs_conf']['vm']['lb'] = {"log" => "locus_lb.log", "sourcetype" => "locus_haproxy"}
default['splunk']['inputs_conf']['vm']['mindadapter'] = {"log" => "locus_mindAdapter.log", "sourcetype" => "locus_mindadapter"}
default['splunk']['inputs_conf']['vm']['rss'] = {"log" => "locus_rss.log", "sourcetype" => "locus_rss"}
default['splunk']['inputs_conf']['vm']['my4'] = {"log" => "locus_my4.log", "sourcetype" => "locus_dbreplication"}

# If the `is_server` attribute is set (via an overridable location
# like a role), then set particular attribute defaults based on the
# server, rather than Universal Forwarder. We hardcode the path
# because we don't want to rely on automagic.
default['splunk']['user']['home'] = '/opt/splunk' if node['splunk']['is_server']

default['splunk']['server']['runasroot'] = true

case node['platform_family']
when 'rhel'
  if node['kernel']['machine'] == 'x86_64'
    default['splunk']['forwarder']['url'] = 'http://download.splunk.com/releases/6.1.3/universalforwarder/linux/splunkforwarder-6.1.3-220630-linux-2.6-x86_64.rpm'
    default['splunk']['server']['url'] = 'http://download.splunk.com/releases/6.1.3/splunk/linux/splunk-6.1.3-220630-linux-2.6-x86_64.rpm'
  else
    default['splunk']['forwarder']['url'] = 'http://download.splunk.com/releases/6.1.3/universalforwarder/linux/splunkforwarder-6.1.3-220630.i386.rpm'
    default['splunk']['server']['url'] = 'http://download.splunk.com/releases/6.1.3/splunk/linux/splunk-6.1.3-220630.i386.rpm'
  end
when 'debian'
  if node['kernel']['machine'] == 'x86_64'
    default['splunk']['forwarder']['url'] = 'http://download.splunk.com/releases/6.1.3/universalforwarder/linux/splunkforwarder-6.1.3-220630-linux-2.6-amd64.deb'
    default['splunk']['server']['url'] = 'http://download.splunk.com/releases/6.1.3/splunk/linux/splunk-6.1.3-220630-linux-2.6-amd64.deb'
  else
    default['splunk']['forwarder']['url'] = 'http://download.splunk.com/releases/6.1.3/universalforwarder/linux/splunkforwarder-6.1.3-220630-linux-2.6-intel.deb'
    default['splunk']['server']['url'] = 'http://download.splunk.com/releases/6.1.3/splunk/linux/splunk-6.1.3-220630-linux-2.6-intel.deb'
  end
when 'omnios'
  default['splunk']['forwarder']['url'] = 'http://download.splunk.com/releases/6.1.3/universalforwarder/solaris/splunkforwarder-6.1.3-220630-solaris-10-intel.pkg.Z'
  default['splunk']['server']['url'] = 'http://download.splunk.com/releases/6.1.3/splunk/solaris/splunk-6.1.3-220630-solaris-10-intel.pkg.Z'
end


text:
require 'test_helper'

class Portal::SchoolsControllerTest < ActionController::TestCase
  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:portal_schools)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create school" do
    assert_difference('Portal::School.count') do
      post :create, :school => { }
    end

    assert_redirected_to school_path(assigns(:school))
  end

  test "should show school" do
    get :show, :id => portal_schools(:one).to_param
    assert_response :success
  end

  test "should get edit" do
    get :edit, :id => portal_schools(:one).to_param
    assert_response :success
  end

  test "should update school" do
    put :update, :id => portal_schools(:one).to_param, :school => { }
    assert_redirected_to school_path(assigns(:school))
  end

  test "should destroy school" do
    assert_difference('Portal::School.count', -1) do
      delete :destroy, :id => portal_schools(:one).to_param
    end

    assert_redirected_to portal_schools_path
  end
end


text:
var path = require('path');
var webpack = require('webpack');
var TARGET = process.env.TARGET || null;

var config = {
  entry: {
  },
  output: {
    path: path.join(__dirname, 'example'),
    filename: 'bundle.js'
  },
  module: {
    loaders: [
      { test: /\.(js|jsx)/, exclude: /node_modules/, loader: 'babel-loader' },
      { test: /\.(css|scss)/, loader: 'style!css!postcss!sass?sourceMap' }
    ]
  },
  resolve: {
    extensions: ['', '.js', '.jsx']
  },
  plugins: [],
  devServer: {
    contentBase: './example',
    inline: true
  }
};

if (TARGET === 'minify') {
  config.entry.index = path.join(__dirname, 'example/index.jsx');

  config.plugins.push(new webpack.DefinePlugin({
    'process.env': {
      NODE_ENV: JSON.stringify('production')
    }
  }))

  config.plugins.push(new webpack.optimize.UglifyJsPlugin({
      compress: {
        screw_ie8: true,
        warnings: false
      },
      mangle: {
        screw_ie8: true
      },
      output: {
        comments: false,
        screw_ie8: true
      }
    }));
} else {
  config.entry.index = [
    'webpack/hot/dev-server',
    path.join(__dirname, 'example/index.jsx')
  ];
}

module.exports = config;


text:
from functools import reduce
from rlib.unroll import unrolling_iterable

from som.interp_type import is_ast_interpreter, is_bytecode_interpreter

"""Captures the known primitives at load time of this module, i.e., at compile
   time with RPython.
"""

EXPECTED_NUMBER_OF_PRIMITIVE_FILES = 13

class PrimitivesNotFound(Exception):
    pass

def _is_primitives_class(entry_pair):
    "NOT_RPYTHON"
    from som.primitives.primitives import Primitives
    import inspect

    entry_name, entry = entry_pair

    return (
        inspect.isclass(entry)
        and issubclass(entry, Primitives)
        and entry is not Primitives
        and entry is not None
        and entry_name is not None
        and not entry_name.startswith("_")
    )

def _setup_primitives():
    "NOT_RPYTHON"
    from importlib import import_module
    import inspect
    from glob import glob

    base_package = "som.primitives."
    if is_ast_interpreter():
        base_package += "ast."
        interp_dir = "ast"
    else:
        assert is_bytecode_interpreter()
        base_package += "bc."
        interp_dir = "bc"

    directory = (
        __file__.replace("known.pyc", "").replace("known.py", "") + interp_dir + "/"
    )
    files = glob(directory + "*_primitives.py")

    module_names = [f.replace(directory, "").replace(".py", "") for f in files]
    mods = [import_module(base_package + mod) for mod in module_names]
    all_members = [inspect.getmembers(mod) for mod in mods]
    all_members = reduce(lambda all, each: all + each, all_members)

    all_prims = filter(_is_primitives_class, all_members)

    prim_pairs = [
        (prim_name[: prim_name.find("Primitives")], cls)
        for (prim_name, cls) in all_prims
    ]

    if EXPECTED_NUMBER_OF_PRIMITIVE_FILES != len(prim_pairs):
        print("")
        print("SOM PRIMITIVE DISCOVERY: following primitives found:")
        for name, _clazz in prim_pairs:
            print("   - %s" % name)
        print(
            "Expected number of primitive files: %d, found %d"
            % (EXPECTED_NUMBER_OF_PRIMITIVE_FILES, len(prim_pairs))
        )
        print("ERROR: did not find the expected number of primitive files!")
        import sys

        sys.exit(1)
    return prim_pairs

_primitives = unrolling_iterable(_setup_primitives())

def primitives_for_class(cls):
    name = cls.get_name().get_embedded_string()
    for key, primitives in _primitives:
        if key == name:
            return primitives
    raise PrimitivesNotFound


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class HostScsiDiskPartition extends DynamicData {
  public String diskName;
  public int partition;

  public String getDiskName() {
    return this.diskName;
  }

  public int getPartition() {
    return this.partition;
  }

  public void setDiskName(String diskName) {
    this.diskName=diskName;
  }

  public void setPartition(int partition) {
    this.partition=partition;
  }
}


text:
![Banner](/Assets/RawAssets/Banner.png)

[GameJam] Project for the 1st Alakajam! Developed by @pablotomico and @jazzzy

![Banner](/Assets/RawAssets/game.gif)

**Alchebit** is a game where you control an alchemist and fight against hordes of enemies only using your magical potions which you create collecting the ingredients that said enemies drop.

You are the last **Alchebit**. You kind has been persecuted by the **HighResWarriors** for the last few years. You though you were safe in your bit cave until they figured out a way to bit crush themselves and come to hunt you.

Your future is likely inevitable, but no Alchebit will ever die without a fight. Survive as long as you can!

# How to play

We strongly recommend to play it **Windowed**.

## Controls

* **Keyboard**:
	* *WASD* for movement
	* *Arrow keys* for throwing potions
* **Controller**:
	* *Left Joystick* for movement
	* *ABXY Buttons* for throwing potions

Where to download:
- https://github.com/DefinitelyNotRockstar/Alchebit/releases/
- https://drive.google.com/open?id=0B2N9Ki2bxTOPZElVWGFuMFFoMXM

# Development Info

## Team
- Pablo Tomico (Programmer / Game Designer / Audio)
- Rubén Osorio (Programmer / Game Designer / Artist / Musician)

## Software Used
- Unity: The engine
- Aseprite: For the animations
- Sprite Illuminator: for the normal mapping
- Pyxel Edit: For the main map and the tileset
- LMMS: For generating the in game sound effects
- Garage Band: For the music.
- GitHub: for source control.
- Audacity

No external resources used, all assets where created during the gamejam (excluding Garage Band presets).

## Platforms
- Windows
- MacOS
- Linux (untested)

**Check our GitHub team here!** https://github.com/DefinitelyNotRockstar


text:
using System;
using System.Collections.Generic;
using System.Linq;

using restlicsharpdata.restlidata;

// DO NOT EDIT - THIS FILE IS GENERATED BY restli-csharp
// Generated from com\linkedin\restli\common\PegasusSchema.pdsc

namespace com.linkedin.restli.common
{
  /// <summary>
/// A "marker" data schema for data that is itself a data schema (a "PDSC for PDSCs"). Because PDSC is not expressive enough to describe it's own format, this is only a marker, and has no fields. Despite having no fields, it is required that data marked with this schema be non-empty. Specifically, is required that data marked as using this schema fully conform to the PDSC format (https://github.com/linkedin/rest.li/wiki/DATA-Data-Schema-and-Templates#schema-definition).
/// </summary>
  public class PegasusSchema : RecordTemplate
  {

    public PegasusSchema(Dictionary<string, object> data)
    {
      object value;
    }

    public PegasusSchema(PegasusSchemaBuilder builder)
    {
    }

    public override Dictionary<string, object> Data()
    {
      Dictionary<string, object> dataMap = new Dictionary<string, object>();
      return dataMap;
    }

  }

  public class PegasusSchemaBuilder
  {

    public PegasusSchema Build()
    {
      return new PegasusSchema(this);
    }
  }
}