• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP System\Fx类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Floxim\Floxim\System\Fx的典型用法代码示例。如果您正苦于以下问题:PHP Fx类的具体用法?PHP Fx怎么用?PHP Fx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: run

 public function run($args = null)
 {
     if (!$args) {
         $args = isset($_SERVER['argv']) ? $_SERVER['argv'] : array(__FILE__);
     } elseif (is_scalar($args)) {
         $arg_string = $args;
         $args = array(\Floxim\Floxim\System\Fx::path()->fileName(__FILE__));
         foreach (self::parseArgs($arg_string) as $arg) {
             $args[] = $arg;
         }
     }
     $this->scriptName = $args[0];
     array_shift($args);
     // Define command
     if (isset($args[0])) {
         $name = $args[0];
         array_shift($args);
     } else {
         $name = 'help';
     }
     // Create command
     if (!($command = $this->createCommand($name))) {
         $command = $this->createCommand('help');
     }
     return $command->run($args);
 }
开发者ID:floxim,项目名称:floxim,代码行数:26,代码来源:Manager.php


示例2: generate

 public function generate($params = array())
 {
     $form = $this->create($params);
     $form->is_generated = true;
     $form['fields'] = fx::collection();
     return $form;
 }
开发者ID:floxim,项目名称:module-form,代码行数:7,代码来源:Finder.php


示例3: getSavestring

 public function getSavestring(System\Entity $content = null)
 {
     $old_value = $content[$this['keyword']];
     $old_path = FX_BASE_URL . $old_value;
     if ($old_path === $this->value) {
         return $this->value;
     }
     $res = '';
     if (!empty($this->value)) {
         $c_val = fx::path()->abs($this->value);
         if (file_exists($c_val) && is_file($c_val)) {
             $file_name = fx::path()->fileName($c_val);
             $path = fx::path('@content_files/' . $content['site_id'] . '/' . $content['type'] . '/' . $this['keyword'] . '/' . $file_name);
             $path = fx::files()->getPutFilePath($path);
             fx::files()->move($c_val, $path);
             $res = fx::path()->removeBase(fx::path()->http($path));
         }
     }
     if (!empty($old_value)) {
         $old_value = fx::path()->abs($old_value);
         if (file_exists($old_value) && is_file($old_value)) {
             fx::files()->rm($old_value);
         }
     }
     return $res;
 }
开发者ID:floxim,项目名称:floxim,代码行数:26,代码来源:File.php


示例4: route

 public function route($url = null, $context = null)
 {
     $thumbs_path = fx::path()->http('@thumbs');
     $thumbs_path_trimmed = fx::path()->removeBase($thumbs_path);
     if (substr($url, 0, strlen($thumbs_path_trimmed)) !== $thumbs_path_trimmed) {
         return null;
     }
     $dir = substr($url, strlen($thumbs_path_trimmed));
     preg_match("~/([^/]+)(/.+\$)~", $dir, $parts);
     $config = $parts[1];
     $source_path = $parts[2];
     $source_abs = fx::path($source_path);
     if (!file_exists($source_abs)) {
         return null;
     }
     $target_dir = dirname(fx::path('@home/' . $url));
     if (!file_exists($target_dir) || !is_dir($target_dir)) {
         return null;
     }
     $config = $config . '.async-false.output-true';
     $config = \Floxim\Floxim\System\Thumb::readConfigFromPathString($config);
     fx::image($source_path, $config);
     fx::complete();
     die;
 }
开发者ID:floxim,项目名称:floxim,代码行数:25,代码来源:Thumb.php


示例5: checkUpdates

 public function checkUpdates()
 {
     $stored = $this->all();
     $url = fx::config('fx.update_url') . '?action=find&from=' . fx::version();
     @($res = file_get_contents($url));
     if (!$res) {
         return false;
     }
     $res = @json_decode($res);
     if ($res) {
         foreach ($res as $patch) {
             if ($stored->findOne('to', $patch->to)) {
                 continue;
             }
             $new_patch = $this->create(array('to' => $patch->to, 'from' => $patch->from, 'url' => $patch->url, 'created' => $patch->created));
             if ($patch->from == fx::version()) {
                 $new_patch['status'] = 'ready';
             } else {
                 $new_patch['status'] = 'pending';
             }
             $new_patch->save();
         }
     }
     return true;
 }
开发者ID:floxim,项目名称:floxim,代码行数:25,代码来源:Finder.php


示例6: formatSettings

 public function formatSettings()
 {
     $fields = array();
     $fields[] = array('id' => 'format[source]', 'name' => 'format[source]', 'type' => 'hidden', 'value' => 'manual');
     $fields[] = array('name' => 'format[values]', 'label' => fx::alang('Elements', 'system'), 'type' => 'set', 'tpl' => array(array('name' => 'id', 'type' => 'string'), array('name' => 'value', 'type' => 'string')), 'values' => $this['format']['values'] ? $this['format']['values'] : array(), 'labels' => array('id', 'value'));
     return $fields;
 }
开发者ID:floxim,项目名称:floxim,代码行数:7,代码来源:Select.php


示例7: getSavestring

 public function getSavestring(System\Entity $content = null)
 {
     $old_value = $content[$this['keyword']];
     if ($old_value != $this->value) {
         if (!empty($old_value)) {
             $old_value = fx::path()->abs($old_value);
             if (file_exists($old_value) && is_file($old_value)) {
                 fx::files()->rm($old_value);
             }
         }
         if (!empty($this->value)) {
             $c_val = fx::path()->abs($this->value);
             if (file_exists($c_val) && is_file($c_val)) {
                 preg_match("~[^" . preg_quote(DIRECTORY_SEPARATOR) . ']+$~', $c_val, $fn);
                 $path = fx::path()->http('@content_files/' . $content['site_id'] . '/' . $content['type'] . '/' . $this['keyword'] . '/' . $fn[0]);
                 $try = 0;
                 while (fx::path()->exists($path)) {
                     $file_name = preg_replace("~(\\.[^\\.]+)\$~", "_" . $try . "\$1", $fn[0]);
                     $try++;
                     $path = fx::path()->http('@content_files/' . $content['type'] . '/' . $this['keyword'] . '/' . $file_name);
                 }
                 fx::files()->move($c_val, $path);
             }
         }
     }
     $res = isset($path) ? $path : $this->value;
     return $res;
 }
开发者ID:piarsonforked,项目名称:floxim,代码行数:28,代码来源:File.php


示例8: __construct

 public function __construct($context, $box_id, $loop = null)
 {
     if (fx::isAdmin()) {
         self::addAdminAssets();
         $this->avail = $this->getAvailFields($context);
     }
     $this->box_id = $box_id;
     $param_id = $this->getParamId();
     $data = $context->get($param_id);
     if (is_string($data) && !empty($data)) {
         $data = json_decode($data, true);
     }
     //fx::log($this, $data);
     if (!$data || !isset($data['is_stored'])) {
         $groups = $context->get('groups');
         $default_data = $this->prepareGroups($groups);
         $data = $data ? \Floxim\Floxim\System\Util::fullMerge($data, $default_data) : $default_data;
     }
     $this->data = $data;
     //fx::log('set data', $this->data);
     if ($loop) {
         $this->containing_loop = $loop;
         $box = $this;
         $loop->onStop(function () use($box) {
             $box->export();
         });
     }
 }
开发者ID:floxim,项目名称:module-ui,代码行数:28,代码来源:Box.php


示例9: getProfiler

 protected function getProfiler()
 {
     $profile = fx::config('dev.profile_controllers');
     if ($profile) {
         return fx::profiler();
     }
 }
开发者ID:piarsonforked,项目名称:floxim,代码行数:7,代码来源:Frontoffice.php


示例10: doNeighbours

 public function doNeighbours()
 {
     $item = fx::env('page');
     $q = $this->getFinder()->order(null)->limit(1)->where('site_id', fx::env('site_id'));
     $q_next = clone $q;
     $q_prev = clone $q;
     if ($this->getParam('sorting') === 'auto' && $item['infoblock_id']) {
         $item_ib_params = fx::data('infoblock', $item['infoblock_id'])->get('params');
         $ib_sorting = $item_ib_params['sorting'];
         $this->setParam('sorting', $ib_sorting == 'manual' || $ib_sorting == 'auto' ? 'priority' : $ib_sorting);
         $this->setParam('sorting_dir', $item_ib_params['sorting_dir']);
     }
     $sort_field = $this->getParam('sorting', 'priority');
     if ($sort_field === 'auto') {
         $sort_field = 'priority';
     }
     $dir = strtolower($this->getParam('sorting_dir', 'asc'));
     $where_prev = array(array($sort_field, $item[$sort_field], $dir == 'asc' ? '<' : '>'));
     $where_next = array(array($sort_field, $item[$sort_field], $dir == 'asc' ? '>' : '<'));
     $group_by_parent = $this->getParam('group_by_parent');
     if ($group_by_parent) {
         $c_parent = fx::content($item['parent_id']);
         // todo: psr0 need verify
         $q_prev->order('parent.priority', 'desc')->where('parent.priority', $c_parent['priority'], '<=');
         $q_next->order('parent.priority', 'asc')->where('parent.priority', $c_parent['priority'], '>=');
         $where_prev[] = array('parent_id', $item['parent_id'], '!=');
         $where_next[] = array('parent_id', $item['parent_id'], '!=');
     }
     $q_prev->order($sort_field, $dir == 'asc' ? 'desc' : 'asc')->where($where_prev, null, 'or');
     $prev = $q_prev->all();
     $q_next->order($sort_field, $dir)->where($where_next, null, 'or');
     $next = $q_next->all();
     //fx::log($q_prev->showQuery(), $q_next->showQuery());
     return array('prev' => $prev, 'current' => $item, 'next' => $next);
 }
开发者ID:floxim,项目名称:module-main,代码行数:35,代码来源:Controller.php


示例11: deleteInfoblocks

 protected function deleteInfoblocks()
 {
     $infoblocks = fx::data('infoblock')->where('site_id', $this['id'])->all();
     foreach ($infoblocks as $infoblock) {
         $infoblock->delete();
     }
 }
开发者ID:floxim,项目名称:floxim,代码行数:7,代码来源:Entity.php


示例12: getErrorPage

 public function getErrorPage($site_id = null)
 {
     if (is_null($site_id)) {
         $site_id = fx::env('site_id');
     }
     $error_page = fx::data('page', fx::data('site', $site_id)->get('error_page_id'));
     return $error_page;
 }
开发者ID:piarsonforked,项目名称:floxim,代码行数:8,代码来源:Error.php


示例13: checkValueIsFile

 public static function checkValueIsFile($v)
 {
     if (empty($v)) {
         return false;
     }
     $files_path = fx::path('@files');
     $path = fx::path();
     return $path->isInside($v, $files_path) && $path->isFile($v);
 }
开发者ID:floxim,项目名称:floxim,代码行数:9,代码来源:Entity.php


示例14: getDateFormats

 public function getDateFormats()
 {
     $formats = array('j %month:gen% Y', '%Month% Y', 'd.m.Y', 'd/m/Y', 'H:i');
     $res = array();
     foreach ($formats as $f) {
         $res[$f] = fx::date(time(), $f);
     }
     return $res;
 }
开发者ID:floxim,项目名称:module-ui,代码行数:9,代码来源:Module.php


示例15: getBlocks

 public function getBlocks()
 {
     $area_id = $this->getAreaId();
     $blocks = fx::page()->getAreaInfoblocks($area_id);
     if (count($blocks) === 0) {
         return null;
     }
     return $blocks;
 }
开发者ID:floxim,项目名称:module-ui,代码行数:9,代码来源:Grid.php


示例16: install

 public function install(\Floxim\Floxim\Component\Infoblock\Entity $ib, $ctr, $params)
 {
     if (!isset($params['form_id']) || !$params['form_id']) {
         $form = fx::data('floxim.form.form')->create(array('name' => 'My new form'));
         $form->save();
         $ib->digSet('params.form_id', $form['id']);
         $ib->save();
         fx::log('ib savd', $ib, $params, $form);
     }
 }
开发者ID:floxim,项目名称:module-form,代码行数:10,代码来源:Controller.php


示例17: getConfigSources

 protected function getConfigSources()
 {
     $sources = array();
     $c_name = $this->getControllerName();
     $com_file = fx::path('@module/' . fx::getComponentPath($c_name) . '/cfg.php');
     if (file_exists($com_file)) {
         $sources[] = $com_file;
     }
     return $sources;
 }
开发者ID:floxim,项目名称:floxim,代码行数:10,代码来源:Widget.php


示例18: getEntityClassName

 public function getEntityClassName($data)
 {
     $parts = explode('.', $data['keyword']);
     list($vendor, $module) = $parts;
     $class = fx::util()->underscoreToCamel($vendor) . "\\" . fx::util()->underscoreToCamel($module) . "\\Module";
     if (class_exists($class)) {
         return $class;
     }
     return parent::getEntityClassName();
 }
开发者ID:floxim,项目名称:floxim,代码行数:10,代码来源:Finder.php


示例19: route

 public function route($url = null, $context = null)
 {
     if (!fx::isAdmin()) {
         return null;
     }
     if (!preg_match("~^/\\~ib/(\\d+|fake(?:\\-\\d+)?)@(\\d+)~", $url, $ib_info)) {
         return null;
     }
     $c_url = fx::input()->fetchGetPost('_ajax_base_url');
     if ($c_url) {
         $_SERVER['REQUEST_URI'] = $c_url;
         $path = fx::router()->getPath(fx::path()->removeBase($c_url));
         if ($path) {
             fx::env('page', $path->last());
         } else {
             fx::env('page', fx::router('error')->getErrorPage());
         }
         $c_url = parse_url($c_url);
         if (isset($c_url['query'])) {
             parse_str($c_url['query'], $_GET);
         }
     }
     $ib_id = $ib_info[1];
     $page_id = $ib_info[2];
     if (!fx::env('page') && $page_id) {
         $page = fx::data('floxim.main.content', $page_id);
         fx::env('page', $page);
     }
     fx::env('ajax', true);
     $page_infoblocks = fx::router('front')->getPageInfoblocks($page_id, fx::env('layout'));
     fx::page()->setInfoblocks($page_infoblocks);
     // import layout template to recreate real env
     fx::router('front')->importLayoutTemplate();
     // front end can try to reload the layout which is out of date
     // when updating from "layout settings" panel
     $infoblock = fx::data('infoblock', $ib_id);
     if (!$infoblock && isset($_POST['infoblock_is_layout']) || $infoblock->isLayout()) {
         //$infoblock = $layout_infoblock;
         $infoblock = fx::router('front')->getLayoutInfoblock(fx::env('page'));
     }
     fx::http()->status('200');
     $infoblock_overs = null;
     if (fx::isAdmin() && isset($_POST['override_infoblock'])) {
         $infoblock_overs = fx::input('post', 'override_infoblock');
         if (is_string($infoblock_overs)) {
             parse_str($infoblock_overs, $infoblock_overs);
             $infoblock_overs = fx::input()->prepareSuperglobal($infoblock_overs);
         }
         $infoblock->override($infoblock_overs);
     }
     $infoblock->overrideParam('ajax_mode', true);
     $res = $infoblock->render();
     return $res;
 }
开发者ID:floxim,项目名称:floxim,代码行数:54,代码来源:Infoblock.php


示例20: showAdminPanel

 protected function showAdminPanel()
 {
     if (!fx::isAdmin()) {
         return;
     }
     // initialize the admin panel
     $p = fx::page();
     $js_config = new Admin\Configjs();
     $p->addJsText("\$fx.init(" . $js_config->getConfig() . ");");
     $p->setAfterBody(Admin\Controller\Adminpanel::panelHtml());
 }
开发者ID:floxim,项目名称:floxim,代码行数:11,代码来源:Layout.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Flux\Core类代码示例发布时间:2022-05-23
下一篇:
PHP Functions\FunctionsPrint类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap