當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Manager類代碼示例

本文整理匯總了PHP中Manager的典型用法代碼示例。如果您正苦於以下問題:PHP Manager類的具體用法?PHP Manager怎麽用?PHP Manager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Manager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testRemove

 /**
  * Tests Manager->remove()
  */
 public function testRemove()
 {
     $this->Manager->set(__NAMESPACE__ . __CLASS__ . __FUNCTION__ . 'MyVar', true);
     $this->assertTrue($this->Manager->has(__NAMESPACE__ . __CLASS__ . __FUNCTION__ . 'MyVar'));
     $this->Manager->remove(__NAMESPACE__ . __CLASS__ . __FUNCTION__ . 'MyVar');
     $this->assertFalse($this->Manager->has(__NAMESPACE__ . __CLASS__ . __FUNCTION__ . 'MyVar'));
 }
開發者ID:faridos,項目名稱:ServerGroveLiveChat,代碼行數:10,代碼來源:ManagerTestAbstract.php

示例2: __construct

 /**
  * @param string $class
  * @param string $method
  */
 function __construct(Manager $manager, $class, $method)
 {
     $this->class = $class;
     $this->method = $method;
     $inspector = $manager->get('Cti\\Di\\Inspector');
     $this->arguments = $inspector->getMethodArguments($class, $method);
     $this->requiredCount = $inspector->getMethodRequiredCount($class, $method);
 }
開發者ID:cti,項目名稱:di,代碼行數:12,代碼來源:Callback.php

示例3: testGeneral

 public function testGeneral()
 {
     $sass = new Manager();
     $sass->compile('body{background-color: $red}', ['red' => '#ff0000'], [], []);
     $tempFile = KENDO_TEMP_DIR . '/test/unitest.css';
     $sass->compileToFile($tempFile, 'default', 'default', ['red' => '#ff0000'], 'body{background: $red;}');
     $this->assertNotEmpty(file_get_contents($tempFile));
 }
開發者ID:kendolabdev,項目名稱:kendoplatform,代碼行數:8,代碼來源:ManagerTest.php

示例4: testInitInvalidHandler

 public function testInitInvalidHandler()
 {
     $handlerConfig = ['class' => 'Migration\\Migration', 'params' => ['value' => '12']];
     $invalidHandler = $this->getMock('Migration\\Migration', [], [], '', false);
     $this->objectManager->expects($this->once())->method('create')->will($this->returnValue($invalidHandler));
     $this->setExpectedException('\\Exception', "'Migration\\Migration' is not correct handler.");
     $this->manager->initHandler('somefield', $handlerConfig);
 }
開發者ID:okite11,項目名稱:frames21,代碼行數:8,代碼來源:ManagerTest.php

示例5: setPassword

 function setPassword()
 {
     $bef = new Manager();
     $ant = $bef->Find($this->id);
     if ($bef->password != $this->password) {
         $this->password = md5($this->password);
     }
 }
開發者ID:rantes,項目名稱:proyectosig,代碼行數:8,代碼來源:manager.php

示例6: postRenderTemplate

 public function postRenderTemplate(Twig_Template $template, $result)
 {
     $this->templateRenderingDepth--;
     if ($this->templateRenderingDepth == 0) {
         $result = str_replace((string) $this->assetBag, implode("\n", $this->assetManager->getHtmTags($this->assetBag->clear())), $result);
     }
     return $result;
 }
開發者ID:mpoiriert,項目名稱:nucleus,代碼行數:8,代碼來源:AssetBagTwigExtension.php

示例7: testSetLanguage

 public function testSetLanguage()
 {
     $variable = 'en';
     $manager = new Manager();
     $manager->setLanguage($variable);
     $result = $manager->getLanguage();
     $this->assertEquals($variable, $result);
 }
開發者ID:newage,項目名稱:TranslateManager,代碼行數:8,代碼來源:ManagerTest.php

示例8: testGenerateResponse

 public function testGenerateResponse()
 {
     $context = $this->getMock('GFG\\DTOContext\\Context\\ContextInterface');
     $factory = $this->getMock('GFG\\DTOError\\FactoryInterface');
     $factory->expects($this->once())->method('generateCode')->with($context)->willReturn([['name' => 'test', 'code' => 'my code']]);
     $manager = new Manager();
     $manager->setFactory($factory);
     $this->assertSame('my code', (string) $manager->generateCode($context));
 }
開發者ID:gfg,項目名稱:dto-error,代碼行數:9,代碼來源:ManagerTest.php

示例9: requestCrop

 /**
  * Request a crop
  *
  * @param $input
  * @return mixed
  */
 public function requestCrop($input)
 {
     if ($newImage = $this->ImageManager->cropAndSaveFile($input)) {
         $keepers = array_except($input, array('_token', 'cropper'));
         $keepers['images'][] = $newImage;
         return $this->Redirect->to($this->URL->route('dvs-media-manager') . '?' . http_build_query($keepers));
     }
     return $this->Redirect->back();
 }
開發者ID:devisephp,項目名稱:cms,代碼行數:15,代碼來源:ResponseHandler.php

示例10: testProductPlane

 public function testProductPlane()
 {
     $builder = new Builder\Plane();
     $manager = new Manager($builder);
     $manager->buildProduct();
     $product = $manager->getProduct();
     $this->assertEquals("plane", $product->getName());
     $this->assertEquals(100500, $product->getPrice());
 }
開發者ID:olegre,項目名稱:php-design-patterns,代碼行數:9,代碼來源:Test.php

示例11: migrate

 /**
  * 
  */
 public function migrate()
 {
     InputOutput::display(_("Executes all migrations"));
     $migrationManager = new Manager($module, 'production');
     $cmd = $this->getPhinxCallLine() . 'migrate ';
     $cmd .= '-c ' . $migrationManager->getPhinxConfigurationFile();
     $cmd .= '-e ' . $this->module;
     shell_exec($cmd);
 }
開發者ID:rk4an,項目名稱:centreon,代碼行數:12,代碼來源:Migrate.php

示例12: testShouldDispatchEventWithArgumentUsingMagicMethods

 public function testShouldDispatchEventWithArgumentUsingMagicMethods()
 {
     $callback = function (array $params) {
         echo json_encode($params);
     };
     $this->expectOutputString('[1,2]');
     $manager = new Manager();
     $manager->foo = $callback;
     $manager->foo(array(1, 2));
 }
開發者ID:phpfluent,項目名稱:eventmanager,代碼行數:10,代碼來源:ManagerTest.php

示例13: constructReturnOne

 public function constructReturnOne($res)
 {
     if ($row = mysql_fetch_assoc($res)) {
         $user = new Manager();
         $user->setName($row['name']);
         $user->setPassword($row['password']);
     }
     $this->getConnection()->releaseRes($res);
     return $user;
 }
開發者ID:fishling,項目名稱:empManager,代碼行數:10,代碼來源:ManagerAccess.class.php

示例14: addschool

 public function addschool($filename)
 {
     PHPExcel_Settings::setCacheStorageMethod(PHPExcel_CachedObjectStorageFactory::cache_in_memory_gzip);
     $files = scandir("./upload");
     array_shift($files);
     array_shift($files);
     $errors = array();
     $j = 0;
     $this->db->begin();
     foreach ($files as $file) {
         if (strstr($file, $filename)) {
             $objexcel = PHPExcel_IOFactory::load("./upload/" . $file);
             $sheet = $objexcel->getSheet(0);
             try {
                 $higestrow = $sheet->getHighestRow();
                 $i = 2;
                 while ($i <= $higestrow) {
                     $k = $sheet->getCell("A" . $i)->getValue();
                     if (is_null($k) || $k == "") {
                         break;
                     }
                     $username = (string) $sheet->getCell($this->excel_col[0] . $i)->getValue();
                     $password = (string) $sheet->getCell($this->excel_col[1] . $i)->getValue();
                     $district = (string) $sheet->getCell($this->excel_col[2] . $i)->getValue();
                     $schoolname = (string) $sheet->getCell($this->excel_col[3] . $i)->getValue();
                     $realname = (string) $sheet->getCell($this->excel_col[4] . $i)->getValue();
                     $phone = (string) $sheet->getCell($this->excel_col[5] . $i)->getValue();
                     $email = (string) $sheet->getCell($this->excel_col[6] . $i)->getValue();
                     $ID_number = (string) $sheet->getCell($this->excel_col[7] . $i)->getValue();
                     $manager = new Manager();
                     if ($manager->signup($username, $password, $phone, $email, $realname, $ID_number)) {
                         $this->newschool($schoolname, $district, $manager);
                     } else {
                         throw new PDOException();
                     }
                     $i++;
                 }
             } catch (PDOException $ex) {
                 $errors['PDOException'] = $ex->getMessage();
                 $this->db->rollback();
                 $objexcel->disconnectWorksheets();
                 unlink("./upload/" . $file);
                 // throw $ex;
                 return $errors;
             }
         }
     }
     $objexcel->disconnectWorksheets();
     unlink("./upload/" . $file);
     $this->db->commit();
     return $errors;
 }
開發者ID:sify21,項目名稱:Question,代碼行數:52,代碼來源:ImportController.php

示例15: getInstance

 /**
  * Get manager instance
  * 
  * @return Manager
  */
 public static function getInstance()
 {
     // Check whether manager has been set
     if (!isset(self::$instance)) {
         // Manager not set
         // Create new manager and load it's configuration
         $manager = new Manager();
         $manager->loadConfiguration();
         // Set manager
         self::$instance = $manager;
     }
     // Return manager instance
     return self::$instance;
 }
開發者ID:janverton,項目名稱:InTheCuppa,代碼行數:19,代碼來源:Manager.php


注:本文中的Manager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。