Example #1
0
File: Test.php Project: jasny/Q
 public function testPath()
 {
     $config = Config::with('xml:' . $this->file);
     $refl = new \ReflectionProperty($config, '_path');
     $refl->setAccessible(true);
     $path = $refl->getValue($config);
     $this->assertType('Q\\Config_File', $config);
     $this->assertEquals($this->file, (string) $path);
 }
Example #2
0
File: data.php Project: jasny/Q
 /**
  * Release a lock
  */
 public function unlock()
 {
     $key = null;
     if (isset($_GET['lock'])) {
         list($name, $key) = explode(':', $_GET['lock'], 2) + array(1 => null);
     }
     if (isset($_GET['name'])) {
         $name = $_GET['name'];
     }
     if (isset($_GET['key'])) {
         $key = $_GET['key'];
     }
     $lock = new Lock(Config::i()->application . '.' . $name);
     if (!$lock->release($check)) {
         HTTP::response(423);
         echo "Invalid token: You do not own that lock.";
         exit;
     }
     echo 1;
 }
Example #3
0
File: DirTest.php Project: jasny/Q
 /**
  * Tests Config::with() : where dsn is path and options['ext'] and options['transformer']
  */
 public function testWith_DsnIsPathOptExtArgTr()
 {
     $config = Config::with($this->dir, array('ext' => 'yaml', 'transformer' => 'from-mock'));
     $this->checkWithTrResult($config);
 }