Skip to content

Instantly share code, notes, and snippets.

@lab2023
Created October 13, 2011 08:41
Show Gist options
  • Save lab2023/1283757 to your computer and use it in GitHub Desktop.
Save lab2023/1283757 to your computer and use it in GitHub Desktop.
KebabChecker
<?php
const Z_VERSION='1.11.10';
const D_VERSION='1.2.4';
const EXTJS_VERSION='3.4.0';
const P_VERSION='5.3.4';
/*Mondatary Requirements*/
/*Zend Version Control*/
$zend=false;
if(file_exists('../library/Zend/version.php')){
require_once '../library/Zend/version.php';
$zend_version=new Zend_Version();
if($zend_version-> compareVersion(Z_VERSION)==0) {
$zend=true;
}
else
$zend=false;
check($zend,'Zend Framework Versiyon Uyumluluk Sorunu Var.! Kullandığınız ZF Versiyonu :'.zend_version::VERSION.' Kebab Framework İçin Gerekli Versiyon : '.Z_VERSION,TRUE);
}
else{
check($zend,'Kebab Framework Kurulu Değil !',TRUE);
}
/*End Zend Version Control*/
/*Doctrin Control*/
$doctrine=false;
if(file_exists('../library/Doctrine')){
require_once '../library/Doctrine/Core.php';
$doctrine=true;
check(Doctrine_Core::VERSION==D_VERSION,'Doctrine ORM Versiyon Uyumluluk Sorunu Var.! Kullandığını Doctrine ORM Versiyonu : '.Doctrine_Core::VERSION.' Kebab Framework İçin Gerekli Versiyon : '.D_VERSION,TRUE);
}
else{
check($doctrine,'Doctrine ORM Kurulu Değil !',TRUE);
}
/*End Doctrine Control*/
/*Ext JS Control*/
//require_once('assets/vendors/ext-3.4.0/src/ext-core/src/core/Ext.js');
$extjs=false;
if(file_exists('assets/vendors/ext-3.4.0')){
$extjs=true;
check($extjs,'Ext JS Versiyon Uyumluluk Sorunu Var. ! Kullandığınız Ext JS Versiyonu : '.EXTJS_VERSION.'Kebab Framwork İçin Gerekli Versiyon : '.EXTJS_VERSION,TRUE);
}
else{
check($extjs,'ExJS Kurulu Değil',TRUE);
}
/*End Ext Js Control*/
/*Php Version Control*/
check(version_compare(PHP_VERSION,P_VERSION)>=0,'PHP Versiyonu Uyumluluk Sorunu Var Kullandığınız PHP Versiyonu : '.PHP_VERSION.' Kebab Framework '.P_VERSION.' ve Üzeri Gerektirir',TRUE);
/*Optional Requirements*/
/*Apc Control*/
check(extension_loaded('apc'),'APC Kurulu Değil .',FALSE);
function check($bool,$error,$ismandatory=FALSE){
if($bool){
echo '';
}
else{
echo $ismandatory ? 'ERROR : ':'WARNING : ';
echo $error.'<br>';
if($ismandatory){
exit('<br>Bu Problemi Cozmeden Devam Edemezsiniz !!!');
}
}
}
@kucukm
Copy link

kucukm commented Oct 13, 2011

you must control file exist with base path

@adamdilek
Copy link

for example 'C:\wamp\www\kebab\library\Zend' like?

@kucukm
Copy link

kucukm commented Oct 13, 2011

yeap

@adamdilek
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment