return new \Scalr\Logger(!empty($params[0]) ? $params[0] : null); }); } return $cont->get($serviceid); }); $container->set('warmup', function ($cont, array $arguments = null) { /* @var $cont \Scalr\DependencyInjection\BaseContainer */ //Releases cloud credentials foreach (['aws', 'openstack', 'cloudstack', 'cloudyn'] as $srv) { $cont->release($srv); } $cont->release('env_cloud_creds'); $cont->release('cloud_creds'); //Releases platform module static cache \Scalr\Modules\PlatformFactory::warmup(); \Scalr_Governance::clearCache(); return $cont; }); $container->set('crypto', function ($cont, array $arguments = []) { $algo = array_shift($arguments) ?: MCRYPT_RIJNDAEL_128; $mode = array_shift($arguments) ?: MCRYPT_MODE_CFB; $cryptoKey = array_shift($arguments); $keySize = array_shift($arguments) ?: 32; $blockSize = array_shift($arguments) ?: 16; if ($cryptoKey === null) { $cryptoKeyId = APPPATH . "/etc/.cryptokey"; $cryptoKey = @file_get_contents($cryptoKeyId); if (empty($cryptoKey)) { throw new ScalrException("Wrong crypto key!"); } } else {