View file install/content/temps/requirements.phtml

File size: 13.75Kb
<?php
# @*************************************************************************@
# @ Software author: Mansur Altamirov (Mansur_TL)							@
# @ Author_url 1: https://www.instagram.com/mansur_tl                       @
# @ Author_url 2: http://codecanyon.net/user/mansur_tl                      @
# @ Author E-mail: vayart.help@gmail.com                                    @
# @*************************************************************************@
# @ ColibriSM - The Ultimate Modern Social Media Sharing Platform           @
# @ Copyright (c) 2020 - 2021 ColibriSM. All rights reserved.               @
# @*************************************************************************@

$win_os_family = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
$php_version   = version_compare(PHP_VERSION, '5.5.0', '>=');
$mysqli_exists = function_exists('mysqli_connect');
$gdlib_exists  = (extension_loaded('gd') && function_exists('gd_info'));
$mbstr_exists  = extension_loaded('mbstring');
$phpzip_exists = extension_loaded('zip');
$config_exists = ($win_os_family == true) ? true : is_writable(PROJ_RP . '/core/settings.php');
$dbsql_exists  = ($win_os_family == true) ? true : (file_exists(PROJ_RP . '/colibri-db.sql') && is_readable(PROJ_RP . '/colibri-db.sql'));
$curl_status   = function_exists('curl_version');
$reqs_exists   = array();
$reqs_exists[] = $php_version;
$reqs_exists[] = $mysqli_exists;
$reqs_exists[] = $gdlib_exists;
$reqs_exists[] = $mbstr_exists;
$reqs_exists[] = $phpzip_exists;
$reqs_exists[] = $config_exists;
$reqs_exists[] = $dbsql_exists;
$reqs_exists[] = $curl_status;



$_SESSION['init'] = array(
	"reqs" => in_array(false, $reqs_exists)
);
?>

<div class="main-cont-inner">
	<div class="cont-header">
		<div class="row">
			<div class="col-6">
				<h2>
					<span class="icon">
						<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M277 360h-42V235h42v125zm0-166h-42v-42h42v42z"/></svg>
					</span>
					<span class="text">
						Requirements
					</span>
				</h2>
			</div>
			<div class="col-6">
				<div class="go-back">
					<a href="?p=terms">
						<svg role="img" xmlns="http://www.w3.org/2000/svg"  viewBox="0 0 24 24" aria-labelledby="arrowLeftIconTitle"  stroke-width="1.8" stroke-linecap="square" stroke-linejoin="miter" fill="none" >  <path d="M9 6l-6 6 6 6"/> <path d="M21 12H4"/> <path stroke-linecap="round" d="M3 12h1"/> </svg>
					</a>
				</div>
			</div>
		</div>
	</div>
	<div class="cont-body">
		<div class="requirements">
			<div class="requirements-def-title">
				<p>
					Please make sure all the necessary dependencies are installed on your server.
				</p>
			</div>
			<table class="table">
				<thead>
					<th>
						Name
					</th>
					<th>
						Description
					</th>
					<th>
						Status
					</th>
				</thead>
				<tbody>
					<tr>
						<td>
							<b>PHP 5.5.0+</b>
						</td>
						<td>
							Required PHP version 5.5.0 or more
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($php_version): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">
										Installed
									</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">
										Not installed
									</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<b>MySQLi</b>
						</td>
						<td>
							Required MySQLi PHP extension
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($mysqli_exists): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">
										Installed
									</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">
										Not installed
									</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<b>GD Library</b>
						</td>
						<td>
							Required GD Library for image cropping
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($gdlib_exists): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">
										Installed
									</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">
										Not installed
									</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<b>MB-string</b>
						</td>
						<td>
							Required MB-string extension for UTF-8 Text
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($mbstr_exists): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">
										Installed
									</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">
										Not installed
									</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<b>PHP Zip</b>
						</td>
						<td>
							Required ZIP extension for backuping data
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($phpzip_exists): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">
										Installed
									</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">
										Not installed
									</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<b>settings.php</b>
						</td>
						<td>
							Required settings.php to be writable for the installation <strong>(Located in <code>core/settings.php</code>)</strong>
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($config_exists): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">
										Uploaded
									</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">
										Not uploaded
									</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<b>colibri-db.sql</b>
						</td>
						<td>
							Required colibri-db.sql for the installation <strong>(Located in the root folder)</strong> 
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($dbsql_exists): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">Uploaded</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">Not uploaded</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<b>cURL Module</b>
						</td>
						<td>
							Required cURL extension for oAuth logins
						</td>
						<td>
							<span class="requirement-status">
								<?php if ($curl_status): ?>
									<span class="installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z"/></svg>
									</span>
									<span class="stat">Installed</span>
								<?php else: ?>
									<span class="not-installed icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"/><path d="M360 330.9L330.9 360 256 285.1 181.1 360 152 330.9l74.9-74.9-74.9-74.9 29.1-29.1 74.9 74.9 74.9-74.9 29.1 29.1-74.9 74.9z"/></svg>
									</span>
									<span class="stat">Not installed</span>
								<?php endif; ?>
							</span>
						</td>
					</tr>
				</tbody>
			</table>
			<div class="next-action">
				<div class="ml-auto">
					<?php if (in_array(false, $reqs_exists)): ?>
						<button class="btn btn-info" disabled="true">
							Continue
						</button>
					<?php else: ?>
						<a href="?p=installation">
							<button class="btn btn-info">
								Continue
							</button>
						</a>
					<?php endif; ?>	
				</div>
			</div>
		</div>
	</div>
</div>