\doxysection{connect-\/local.php}
\hypertarget{connect-local_8php_source}{}\label{connect-local_8php_source}\index{api/connect-\/local.php@{api/connect-\/local.php}}
\mbox{\hyperlink{connect-local_8php}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00001}00001\ <?php}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00002}00002\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00031}00031\ require\_once(\textcolor{stringliteral}{'../vendor/autoload.php'});}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00032}00032\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00033}\mbox{\hyperlink{connect-local_8php_ad79b54e31bd1050001133c4d70f850fe}{00033}}\ \mbox{\hyperlink{connect-local_8php_a59f6106d84ceb901b027ca96381d59c8}{\$dotenv}}\ =\ Dotenv\(\backslash\)Dotenv::createImmutable(\_\_DIR\_\_);}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00034}00034\ \mbox{\hyperlink{connect-local_8php_a59f6106d84ceb901b027ca96381d59c8}{\$dotenv}}-\/>load();}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00035}00035\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00037}00037\ \mbox{\hyperlink{connect-local_8php_ad79b54e31bd1050001133c4d70f850fe}{\$servername}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLHOST'}];}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00038}00038\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00040}00040\ \mbox{\hyperlink{connect-local_8php_a7691c0162d89de0b6ba47edcd8ba8878}{\$database}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLDATABASE'}];}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00041}00041\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00043}00043\ \mbox{\hyperlink{connect-local_8php_a0eb82aa5f81cf845de4b36cd653c42cf}{\$username}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLUSER'}];}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00044}00044\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00046}00046\ \mbox{\hyperlink{connect-local_8php_a607686ef9f99ea7c42f4f3dd3dbb2b0d}{\$password}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLPASSWORD'}];}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00047}00047\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00049}00049\ \mbox{\hyperlink{connect-local_8php_aa0787efab4b22e8a212882f3409d4c77}{\$port}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLPORT'}];}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00050}00050\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00052}00052\ \mbox{\hyperlink{connect-local_8php_ac01bf1cf041487498864d054b991f570}{\$protocol}}\ =\ \textcolor{stringliteral}{'TCP'};}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00053}00053\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00055}00055\ \mbox{\hyperlink{connect-local_8php_af10158dd74b75f1d337e83102d6b82ce}{\$charset}}\ =\ \textcolor{stringliteral}{'utf8mb4'};}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00056}00056\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00058}00058\ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}\ =\ \textcolor{keyword}{new}\ mysqli(\mbox{\hyperlink{connect-local_8php_ad79b54e31bd1050001133c4d70f850fe}{\$servername}},\ \mbox{\hyperlink{connect-local_8php_a0eb82aa5f81cf845de4b36cd653c42cf}{\$username}},\ \mbox{\hyperlink{connect-local_8php_a607686ef9f99ea7c42f4f3dd3dbb2b0d}{\$password}},\ \mbox{\hyperlink{connect-local_8php_a7691c0162d89de0b6ba47edcd8ba8878}{\$database}});}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00059}00059\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00060}00060\ \textcolor{comment}{//\ Verifica\ a\ conexão}}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00061}00061\ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>connect\_error)\ \{}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00062}00062\ \ \ \ \ die(\textcolor{stringliteral}{"{}Conexão\ falhou:\ "{}}\ .\ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>connect\_error);}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00063}00063\ \}}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00064}00064\ }
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00065}00065\ \textcolor{keywordflow}{if}\ (\$\_GET\ and\ boolVal(\$\_GET[\textcolor{stringliteral}{"{}teste"{}}]))\ \{}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00066}00066\ \ \ \ \ echo(\textcolor{stringliteral}{"{}Conexão\ bem\ sucedida."{}});}
\DoxyCodeLine{\Hypertarget{connect-local_8php_source_l00067}00067\ \}}

\end{DoxyCode}
