$last) { $file = $f; } } return $file; } /** * Get the .zip file name based on the last commit * * @param string $dir * @param array $commit * @return string */ public static function getTmpFileName($dir, $commit) { $filename = ''; if (is_array($commit) && isset($commit['sha'])) { $filename = $dir . '/' . self::SKELETON_FILE . '_' . $commit['sha'] . '.zip'; } return $filename; } /** * Export the $config array in a human readable format * * @param array $config * @param integer $space the initial indentation value * @return string */ public static function exportConfig($config, $indent = 0) { if (empty(static::$valueGenerator)) { static::$valueGenerator = new ValueGenerator(); } static::$valueGenerator->setValue($config); static::$valueGenerator->setArrayDepth($indent); return static::$valueGenerator; } /** * Return the Module.php content * * @param string $name * @return string */ public static function getModule($name) { return << array( 'namespaces' => array( __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, ), ), ); } } EOD; } /** * * @param type $name * @return type */ public static function getModuleConfig($name) { return << array( 'proxy' => 'tcp://' . $config_env[1], 'request_fulluri' => true, 'header' => "Proxy-Authorization: Basic $auth", ), ); return stream_context_create($aContext); } }