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

PHP var_export函数代码示例

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

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



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

示例1: procesar

 function procesar()
 {
     toba::logger_ws()->debug('Servicio Llamado: ' . $this->info['basica']['item']);
     toba::logger_ws()->set_checkpoint();
     set_error_handler('toba_logger_ws::manejador_errores_recuperables', E_ALL);
     $this->validar_componente();
     //-- Pide los datos para construir el componente, WSF no soporta entregar objetos creados
     $clave = array();
     $clave['proyecto'] = $this->info['objetos'][0]['objeto_proyecto'];
     $clave['componente'] = $this->info['objetos'][0]['objeto'];
     list($tipo, $clase, $datos) = toba_constructor::get_runtime_clase_y_datos($clave, $this->info['objetos'][0]['clase'], false);
     agregar_dir_include_path(toba_dir() . '/php/3ros/wsf');
     $opciones_extension = toba_servicio_web::_get_opciones($this->info['basica']['item'], $clase);
     $wsdl = strpos($_SERVER['REQUEST_URI'], "?wsdl") !== false;
     $sufijo = 'op__';
     $metodos = array();
     $reflexion = new ReflectionClass($clase);
     foreach ($reflexion->getMethods() as $metodo) {
         if (strpos($metodo->name, $sufijo) === 0) {
             $servicio = substr($metodo->name, strlen($sufijo));
             $prefijo = $wsdl ? '' : '_';
             $metodos[$servicio] = $prefijo . $metodo->name;
         }
     }
     $opciones = array();
     $opciones['serviceName'] = $this->info['basica']['item'];
     $opciones['classes'][$clase]['operations'] = $metodos;
     $opciones = array_merge($opciones, $opciones_extension);
     $this->log->debug("Opciones del servidor: " . var_export($opciones, true), 'toba');
     $opciones['classes'][$clase]['args'] = array($datos);
     toba::logger_ws()->set_checkpoint();
     $service = new WSService($opciones);
     $service->reply();
     $this->log->debug("Fin de servicio web", 'toba');
 }
开发者ID:emma5021,项目名称:toba,代码行数:35,代码来源:toba_solicitud_servicio_web.php


示例2: setValue

 /**
  * Sets selected items (by keys).
  * @param  array
  * @return self
  */
 public function setValue($values)
 {
     if (is_scalar($values) || $values === NULL) {
         $values = (array) $values;
     } elseif (!is_array($values)) {
         throw new Nette\InvalidArgumentException(sprintf("Value must be array or NULL, %s given in field '%s'.", gettype($values), $this->name));
     }
     $flip = [];
     foreach ($values as $value) {
         if (!is_scalar($value) && !method_exists($value, '__toString')) {
             throw new Nette\InvalidArgumentException(sprintf("Values must be scalar, %s given in field '%s'.", gettype($value), $this->name));
         }
         $flip[(string) $value] = TRUE;
     }
     $values = array_keys($flip);
     if ($this->checkAllowedValues && ($diff = array_diff($values, array_keys($this->items)))) {
         $set = Nette\Utils\Strings::truncate(implode(', ', array_map(function ($s) {
             return var_export($s, TRUE);
         }, array_keys($this->items))), 70, '...');
         $vals = (count($diff) > 1 ? 's' : '') . " '" . implode("', '", $diff) . "'";
         throw new Nette\InvalidArgumentException("Value{$vals} are out of allowed set [{$set}] in field '{$this->name}'.");
     }
     $this->value = $values;
     return $this;
 }
开发者ID:jjanekk,项目名称:forms,代码行数:30,代码来源:MultiChoiceControl.php


示例3: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $realCacheDir = $this->getContainer()->getParameter('kernel.cache_dir');
     $oldCacheDir = $realCacheDir . '_old';
     $filesystem = $this->getContainer()->get('filesystem');
     if (!is_writable($realCacheDir)) {
         throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $realCacheDir));
     }
     if ($filesystem->exists($oldCacheDir)) {
         $filesystem->remove($oldCacheDir);
     }
     $kernel = $this->getContainer()->get('kernel');
     $output->writeln(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
     $this->getContainer()->get('cache_clearer')->clear($realCacheDir);
     if ($input->getOption('no-warmup')) {
         $filesystem->rename($realCacheDir, $oldCacheDir);
     } else {
         // the warmup cache dir name must have the same length than the real one
         // to avoid the many problems in serialized resources files
         $warmupDir = substr($realCacheDir, 0, -1) . '_';
         if ($filesystem->exists($warmupDir)) {
             $filesystem->remove($warmupDir);
         }
         $this->warmup($warmupDir, $realCacheDir, !$input->getOption('no-optional-warmers'));
         $filesystem->rename($realCacheDir, $oldCacheDir);
         if (defined('PHP_WINDOWS_VERSION_BUILD')) {
             sleep(1);
             // workaround for windows php rename bug
         }
         $filesystem->rename($warmupDir, $realCacheDir);
     }
     $filesystem->remove($oldCacheDir);
 }
开发者ID:ronaldlunaramos,项目名称:webstore,代码行数:36,代码来源:CacheClearCommand.php


示例4: cp

 /**
  * s2Member's PayPal Auto-Return/PDT handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     $paypal["s2member_log"][] = "No Return-Data. Customer MUST wait for Email Confirmation.";
     $paypal["s2member_log"][] = "Note. This can sometimes happen when/if you are offering an Initial/Trial Period. There are times when a Payment Gateway will NOT supply s2Member with any data immediately after checkout. When/if this happens, s2Member must process the transaction via IPN only (i.e. behind-the-scene), and the Customer must wait for Email Confirmation in these cases.";
     $paypal["s2member_log"][] = var_export($_REQUEST, true);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     if ($custom_success_redirection) {
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL: " . $custom_success_redirection . ".";
         wp_redirect($custom_success_redirection);
     } else {
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after asking Customer to check their email).";
         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! (you MUST check your email before proceeding).</strong><br /><br />* Note: It can take <em>(up to 15 minutes)</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_no_tx_data", $paypal, get_defined_vars());
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:39,代码来源:paypal-return-in-no-tx-data.inc.php


示例5: run_sql

function run_sql($file, $db, &$err, &$n)
{
    $sql = file_get_contents($file);
    $sql = explode(';', $sql);
    $err = 0;
    $n = 0;
    $c = count($sql);
    if (!$c) {
        echo "Unknown error.\n";
        exit;
    }
    foreach ($sql as $stmt) {
        if ($stmt == '' || $stmt == "\n" || $stmt == "\n\n") {
            $c--;
            continue;
        }
        $r = $db->exec($stmt);
        if ($r === false) {
            echo "\nError executing {$stmt}: " . var_export($db->errorInfo(), true) . "\n";
            $err++;
        } else {
            $n++;
        }
        if ($n % 5 == 0) {
            echo "[255DExecuting: {$file}, {$n}/{$c}[K";
        }
    }
    echo "\n";
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:29,代码来源:migrate-mypg.php


示例6: prepare

 public function prepare($statement, $driver_options = array())
 {
     if (isset($this->dsn) and stristr($this->dsn, 'anjuke_db') and preg_match('/\\sajk_propertys\\s/i', $statement)) {
         if (stristr($statement, 'select CITYID') or stristr($statement, 'insert') or stristr($statement, 'update ')) {
         } else {
             $dir = '/home/www/logs/propsql';
             if (!is_dir($dir)) {
                 mkdir($dir, 0755, true);
             }
             $content = '-=-=-=-=-=-=-=-=-=-=' . PHP_EOL;
             $content .= 'DSN: ' . $this->dsn . PHP_EOL;
             $content .= 'URI: ' . $_SERVER['REQUEST_URI'] . PHP_EOL;
             $content .= 'JOB: ' . var_export($_SERVER['argv'], true) . PHP_EOL;
             $content .= 'SQL: ' . $statement . PHP_EOL;
             file_put_contents($dir . '/' . date('Ymd'), $content, FILE_APPEND);
         }
     }
     //add by jackie for record SQL
     APF::get_instance()->pf_benchmark("sql", array($this->i => $statement));
     $stmt = parent::prepare($statement, $driver_options);
     if ($stmt instanceof PDOStatement) {
         $stmt->setFetchMode($this->default_fetch_mode);
     }
     //add by hexin for record SQL execute time
     $stmt->set_i($this->i);
     $this->i++;
     $stmt->_sql = $statement;
     return $stmt;
 }
开发者ID:uedcw,项目名称:webstory,代码行数:29,代码来源:PDO.php


示例7: _mkCheckTest

 function _mkCheckTest($case)
 {
     list($nonce_str, $skew, $now, $expected) = $case;
     $test = new Tests_Auth_OpenID_Nonce_TimestampCase($nonce_str, $skew, $now, $expected);
     $test->setName('CheckTimestamp ' . var_export($nonce_str, true));
     $this->addTest($test);
 }
开发者ID:marcioyonamine,项目名称:php-openid,代码行数:7,代码来源:Nonce.php


示例8: prepareData

 /**
  * Serialize the data for storing.
  *
  * Serializes the given $data to a executable PHP code representation 
  * string. This works with objects implementing {@link ezcBaseExportable},
  * arrays and scalar values (int, bool, float, string). The return value is
  * executable PHP code to be stored to disk. The data can be unserialized 
  * using the {@link fetchData()} method.
  * 
  * @param mixed $data
  * @return string
  *
  * @throws ezcCacheInvalidDataException
  *         if the $data can not be serialized (e.g. an object that does not
  *         implement ezcBaseExportable, a resource, ...).
  */
 protected function prepareData($data)
 {
     if (is_object($data) && !$data instanceof ezcBaseExportable || is_resource($data)) {
         throw new ezcCacheInvalidDataException(gettype($data), array('simple', 'array', 'ezcBaseExportable'));
     }
     return "<?php\nreturn " . var_export($data, true) . ";\n?>\n";
 }
开发者ID:mdb-webdev,项目名称:livehelperchat,代码行数:23,代码来源:object.php


示例9: check

 /**
  * {@inheritDoc}
  */
 public function check($value, $schema = null, JsonPointer $path = null, $i = null)
 {
     // Verify minItems
     if (isset($schema->minItems) && count($value) < $schema->minItems) {
         $this->addError($path, "There must be a minimum of " . $schema->minItems . " items in the array", 'minItems', array('minItems' => $schema->minItems));
     }
     // Verify maxItems
     if (isset($schema->maxItems) && count($value) > $schema->maxItems) {
         $this->addError($path, "There must be a maximum of " . $schema->maxItems . " items in the array", 'maxItems', array('maxItems' => $schema->maxItems));
     }
     // Verify uniqueItems
     if (isset($schema->uniqueItems) && $schema->uniqueItems) {
         $unique = $value;
         if (is_array($value) && count($value)) {
             $unique = array_map(function ($e) {
                 return var_export($e, true);
             }, $value);
         }
         if (count(array_unique($unique)) != count($value)) {
             $this->addError($path, "There are no duplicates allowed in the array", 'uniqueItems');
         }
     }
     // Verify items
     if (isset($schema->items)) {
         $this->validateItems($value, $schema, $path, $i);
     }
 }
开发者ID:rtucek,项目名称:json-schema,代码行数:30,代码来源:CollectionConstraint.php


示例10: sw_combine_debug

function sw_combine_debug()
{
    if (ProjectConfiguration::getActive()->isDebug()) {
        $response = sfContext::getInstance()->getResponse();
        echo "<!-- DEBUG MODE - \nCombined files : \n" . var_export($response->getCombinedAssets(), 1) . "\n -->\n";
    }
}
开发者ID:resid,项目名称:swCombinePlugin,代码行数:7,代码来源:swCombineHelper.php


示例11: testParse

 public function testParse()
 {
     $content = explode("\n", Sbp::testContent("<?\n__FILE . __DIR", __FILE__), 2);
     $content = $content[1];
     $this->assertSame(trim($content), var_export(__FILE__, true) . ' . ' . var_export(__DIR__, true) . ';', "__FILE . __DIR should be __FILE__ . __DIR__");
     $this->assertParse("ANameSpace\\BClass:CNameSpace\\DClass\n\t- \$var = 'a'", "class ANameSpace\\BClass extends CNameSpace\\DClass {\n\tprivate \$var = 'a';\n}");
 }
开发者ID:kylekatarnls,项目名称:sbp,代码行数:7,代码来源:parseTest.php


示例12: array_merge

 public static function &getInstance($config, $force_new_conn = false)
 {
     $default['dbdriver'] = 'mysql';
     $default['hostname'] = '127.0.0.1';
     $default['port'] = '3306';
     $default['username'] = 'root';
     $default['password'] = '';
     $default['database'] = 'test';
     $default['dbprefix'] = '';
     $default['pconnect'] = TRUE;
     $default['db_debug'] = TRUE;
     $default['char_set'] = 'utf8';
     $default['dbcollat'] = 'utf8_general_ci';
     $default['swap_pre'] = '';
     $default['autoinit'] = TRUE;
     $default['stricton'] = FALSE;
     $config = array_merge($default, $config);
     $class = 'CI_DB_' . $config['dbdriver'] . '_driver';
     if (!class_exists($class, false)) {
         return null;
     }
     $config0 = $config;
     asort($config0);
     $hash = md5(sha1(var_export($config0, TRUE)));
     if ($force_new_conn || !isset(self::$conns[$hash])) {
         self::$conns[$hash] = new $class($config);
     }
     if ($config['dbdriver'] == 'pdo' && stripos($config['hostname'], 'mysql') !== FALSE) {
         //pdo下面dns设置mysql字符会失效,这里hack一下
         self::$conns[$hash]->simple_query('set names ' . $config['char_set']);
     }
     return self::$conns[$hash];
 }
开发者ID:admpub,项目名称:MicroPHP,代码行数:33,代码来源:DB.php


示例13: save

 function save($key, $data)
 {
     if (!isset($this->data[$key]) || $this->data[$key] !== $data) {
         $this->data[$key] = $data;
         file_put_contents($this->filename, '<?php return ' . var_export($this->data, true) . ';', LOCK_EX);
     }
 }
开发者ID:direct-solution,项目名称:solution-orm,代码行数:7,代码来源:CacheIncludeController.php


示例14: sendToAll

 /**
  * 向所有客户端(或者client_id_array指定的客户端)广播消息
  * @param string $message         向客户端发送的消息(可以是二进制数据)
  * @param array  $client_id_array 客户端id数组
  */
 public static function sendToAll($message, $client_id_array = null)
 {
     $gateway_data = GatewayProtocol::$empty;
     $gateway_data['cmd'] = GatewayProtocol::CMD_SEND_TO_ALL;
     $gateway_data['body'] = $message;
     if ($client_id_array) {
         $params = array_merge(array('N*'), $client_id_array);
         $gateway_data['ext_data'] = call_user_func_array('pack', $params);
     } elseif (empty($client_id_array) && is_array($client_id_array)) {
         return;
     }
     // 如果有businessWorker实例,说明运行在workerman环境中,通过businessWorker中的长连接发送数据
     if (self::$businessWorker) {
         foreach (self::$businessWorker->gatewayConnections as $gateway_connection) {
             $gateway_connection->send($gateway_data);
         }
     } else {
         $all_addresses = Store::instance('gateway')->get('GLOBAL_GATEWAY_ADDRESS');
         if (!is_array($all_addresses)) {
             throw new \Exception('bad gateway addresses ' . var_export($all_addresses, true));
         }
         foreach ($all_addresses as $address) {
             self::sendToGateway($address, $gateway_data);
         }
     }
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:31,代码来源:Gateway.php


示例15: actionIndex

 public function actionIndex($email, $spam_id, $key)
 {
     /** @var User $user */
     $user = User::model()->findByAttributes(array('email' => $email));
     /** @var Spam $spam */
     $spam = Spam::model()->findByPk($spam_id);
     if (!$user || !$spam || $key != $spam->getUnsubscribeHash($user)) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $unsubscribed = false;
     $spam_type_id = $spam->type_enum;
     foreach ($user->userUnsubscribes as $unsubscribe) {
         if ($unsubscribe->spam_type_id == $spam_type_id) {
             $unsubscribed = true;
         }
     }
     if (!$unsubscribed) {
         $userUnsubscribe = new UserUnsubscribe();
         $userUnsubscribe->spam_type_id = $spam_type_id;
         $userUnsubscribe->user_id = $user->id;
         if ($userUnsubscribe->save()) {
             $unsubscribed = true;
         } else {
             throw new CException('unsubscribe error:' . var_export($userUnsubscribe->errors, true));
         }
     }
     $this->render('/user/unsubscribe', array('user' => $user, 'spam' => $spam, 'unsubscribed' => $unsubscribed));
 }
开发者ID:schyzoo,项目名称:YiiBoilerplate,代码行数:28,代码来源:UnsubscribeController.php


示例16: move_to_yaml

function move_to_yaml()
{
    $sql = SQL::current();
    if (!($attrs = $sql->select("post_attributes", "*", array("name" => array("unclean_tags", "clean_tags"))))) {
        return;
    }
    function parseTags($tags, $clean)
    {
        $tags = explode(",", preg_replace("/\\{\\{([^\\}]+)\\}\\}/", "\\1", $tags));
        $clean = explode(",", preg_replace("/\\{\\{([^\\}]+)\\}\\}/", "\\1", $clean));
        return array_combine($tags, $clean);
    }
    $tags = array();
    foreach ($attrs->fetchAll() as $attr) {
        if ($attr["name"] == "unclean_tags") {
            $tags[$attr["post_id"]]["unclean"] = $attr["value"];
        } else {
            $tags[$attr["post_id"]]["clean"] = $attr["value"];
        }
    }
    if (empty($tags)) {
        return;
    }
    foreach ($tags as $post_id => $tags) {
        $yaml = YAML::dump(parseTags($tags["unclean"], $tags["clean"]));
        echo _f("Relocating tags for post #%d...", array($post_id), "tags");
        echo test($insert = $sql->replace("post_attributes", array("name" => "tags", "value" => $yaml, "post_id" => $post_id)), _f("Backup written to %s.", array("./_tags.bak.txt")));
        if (!$insert) {
            return file_put_contents("./_tags.bak.txt", var_export($tags, true));
        }
    }
    echo __("Removing old post attributes...", "tags") . test($sql->delete("post_attributes", array("name" => array("unclean_tags", "clean_tags"))));
}
开发者ID:homebru,项目名称:bandb,代码行数:33,代码来源:upgrades.php


示例17: compile

 /**
  * @param $args
  * @param $compiler
  * @return string
  */
 public function compile($args, $compiler)
 {
     // check and get attributes
     $_attr = $this->getAttributes($compiler, $args);
     // default 'false' for all option flags not set
     foreach ($_attr as $index => $param) {
         if ($param === false) {
             unset($_attr[$index]);
         } elseif ($param === true) {
             $_attr[$index] = "'1'";
         }
     }
     $params = array();
     foreach ($_attr as $index => $param) {
         if (!preg_match('/^([\'"]?)[a-zA-Z0-9]+(\\1)$/', $param, $match) || !empty($_attr['appendSession'])) {
             $params = '';
             foreach ($_attr as $index => $param) {
                 $params .= var_export($index, true) . ' => ' . $param . ', ';
             }
             return '<?php echo Enlight_Application::Instance()->Front()->Router()->assemble(array(' . $params . ')); ?>';
         }
         $params[$index] = substr($param, 1, -1);
     }
     $url = Enlight_Application::Instance()->Front()->Router()->assemble($params);
     return '<?php echo ' . var_export($url, true) . ';?>';
 }
开发者ID:nvdnkpr,项目名称:Enlight,代码行数:31,代码来源:compiler.url.php


示例18: updateUserAction

 public function updateUserAction($yacPrefix, $key)
 {
     $yac = new Yac($yacPrefix);
     $ret = $yac->get($key);
     // Q: Does ttl expired key flushed or not?
     $user = new User();
     $user->name = $ret['param']['name'];
     $user->department = $ret['param']['department'];
     $success = $user->save();
     if ($success) {
         unset($user);
         // echo "Thanks for registering!\r\n";
     } else {
         echo "Sorry, {$yacPrefix}:::::::{$key} \r\n";
         foreach ($user->getMessages() as $message) {
             echo $message->getMessage(), "\r\n";
         }
     }
     if (!$ret) {
         var_export(array($key, $ret));
         echo "\r\n";
     }
     $yac->delete($key);
     return true;
     // $arr = unserialize($ret);
     // return array("heihei"=>$ret,"ret2"=>$ret2);
 }
开发者ID:momophp,项目名称:DoraPhalcon,代码行数:27,代码来源:AsyncController.php


示例19: write

 /**
  * Defined by Zend_Config_Writer
  *
  * @param  string      $filename
  * @param  Zend_Config $config
  * @throws Zend_Config_Exception When filename was not set
  * @throws Zend_Config_Exception When filename is not writable
  * @return void
  */
 public function write($filename = null, Zend_Config $config = null)
 {
     if ($filename !== null) {
         $this->setFilename($filename);
     }
     if ($config !== null) {
         $this->setConfig($config);
     }
     if ($this->_filename === null) {
         require_once 'Zend/Config/Exception.php';
         throw new Zend_Config_Exception('No filename was set');
     }
     if ($this->_config === null) {
         require_once 'Zend/Config/Exception.php';
         throw new Zend_Config_Exception('No config was set');
     }
     $data = $this->_config->toArray();
     $sectionName = $this->_config->getSectionName();
     if (is_string($sectionName)) {
         $data = array($sectionName => $data);
     }
     $arrayString = "<?php\n" . "return " . var_export($data, true) . ";\n";
     $result = @file_put_contents($this->_filename, $arrayString);
     if ($result === false) {
         require_once 'Zend/Config/Exception.php';
         throw new Zend_Config_Exception('Could not write to file "' . $this->_filename . '"');
     }
 }
开发者ID:gauravstomar,项目名称:Pepool,代码行数:37,代码来源:Array.php


示例20: run

 public function run()
 {
     if (!version_compare($this->from_version, '7.0', '>') || !version_compare($this->from_version, '7.6', '<')) {
         // only need to run this upgrading for greater than 7.0 and less than 7.7
         return;
     }
     $customModules = $this->getCustomModules();
     if (empty($customModules)) {
         // No MB modules - nothing to do
         return;
     }
     foreach ($customModules as $module) {
         $path = 'modules/' . $module . '/clients/base/menus/header/header.php';
         $this->foundPattern = false;
         $viewdefs = null;
         include $path;
         if (!empty($viewdefs)) {
             $module = key($viewdefs);
             $array = $viewdefs[$module]['base']['menu']['header'];
             $this->fixIcons($array);
             if ($this->foundPattern) {
                 sugar_file_put_contents($path, "<?php\n\n/* This file was generated by the 7_FixIconNameChanges upgrader */\n\$viewdefs['{$module}']['base']['menu']['header'] =  " . var_export($array, true) . ";\n");
             }
         }
         $viewdefs = null;
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:27,代码来源:7_FixIconNameChanges.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP var_export_helper函数代码示例发布时间:2022-05-23
下一篇:
PHP var_dump函数代码示例发布时间: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