Commit:    842804467e0eba0bc2e81f236cec65b098132dda
Author:    Anatol Belski <[email protected]>         Thu, 23 Apr 2015 16:32:13 +0200
Parents:   b885fce9089e5eb5cc2fd069b8acfe784b2c2b81
Branches:  master pecl_legacy

Link:       
http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=842804467e0eba0bc2e81f236cec65b098132dda

Log:
things done so far for the pickle build

Changed paths:
  M  client/include/PickleBuildVC.php
  M  client/include/PickleExt.php
  M  client/script/packagist.php


Diff:
diff --git a/client/include/PickleBuildVC.php b/client/include/PickleBuildVC.php
index befbde5..a99c2c7 100644
--- a/client/include/PickleBuildVC.php
+++ b/client/include/PickleBuildVC.php
@@ -9,43 +9,70 @@ class PickleBuildVC
 {
        public $branch;
        public $build_name;
-       protected $pickle_phar = 'c:\apps\bin\pickle.phar';
+       protected $pickle_phar = 'c:\\apps\\bin\\pickle.phar';
+       protected $env;
+       protected $sdk_base = "C:\\php-devel\\nts";
+
+       protected $int_dir;
+       protected $log_dir;
+
+       protected $pickle_cmd;
 
        public function __construct(PickleBranch $branch, $build_name)
        {
                $this->branch = $branch;
                $this->build_name = $build_name;
 
-
+               $this->int_dir = tempnam(TMP_DIR, 'pickle');
+               unlink($this->int_dir);
+               if (!file_exists($this->int_dir) && !mkdir($this->int_dir)) {
+                       throw new \Exception("Couldn't create temporary dir");
+               }
+               
+               $this->log_dir = $this->int_dir . DIRECTORY_SEPARATOR . 
"pickle_logs";
+               if (!mkdir($this->log_dir)) {
+                       throw new \Exception("Couldn't create log dir");
+               }
+
+               $this->pickle_cmd = PHP_BINARY . " " . $this->pickle_phar;
        }
 
-
-       public function phpize()
+       public function __destruct()
        {
+               $this->clean();
+       }
 
-
+       function clean()
+       {
+               if (is_dir($this->int_dir)) {
+                       rmdir_rf($this->int_dir);
+               }
        }
 
-       public function configure()
+
+       public function packLogs()
        {
 
        }
 
-       public function make()
+       public function info()
        {
 
        }
 
-       public function clean()
+       public function build()
        {
+               $cmd = $this->pickle_cmd;
+
+               $opts = "install ";
+               $opts .= "--save-logs=" . $this->log_dir;
 
+               $cmd = $this->pickle_cmd . " " . $opts;
        }
 
        public function archive()
        {
 
        }
-
-
 }
 
diff --git a/client/include/PickleExt.php b/client/include/PickleExt.php
index f1794b8..c486eee 100644
--- a/client/include/PickleExt.php
+++ b/client/include/PickleExt.php
@@ -38,5 +38,16 @@ class PickleExt
        {
 
        }
+
+       protected function createTmpDir()
+       {
+               $tmp_path = tempnam(TMP_DIR, 'pickle');
+               unlink($tmp_path);
+               if (!file_exists($tmp_path) && !mkdir($tmp_path)) {
+                       throw new \Exception("Couldn't create temporary dir");
+               }
+
+               return $tmp_path;
+       }
 }
 
diff --git a/client/script/packagist.php b/client/script/packagist.php
index dbe725d..205729c 100644
--- a/client/script/packagist.php
+++ b/client/script/packagist.php
@@ -33,14 +33,16 @@ foreach ($builds as $build_name) {
        $build = $branch->createBuildInstance($build_name);
        $ext = new rm\PickleExt($pkg_path, $build);
 
-       $build->phpize();
-       $build->configure();
-       $build->make();
-       $build->clean();
-
-       var_dump($build_name);
-       var_dump($build);
-       var_dump($ext);
+       $build->build();
+       $build->packLogs();
+       $build->archive();
+
+       /* upload logs and builds */
+       /* notify packagist */
+
+       //var_dump($build_name);
+       //var_dump($build);
+       //var_dump($ext);
        //var_dump($build_config);
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to