in /website/web/www.buyplas.com/vendor/yiisoft/yii2/helpers/BaseFileHelper.php at line 477
if ($recursive && !is_dir($parentDir) && $parentDir !== $path) { static::createDirectory($parentDir, $mode, true); } try { if (!mkdir($path, $mode)) { return false; } } catch (\Exception $e) { if (!is_dir($path)) {// https://github.com/yiisoft/yii2/issues/9288 throw new \yii\base\Exception("Failed to create directory \"$path\": " . $e->getMessage(), $e->getCode(), $e); } } try { return chmod($path, $mode); } catch (\Exception $e) { throw new \yii\base\Exception("Failed to change permissions for directory \"$path\": " . $e->getMessage(), $e->getCode(), $e); } }
* file copied from, while `$to` is the copy target. * @throws \yii\base\InvalidParamException if unable to open directory */ public static function copyDirectory($src, $dst, $options = []) { if (!is_dir($dst)) { static::createDirectory($dst, isset($options['dirMode']) ? $options['dirMode'] : 0775, true); } $handle = opendir($src); if ($handle === false) { throw new InvalidParamException("Unable to open directory: $src"); }
}; } } if (!isset($opts['afterCopy']) && $this->afterCopy !== null) { $opts['afterCopy'] = $this->afterCopy; } FileHelper::copyDirectory($src, $dstDir, $opts); } return [$dstDir, $this->baseUrl . '/' . $dir]; } /**
throw new InvalidParamException("The file or directory to be published does not exist: $path"); } if (is_file($src)) { return $this->_published[$path] = $this->publishFile($src); } else { return $this->_published[$path] = $this->publishDirectory($src, $options); } } /** * Publishes a file. * @param string $src the asset file to be published
* CSS or JS files using [[AssetManager::converter|asset converter]]. * @param AssetManager $am the asset manager to perform the asset publishing */ public function publish($am) { if ($this->sourcePath !== null && !isset($this->basePath, $this->baseUrl)) { list ($this->basePath, $this->baseUrl) = $am->publish($this->sourcePath, $this->publishOptions); } if (isset($this->basePath, $this->baseUrl) && ($converter = $am->getConverter()) !== null) { foreach ($this->js as $i => $js) { if (is_array($js)) { $file = array_shift($js);
if (!isset($config['class'])) { $config['class'] = $name; } /* @var $bundle AssetBundle */ $bundle = Yii::createObject($config); if ($publish) { $bundle->publish($this); } return $bundle; } /** * Loads dummy bundle by name
*/ public function getBundle($name, $publish = true) { if ($this->bundles === false) { return $this->loadDummyBundle($name); } elseif (!isset($this->bundles[$name])) { return $this->bundles[$name] = $this->loadBundle($name, [], $publish); } elseif ($this->bundles[$name] instanceof AssetBundle) { return $this->bundles[$name]; } elseif (is_array($this->bundles[$name])) { return $this->bundles[$name] = $this->loadBundle($name, $this->bundles[$name], $publish); } elseif ($this->bundles[$name] === false) { return $this->loadDummyBundle($name);
* @throws InvalidConfigException if the asset bundle does not exist or a circular dependency is detected */ public function registerAssetBundle($name, $position = null) { if (!isset($this->assetBundles[$name])) { $am = $this->getAssetManager(); $bundle = $am->getBundle($name); $this->assetBundles[$name] = false; // register dependencies $pos = isset($bundle->jsOptions['position']) ? $bundle->jsOptions['position'] : null; foreach ($bundle->depends as $dep) { $this->registerAssetBundle($dep, $pos); }
$am = $this->getAssetManager(); $bundle = $am->getBundle($name); $this->assetBundles[$name] = false; // register dependencies $pos = isset($bundle->jsOptions['position']) ? $bundle->jsOptions['position'] : null; foreach ($bundle->depends as $dep) { $this->registerAssetBundle($dep, $pos); } $this->assetBundles[$name] = $bundle; } elseif ($this->assetBundles[$name] === false) { throw new InvalidConfigException("A circular dependency is detected for bundle '$name'."); } else { $bundle = $this->assetBundles[$name];
* Registers this asset bundle with a view. * @param View $view the view to be registered with * @return static the registered asset bundle instance */ public static function register($view) { return $view->registerAssetBundle(get_called_class()); } /** * Initializes the bundle. * If you override this method, make sure you call the parent implementation in the last. */
use yii\helpers\Html; use yii\widgets\Breadcrumbs; use frontend\assets\AppAsset; use common\widgets\Alert; use yii\web\View; AppAsset::register($this); ?> <?php $this->beginPage() ?> <!DOCTYPE html> <html lang="<?= Yii::$app->language ?>"> <head> <title><?= $this->title?Html::encode($this->title):'买塑网–买塑料 上买塑';?></title>
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @since 2.0.1 */ public function renderContent($content) { $layoutFile = $this->findLayoutFile($this->getView()); if ($layoutFile !== false) { return $this->getView()->renderFile($layoutFile, ['content' => $content], $this); } else { return $content; } } /**
* @return string the rendering result. * @throws InvalidParamException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered * @return string the rendering result of the layout with the given static string as the `$content` variable.
'article' => $article, 'articleList' => $articleList, 'category' => $category, 'writer_article_list' => $writer_article_list, 'like_article_list' => $like_article_list, ]); } //分析报告文章内页 public function actionArticledetail2() {
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'id' => '30532', ]; $_COOKIE = [ 'xiaohe_users' => '2081593891711728207', ]; $_SESSION = [ '__flash' => [], 'xiaohe_users' => '2081593891711728207', 'first_visit_time' => 1711728207, ];