/** * Performs preliminary initialization of the DI container */ public static function initializeContainer() { Container::reset(); $container = self::getContainer(); //Dependency injection container config require __DIR__ . '/di.php'; }
/** * @test */ public function testFunctionalLdap() { if (static::isSkippedFunctionalTest()) { $this->markTestSkipped(); } $this->assertInstanceOf('Scalr\\Net\\Ldap\\LdapClient', $this->container->ldap('somelogin', 'somepassword')); }
/** * Constructor */ public function __construct() { $this->container = \Scalr::getContainer(); $this->DB = \Scalr::getDb(); $this->Logger = $this->container->logger(__CLASS__); }
/** * (non-PHPdoc) * @see \Scalr\Upgrade\UpdateInterface::hasTableReferencedColumn() */ public function hasTableReferencedColumn($referencedTable, $referencedColumn, $referencedSchema = null) { $referencedSchema = $referencedSchema ?: $this->container->config('scalr.connections.mysql.name'); $row = $this->db->GetRow("\n SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE\n WHERE REFERENCED_TABLE_SCHEMA = ?\n AND REFERENCED_TABLE_NAME = ?\n AND REFERENCED_COLUMN_NAME = ?\n LIMIT 1\n ", array($referencedSchema, $referencedTable, $referencedColumn)); return isset($row['CONSTRAINT_NAME']) ? true : false; }