Esempio n. 1
0
File: Test.php Progetto: 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);
 }
Esempio n. 2
0
File: data.php Progetto: 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;
 }
Esempio n. 3
0
File: DirTest.php Progetto: 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);
 }