当前位置: 首页>>代码示例>>PHP>>正文


PHP Storage::get方法代码示例

本文整理汇总了PHP中Storage::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::get方法的具体用法?PHP Storage::get怎么用?PHP Storage::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Storage的用法示例。


在下文中一共展示了Storage::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCanUnsetAVariable

 public function testCanUnsetAVariable()
 {
     $this->namespace->testUnset = 5;
     $this->assertEquals(5, $this->storage->get('testUnset'));
     $this->storage->remove('testUnset');
     $this->assertFalse(isset($this->namespace->testUnset));
     $this->assertFalse($this->storage->has('testUnset'));
 }
开发者ID:deltasystems,项目名称:dewdrop,代码行数:8,代码来源:StorageTest.php

示例2: testBase

 /**
  * Base testing
  */
 public function testBase()
 {
     $storage = new Storage();
     $alphabet = new Alphabet('en', array(), array(), array());
     $storage->add($alphabet);
     $this->assertEquals($alphabet, $storage->get('en'));
     $this->assertEquals(array('en' => $alphabet), $storage->all());
     $storage->remove($alphabet);
     $this->assertNull($storage->get('en'));
 }
开发者ID:jackblackjack,项目名称:LanguageDetector,代码行数:13,代码来源:StorageTest.php

示例3: configure

	public static function configure( $home ){
		self::$home = $home;
                $js = ""; $css = "";
                if( Authorization::isAuthorized() ){
                    $files = API::getFileList( INCLUDEPATH );
                    
                    $files = array_merge(API::getFileList( PLUGINSPATH ), $files);
                    $pos = array_search("./include/cmf/js/lib.js",$files);
                    unset($files[$pos]);
                }
                else{
                    $files = API::getFileList( INCLUDEPATH,-1 );
                    $files[] = "./include/cmf/js/lib.js";
                    $files[] = "./include/cmf/css/cmf.notify.css";
                    $files[] = "./include/cmf/css/cmf.ui.css";
                }
                
                rsort($files);
                foreach ($files as $path) {

                    $ext = pathinfo($path);
                    if( substr($ext['filename'], 0,1) == '_' ) continue;
                    $ext = $ext['extension'];
                    if($ext == "js"){
                        $js .= str_replace("{PATH}", $path, Storage::get("Template::jsInclude"));
                    }else if($ext == "css")
                        $css .= str_replace("{PATH}", $path, Storage::get("Template::cssInclude"));
                }

                self::assign("TITLE", Config::$SiteConf['name']);
                self::assign("META", Config::$SiteConf['meta']);
                self::assign("JSINCLUDE", $js);
                self::assign("CSSINCLUDE", $css);
               // l(self::$vars);
	}
开发者ID:neronmoon,项目名称:Veronica,代码行数:35,代码来源:Template.class.php

示例4: store

 public function store()
 {
     $posts = \Input::get('posts');
     $results = array();
     if (count($posts)) {
         $insertData = [];
         foreach ($posts as $post) {
             $tags = isset($post['tags']) ? $post['tags'] : array();
             $result = Post::create(array('title' => $post['title'], 'body' => $post['body']));
             if (count($tags) && $result) {
                 $this->savePostTags($result->id, $tags);
             }
             array_push($results, $result);
         }
         if (count($results)) {
             $emails = json_decode(\Storage::get('emails.json'), true);
             \Mail::send('emails.post', ['results' => $results], function ($message) use($emails) {
                 $message->from(env('MAIL_FROM_ADDRESS'), env('MAIL_FROM_NAME'));
                 $message->to($emails)->subject('New posts');
             });
             Cache::forget('all_post');
             return self::makeResponse($results, 201);
         } else {
             return self::makeResponse(array(), 500, 'Server Error');
         }
     } else {
         return self::makeResponse(array(), 400, 'Bad Request');
     }
 }
开发者ID:vanhonit,项目名称:lazada,代码行数:29,代码来源:PostController.php

示例5: viewSitemap

 /**
  * вывод html-карты сайта по шорт-коду [sitemap-html]
  */
 static function viewSitemap()
 {
     $sitemap = Storage::get(md5('mgPluginSitemapHtml'));
     if ($sitemap == null) {
         $pages = self::getPages();
         $catalog = self::getCatalog();
         $html = '
 <div class="sitemap-html">
  <h2 class="new-products-title">Карта сайта</h2>
 <ul class="js_listSiteMap">';
         foreach ($pages as $url => $title) {
             $partsUrl = URL::getSections($url);
             $priority = count($partsUrl);
             if (is_array($title)) {
                 $html .= '<li><a href="' . SITE . '/' . $url . '">' . $title[$url] . '<ul>';
                 foreach ($title as $suburl => $subtitle) {
                     if ($suburl != $url) {
                         $html .= '<li><a href="' . SITE . '/' . $suburl . '" title="' . $subtitle . '">' . $subtitle . '</a></li>';
                     }
                 }
                 $html .= '</ul></li>';
             } else {
                 $html .= '<li><a href="' . SITE . '/' . $url . '" title="' . $title . '">' . $title . '</a></li>';
                 if ($url == 'catalog') {
                     $html .= '<ul>' . $catalog . '</ul>';
                 }
             }
         }
         $sitemap = $html . '</ul></div>';
         Storage::save(md5('mgPluginSitemapHtml'), $sitemap);
     }
     return $sitemap;
 }
开发者ID:nellka,项目名称:mebel,代码行数:36,代码来源:index.php

示例6: action_parse

 public function action_parse()
 {
     $source_file_content = \Storage::get('coolbaby_11082015.csv');
     $source_file_rows = explode("\n", $source_file_content);
     array_shift($source_file_rows);
     if (empty($source_file_rows)) {
         $this->error('Массив пуст');
         return;
     }
     $this->output->progressStart(count($source_file_rows));
     foreach ($source_file_rows as $row) {
         $row = trim($row);
         if (empty($row)) {
             continue;
         }
         $fields = explode(';', $row);
         $product_model = \App\Models\Product::create(['code' => trim($fields[0]), 'article' => trim($fields[1]), 'name' => trim($fields[2]), 'category_name' => trim($fields[3]), 'brand' => trim($fields[4]), 'price_2' => trim($fields[5]), 'price_1' => trim($fields[6]), 'catalog_id' => 2]);
         $source_url = 'http://' . substr(trim($fields[7]), 0, -4) . '_big.jpg';
         $media_model = new \App\Models\Media();
         $media_model->product_id = $product_model->id;
         $media_model->source_url = $source_url;
         $media_model->save();
         $this->output->progressAdvance();
     }
     $this->output->progressFinish();
 }
开发者ID:serovvitaly,项目名称:kotik,代码行数:26,代码来源:CoolBabyCommand.php

示例7: __construct

 public function __construct($args)
 {
     //$script = file_get_contents(LIB . "/OrongoScript/Tests/test.osc");
     //$parser = new OrongoScriptParser($script);
     //$parser->startParser();
     require 'TerminalPlugin.php';
     Plugin::hookTerminalPlugin(new TerminalPlugin());
     $stored = Plugin::getSettings($args['auth_key']);
     //Access the settings in the array.
     if (isset($stored['example_setting_2']) && $stored['example_setting_2']) {
         $this->injectHTML = true;
         $this->htmlToInject = $stored['example_setting_1'];
     } else {
         $this->injectHTML = false;
     }
     $store_string = 'this is a variable';
     $bool = Storage::store('a_storage_key', $store_string, true);
     if ($bool) {
         //This will fail and return false, because overwrite = false
         $bool2 = Storage::store('a_storage_key', 'will this overwrite?', false);
         if ($bool2 == false) {
             //This wil return: this is a variable
             $returnString = Storage::get('a_storage_key');
             //Delete the storage
             Storage::delete('a_storage_key');
         }
     }
 }
开发者ID:JacoRuit,项目名称:orongocms,代码行数:28,代码来源:ExamplePHP.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     if (!Storage::disk('local')->exists('seeds/develop')) {
         $this->command->info('Dev seed data file not present. Creating...');
         $this->createData();
     } else {
         $this->data = unserialize(Storage::get('seeds/develop'));
         $this->command->info('Dev seed data file found.');
         if (count($this->data) < 7) {
             $this->command->info('Dev seed data file out of date. Creating...');
             $this->createData();
         }
     }
     foreach ($this->data as $class => $data) {
         $full_class = 'App\\' . $class;
         $model = new $full_class();
         $table = $model->getTable();
         DB::table($table)->delete();
         $chunks = array_chunk($data, 500);
         foreach ($chunks as $chunk) {
             $model::insert($chunk);
         }
         $this->command->getOutput()->writeln("<info>Seeded:</info> {$table}");
     }
 }
开发者ID:hughfletcher,项目名称:nuticket,代码行数:31,代码来源:DatabaseSeeder.php

示例9: getImg

 private static function getImg(Meeting $meeting)
 {
     $name = 'meetings/' . $meeting->id;
     if (!\Storage::exists($name)) {
         return false;
     }
     return \Storage::get($name);
 }
开发者ID:dsd-meetme,项目名称:backend,代码行数:8,代码来源:MeetingsController.php

示例10: __construct

 public function __construct()
 {
     $object = Storage::get('db', false);
     //  Sanity check
     if ($object === false) {
         return Error::log('Could not get Database class');
     }
     $this->db = $this->database = $object;
 }
开发者ID:CraigChilds94,项目名称:scaffold,代码行数:9,代码来源:model.php

示例11: getArticle

 public function getArticle($uri)
 {
     $environment = Environment::createCommonMarkEnvironment();
     $environment->addExtension(new TableExtension());
     $converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));
     $contents = \Storage::get($uri . '.md');
     preg_match('/^.*$/m', $contents, $matches);
     return view('portal', array('body' => $converter->convertToHtml($contents), 'title' => substr($matches[0], 2)));
 }
开发者ID:sinkcup,项目名称:portal,代码行数:9,代码来源:Portal.php

示例12: __construct

 function __construct()
 {
     $model = new Models_Product();
     // Требуется только пересчет цены товара.
     if (!empty($_REQUEST['calcPrice'])) {
         $model->calcPrice();
         exit;
     }
     $product = Storage::get(md5('ControllersProduct' . URL::getUrl()));
     if ($product == null) {
         $settings = MG::get('settings');
         $product = $model->getProduct(URL::getQueryParametr('id'));
         if (empty($product)) {
             MG::redirect('/404');
             exit;
         }
         $product['meta_title'] = $product['meta_title'] ? $product['meta_title'] : $product['title'];
         $product['currency'] = $settings['currency'];
         $blockVariants = $model->getBlockVariants($product['id']);
         $blockedProp = $model->noPrintProperty();
         $propertyFormData = $model->createPropertyForm($param = array('id' => $product['id'], 'maxCount' => $product['count'], 'productUserFields' => $product['thisUserFields'], 'action' => "/catalog", 'method' => "POST", 'ajax' => true, 'blockedProp' => $blockedProp, 'noneAmount' => false, 'noneButton' => $product['count'] ? false : true, 'titleBtn' => MG::getSetting('buttonBuyName'), 'blockVariants' => $blockVariants, 'currency_iso' => $product['currency_iso']));
         // Легкая форма без характеристик.
         $liteFormData = $model->createPropertyForm($param = array('id' => $product['id'], 'maxCount' => $product['count'], 'productUserFields' => null, 'action' => "/catalog", 'method' => "POST", 'ajax' => true, 'blockedProp' => $blockedProp, 'noneAmount' => false, 'noneButton' => $product['count'] ? false : true, 'titleBtn' => MG::getSetting('buttonBuyName'), 'blockVariants' => $blockVariants));
         //echo viewData($propertyFormData['defaultSet']);
         $product['price_course'] += $propertyFormData['marginPrice'];
         $currencyRate = MG::getSetting('currencyRate');
         $currencyShopIso = MG::getSetting('currencyShopIso');
         $product['currency_iso'] = $product['currency_iso'] ? $product['currency_iso'] : $currencyShopIso;
         $product['old_price'] = $product['old_price'] * $currencyRate[$product['currency_iso']];
         $product['old_price'] = $product['old_price'] ? $product['old_price'] : 0;
         $product['price'] = MG::priceCourse($product['price_course']);
         $product['propertyForm'] = $propertyFormData['html'];
         $product['propertyNodummy'] = $propertyFormData['propertyNodummy'];
         $product['stringsProperties'] = $propertyFormData['stringsProperties'];
         $product['liteFormData'] = $liteFormData['html'];
         $product['description'] = MG::inlineEditor(PREFIX . 'product', "description", $product['id'], $product['description']);
         $product['title'] = MG::modalEditor('catalog', $product['title'], 'edit', $product["id"]);
         // Информация об отсутствии товара на складе.
         if (MG::getSetting('printRemInfo') == "true") {
             $message = 'Здравствуйте, меня интересует товар "' . str_replace("'", "&quot;", $product['title']) . '" с артикулом "' . $product['code'] . '", но его нет в наличии.
     Сообщите, пожалуйста, о поступлении этого товара на склад. ';
             if ($product['count'] != 0) {
                 $style = 'style="display:none;"';
             }
             $product['remInfo'] = "<span class='rem-info' " . $style . ">Товара временно нет на складе!<br/><a href='" . SITE . "/feedback?message=" . $message . "'>Сообщить когда будет в наличии.</a></span>";
         }
         if ($product['count'] < 0) {
             $product['count'] = "много";
         }
         $product['related'] = $model->createRelatedForm($product['related']);
         Storage::save(md5('ControllersProduct' . URL::getUrl()), $product);
     }
     // MG::set('propertyNodummy',$product['propertyNodummy']);
     // $_SESSION['propertyNodummy'] = $product['propertyNodummy'];
     $this->data = $product;
 }
开发者ID:nellka,项目名称:mebel,代码行数:56,代码来源:product.php

示例13: index

 public function index()
 {
     $paths = \Storage::files('blog');
     $articles = array();
     foreach ($paths as $path) {
         preg_match('/^.*$/m', \Storage::get($path), $matches);
         $articles[] = array('uri' => substr($path, 5, -3), 'title' => substr($matches[0], 2));
     }
     return view('blog/index', array('articles' => $articles, 'title' => 'sinkcup的博客'));
 }
开发者ID:sinkcup,项目名称:portal,代码行数:10,代码来源:Blog.php

示例14: download

 public function download()
 {
     $contents = Http::get($_GET["url"]);
     $fileInfo = new SplFileInfo($_GET["fname"]);
     // Add the torrent to deluge using the RPC api
     $tconfig = Storage::get("torrents");
     $client = new HTTPClient((array) $tconfig->deluge);
     $client->core->add_torrent_file($tconfig->dropPath . "/" . $fileInfo->getFilename() . ".torrent", base64_encode($contents), null);
     return $this->redirect("/?alert=" . urlencode("Torrent download started"));
 }
开发者ID:dmeijboom,项目名称:RaspberryWebInterface,代码行数:10,代码来源:torrent.php

示例15: testPutContents

 /**
  * @covers mychaelstyle\Storage::putContents
  */
 public function testPutContents()
 {
     $def1 = $this->dsnMap['Local'];
     $def2 = $this->dsnMap['Local2'];
     $this->object->addProvider($def2['dsn'], $def2['options']);
     $expected = 'This is put contents test';
     $this->object->putContents($this->uri_example, $expected, array('permission' => 0644));
     $result = $this->object->get($this->uri_example);
     $this->assertEquals($expected, $result);
 }
开发者ID:mychaelstyle,项目名称:php-utils,代码行数:13,代码来源:StorageTest.php


注:本文中的Storage::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。