Commit a190c027 authored by Felix Flor's avatar Felix Flor

added new buildprocess

parent ab58a181
# PHP Storm Directory
.idea
ciItegrationCheck.php
/test_dir/
\ No newline at end of file
/test_dir/
version.inc.php
aphpbreakdown.phar
\ No newline at end of file
......@@ -27,6 +27,8 @@ if(\file_exists($ignoredModulesFile) && \is_readable($ignoredModulesFile)){
system("clear");
echo "Version ".VERSION." from ".BUILD_DATE;
switch($argv[2]){
case "--console-basic":
basicConsoleOutput($filesToCheck);
......
......@@ -4,11 +4,53 @@
* Building the PHAR.
*/
$objPhar = new \Phar('aphpbreakdown.phar', 0, 'aphpbreakdown.phar');
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
require_once __DIR__ . '/constants.inc.php';
/***********************************************/
/* Build Version File for Online-Version-Check */
/***********************************************/
$latesVersionFile = 'latest.php';
if(!empty($argv[1])){
$options = array(CURLOPT_URL => VERSION_URL,
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 20,
CURLOPT_TIMEOUT => 30);
$handler = curl_init();
curl_setopt_array($handler, $options);
$result = curl_exec($handler);
echo "\nOC-Version: $result\nBuild-Bersion: ".$argv[1];
if(version_compare($result, $argv[1], '<') && 0 == curl_errno($handler)){
echo "\nBuild new latest Version File\n";
file_put_contents($latesVersionFile, "<?php\n\nexit('".$argv[1]."');");
} else {
echo "\nBuild NO new latest Version File.\n";
if(0 != curl_errno($handler))
echo "cURL-Error: ".curl_error($handler)."\n";
}
}
/********************************************************************/
/* Pre Build Process to build the Version-File including in Autopim */
/********************************************************************/
$versionFile = 'version.inc.php';
(!empty($argv[1])) ? $version = $argv[1] : $version = 'unknown' ;
unlink($versionFile);
echo "\nBuild new Version File to include it to PHAR-File\n";
file_put_contents($versionFile, "<?php\n\nnamespace APHPBreakdown;\n\n", FILE_APPEND | LOCK_EX);
file_put_contents($versionFile, "define('VERSION', '".$version."');\n", FILE_APPEND | LOCK_EX);
file_put_contents($versionFile, "define('BUILD_DATE', '".date('Y-m-d H:i:s')."');\n", FILE_APPEND | LOCK_EX);
/**********************************/
/* Build Process of the PHAR File */
/**********************************/
echo "\nBuild new PHAR File to include it to PHAR-File\n\n";
$objPhar = new \Phar('aphpbreakdown.phar', 0, 'aphpbreakdown.phar');
$objPhar->addFile('autoanalyse.php');
$objPhar->addFile('config.inc.php');
$objPhar->addFile('constants.inc.php');
$objPhar->addFile($versionFile);
$objPhar->buildFromIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/inc/')),__DIR__);
$objPhar->setStub('#!/usr/bin/env php' . "\n" . $objPhar->createDefaultStub('autoanalyse.php'));
......@@ -4,6 +4,11 @@ namespace APHPBreakdown;
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
/*************************/
/* Constants Definitions */
/*************************/
require_once __DIR__ . '/version.inc.php';
/******************************************************/
/* files which contains arrays used in differen parts */
/******************************************************/
......
<?php
namespace APHPBreakdown;
define("VERSION_URL", "http://vc.pimlab.de/aphpbreakdown/latest.php");
\ No newline at end of file
<?php
exit('2.2.3');
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment