当前位置: 首页>>代码示例>>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;未经允许,请勿转载。