Since: 19.10.2012
Author: Vitaliy Demidov (vitaliy@scalr.com)
Inheritance: extends Scalr\DependencyInjection\BaseContainer
Example #1
0
 /**
  * Performs preliminary initialization of the DI container
  */
 public static function initializeContainer()
 {
     Container::reset();
     $container = self::getContainer();
     //Dependency injection container config
     require __DIR__ . '/di.php';
 }
Example #2
0
 /**
  * @test
  */
 public function testFunctionalLdap()
 {
     if (static::isSkippedFunctionalTest()) {
         $this->markTestSkipped();
     }
     $this->assertInstanceOf('Scalr\\Net\\Ldap\\LdapClient', $this->container->ldap('somelogin', 'somepassword'));
 }
Example #3
0
 /**
  * Constructor
  */
 public function __construct()
 {
     $this->container = \Scalr::getContainer();
     $this->DB = \Scalr::getDb();
     $this->Logger = $this->container->logger(__CLASS__);
 }
Example #4
0
 /**
  * (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;
 }