/** * Get the content parsed into html * * @return string */ public function getParsedContentAttribute() { if (Config::get('wardrobe.cache')) { $content = $this->attributes['content']; return Cache::rememberForever('post-' . $this->attributes['id'], function () use($content) { return md($content); }); } return md($this->attributes['content']); }
function abc() { return md(); }
$content = md($sujet_slug, $sujet, "securite", $i); $filename = 'security/' . $sujet_slug . '.md'; file_put_contents($filename, $content); $j = 0; foreach ($pages as $name => $pages2) { $j++; $page_slug = slugify($name); $content = md($page_slug, $name, "securite_" . $sujet_slug, $j); $filename = 'security/' . $sujet_slug . '/' . $page_slug . '.md'; file_put_contents($filename, $content); mkdir('security/' . $sujet_slug . '/' . $page_slug); $k = 0; foreach ($pages2 as $o => $name2) { $k++; $page2_slug = slugify($name2); $content = md($page2_slug, $name2, "securite_" . $sujet_slug . "_" . $page_slug, $k); $filename = 'security/' . $sujet_slug . '/' . $page_slug . '/' . $page2_slug . '.md'; file_put_contents($filename, $content); } } } function md($slug, $title, $parent, $weight) { $date = date("c"); $identifier = $parent . '_' . $slug; $weight = $weight * 100; $content = <<<EOT +++ date = "{$date}" draft = false title = "{$title}"
<?php include 'inc.php'; myInit(__FILE__); echo "testing include"; PC::db("testing if PC::db in scope"); echo md("# Testing MarkDown");
function md($mvdir, $dst, $cop = false) { if (substr($dst, -1) == "\\") { $dst = substr($dst, 0, strlen($dst) - 1); } if (substr($mvdir, -1) == "\\") { $mvdir = substr($mvdir, 0, strlen($mvdir) - 1); } if (!file_exists($mvdir)) { return FALSE; } dexists($dst); $han = @opendir($mvdir); while ($f = @readdir($han)) { $mvd = $mvdir . "\\" . $f; if (@is_dir($mvd)) { if (!($f['value'] == "." || $f == "..")) { md($mvd, $dst . "\\" . $f, $cop); } } else { if (@copy($mvd, $dst . "\\" . $f)) { echo $mvd . " Move Done \n"; } if (!$cop) { @unlink($mvd); } } } @closedir($han); if (!$cop) { @rmdir($mvdir); } return TRUE; }
/** * delete the cache content using APC cache system * * @param string $process_name Cached ID to delete the content in * @return bool */ public function apc_clean($process_name) { return apc_delete(md($process_name)); }
/** * Parses raw blog posts, performs wardrobe level and application level parsing * @return string */ public function processParseBlogPostContent() { if (!\Request::wantsJson() && !\Request::ajax()) { \App::abort(404); } $content = \Input::get('content'); return \BlogPostParser::parse(md($content), '*****@*****.**'); }
function sk($arr) { $sk = 3 * (mean($arr) - md($arr)) / std($arr); }
/** * Get the parsed short version of a post * * @return string */ public function getParsedIntroAttribute() { $intro = $this->getIntroAttribute(); if (Config::get('core::wardrobe.cache')) { return Cache::rememberForever('post-intro-' . $this->attributes['id'], function () use($intro) { return md($intro); }); } return md($intro); }