本文整理汇总了PHP中Manager类的典型用法代码示例。如果您正苦于以下问题:PHP Manager类的具体用法?PHP Manager怎么用?PHP Manager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Manager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request, ["txtName" => "required|unique:teams,name", 'staff' => 'required'], ["txtName.required" => "Please enter cate's name.", 'txt.unique' => 'This name has already been taken', 'staff.required' => 'Please select staff']);
$team = new Manager();
$team->name = $request->txtName;
$team->created_user_id = Auth::user()->id;
$team->save();
foreach ($request->input('staff') as $key => $value) {
$detail = new TeamDetail();
$detail->team_id = $team->id;
$detail->staff_id = $value;
$detail->save();
}
return redirect()->route('admin.team.manager.index')->with('success', 'Posted completely!');
}
开发者ID:trongtri0705,项目名称:staff,代码行数:21,代码来源:TeamController.php
示例17: onCreate
public function onCreate()
{
parent::onCreate();
$this->setId('templateMainMenu');
$actions = Manager::getActions('template');
foreach ($actions as $i => $group) {
$baseGroup = new MBaseGroup("menu{$i}", $group[0]);
$baseGroup->setFieldSet(false);
$tree = new MTree("tree{$i}");
$groupActions = $group[ACTION_ACTIONS];
$array = array();
$j = 0;
foreach ($groupActions as $action) {
$array[$j] = array($j, $action[ACTION_CAPTION], $action[ACTION_PATH], 'root');
if (is_array($action[ACTION_ACTIONS])) {
$k = $j;
foreach ($action[ACTION_ACTIONS] as $internalAction) {
$j++;
$array[$j] = array($j, $internalAction[ACTION_CAPTION], $internalAction[ACTION_PATH], $k);
}
}
$j++;
}
$tree->setItemsFromArray($array);
$baseGroup->addControl($tree);
$this->addControl($baseGroup);
}
}
开发者ID:joshuacoddingyou,项目名称:php,代码行数:28,代码来源:mainmenu.php
示例18: __construct
public function __construct($module, $item, $value, $defaults = null)
{
$this->value = $value;
$this->module = $module;
$this->item = $item;
$this->defaults = $defaults;
parent::__construct($module);
if (file_exists(Manager::getModulePath($module, 'db/lookup.class')) && Manager::uses('/db/lookup.class', $module) || Manager::uses('/classes/lookup.class', $module)) {
eval("\$object = new Business{$module}Lookup();");
eval("\$info = \$object->autoComplete{$item}(\$this,\$defaults);");
parent::__construct($this->module);
if ($info) {
$this->result = $info;
} else {
//faz consulta
$sql = new Msql('');
$sql->createFrom($this->sql);
$sql->prepare($value);
$db = Manager::getDatabase($this->module);
//$this->sql = MSql::prepare($this->sql,$value);
//$result = $this->_db->query($value ? $sql->command : str_replace('?','NULL',$this->sql));
$result = $db->query($value ? $sql->command : str_replace('?', 'NULL', $this->sql));
$this->result = $result[0];
}
}
}
开发者ID:joshuacoddingyou,项目名称:php,代码行数:26,代码来源:mautocomplete.php
示例19: getQuestion
/**
* Provides the object of the question this response is for.
*
* @return \Wannabe\Question
*/
public function getQuestion()
{
if ($this->getQuestionID() < 1) {
return null;
}
return Manager::getInstance()->getQuestionByID($this->getQuestionID());
}
开发者ID:hultberg,项目名称:relancms,代码行数:12,代码来源:QuestionResponse.php
示例20: renderFile
public function renderFile()
{
$bCleanup = Manager::usePath() === self::DO_CLEANUP;
$aReferences = ReferenceQuery::create()->find();
self::checkReferences($aReferences, $bCleanup);
if (count(self::$REFERENCES_WITHOUT_FROM) === 0 && count(self::$REFERENCES_WITHOUT_TO) === 0) {
if (!$bCleanup) {
print TranslationPeer::getString('test_references.references_are_ok', null, null, array('count' => count($aReferences)));
} else {
print TranslationPeer::getString('test_references.wrong_references_removed');
print TagWriter::quickTag('p', array(), TagWriter::quickTag('a', array('href' => LinkUtil::link(array('test_references'), 'FileManager')), TranslationPeer::getString('test_references.test_again')));
}
} else {
if (count(self::$REFERENCES_WITHOUT_FROM) > 0) {
print TagWriter::quickTag('p', array(), count(self::$REFERENCES_WITHOUT_FROM) . TranslationPeer::getString('test_references.loose_from_references_found'));
foreach (self::$REFERENCES_WITHOUT_FROM as $oReference) {
print TagWriter::quickTag('p', array(), $oReference->getFromModelName() . '/' . $oReference->getFromId());
}
}
if (count(self::$REFERENCES_WITHOUT_TO) > 0) {
print TagWriter::quickTag('p', array(), count(self::$REFERENCES_WITHOUT_TO) . TranslationPeer::getString('test_references.loose_to_references_found'));
foreach (self::$REFERENCES_WITHOUT_TO as $oReference) {
print TagWriter::quickTag('p', array(), $oReference->getToModelName() . '/' . $oReference->getToId());
}
}
print TagWriter::quickTag('p', array(), TagWriter::quickTag('a', array('href' => LinkUtil::link(array('test_references', self::DO_CLEANUP), 'FileManager')), TranslationPeer::getString('test_references.remove_loose_ends')));
}
}
开发者ID:rapila,项目名称:cms-base,代码行数:28,代码来源:TestReferencesFileModule.php
注:本文中的Manager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论