Created
November 11, 2013 06:23
-
-
Save merik-chen/7408783 to your computer and use it in GitHub Desktop.
init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <IfModule mod_rewrite.c> | |
| RewriteEngine on | |
| RewriteRule ^$ public/ [L] | |
| RewriteRule (.*) public/$1 [L] | |
| </IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| news |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="CssXFireSettings"> | |
| <general autoClear="false" autoExpand="false" /> | |
| <strategy useRoutes="false" mediaReduce="false" fileReduce="false" currentDocumentsReduce="false" resolveVariables="true" resolveMixins="true" /> | |
| <routes /> | |
| </component> | |
| </project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> | |
| </project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="ProjectRootManager" version="2" /> | |
| </project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="ProjectModuleManager"> | |
| <modules> | |
| <module fileurl="file://$PROJECT_DIR$/.idea/news.iml" filepath="$PROJECT_DIR$/.idea/news.iml" /> | |
| </modules> | |
| </component> | |
| </project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <module type="WEB_MODULE" version="4"> | |
| <component name="NewModuleRootManager"> | |
| <content url="file://$MODULE_DIR$" /> | |
| <orderEntry type="inheritedJdk" /> | |
| <orderEntry type="sourceFolder" forTests="false" /> | |
| </component> | |
| </module> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <component name="DependencyValidationManager"> | |
| <state> | |
| <option name="SKIP_IMPORT_STATEMENTS" value="false" /> | |
| </state> | |
| </component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="VcsDirectoryMappings"> | |
| <mapping directory="" vcs="" /> | |
| </component> | |
| </project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| return new \Phalcon\Config(array( | |
| 'database' => array( | |
| 'adapter' => 'Mysql', | |
| 'host' => 'localhost', | |
| 'username' => 'root', | |
| 'password' => '', | |
| 'dbname' => 'test', | |
| ), | |
| 'application' => array( | |
| 'controllersDir' => __DIR__ . '/../../app/controllers/', | |
| 'modelsDir' => __DIR__ . '/../../app/models/', | |
| 'viewsDir' => __DIR__ . '/../../app/views/', | |
| 'pluginsDir' => __DIR__ . '/../../app/plugins/', | |
| 'libraryDir' => __DIR__ . '/../../app/library/', | |
| 'cacheDir' => __DIR__ . '/../../app/cache/', | |
| 'baseUri' => '/news/', | |
| ) | |
| )); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $loader = new \Phalcon\Loader(); | |
| /** | |
| * We're a registering a set of directories taken from the configuration file | |
| */ | |
| $loader->registerDirs( | |
| array( | |
| $config->application->controllersDir, | |
| $config->application->modelsDir | |
| ) | |
| )->register(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Phalcon\DI\FactoryDefault, | |
| Phalcon\Mvc\View, | |
| Phalcon\Mvc\Url as UrlResolver, | |
| Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter, | |
| Phalcon\Mvc\View\Engine\Volt as VoltEngine, | |
| Phalcon\Mvc\Model\Metadata\Memory as MetaDataAdapter, | |
| Phalcon\Session\Adapter\Files as SessionAdapter; | |
| /** | |
| * The FactoryDefault Dependency Injector automatically register the right services providing a full stack framework | |
| */ | |
| $di = new FactoryDefault(); | |
| /** | |
| * The URL component is used to generate all kind of urls in the application | |
| */ | |
| $di->set('url', function() use ($config) { | |
| $url = new UrlResolver(); | |
| $url->setBaseUri($config->application->baseUri); | |
| return $url; | |
| }, true); | |
| /** | |
| * Setting up the view component | |
| */ | |
| $di->set('view', function() use ($config) { | |
| $view = new View(); | |
| $view->setViewsDir($config->application->viewsDir); | |
| $view->registerEngines(array( | |
| '.volt' => function($view, $di) use ($config) { | |
| $volt = new VoltEngine($view, $di); | |
| $volt->setOptions(array( | |
| 'compiledPath' => $config->application->cacheDir, | |
| 'compiledSeparator' => '_', | |
| 'compileAlways' => false //true | |
| )); | |
| return $volt; | |
| }, | |
| '.phtml' => 'Phalcon\Mvc\View\Engine\Php' | |
| )); | |
| return $view; | |
| }, true); | |
| /** | |
| * Database connection is created based in the parameters defined in the configuration file | |
| */ | |
| $di->set('db', function() use ($config) { | |
| return new DbAdapter(array( | |
| 'host' => $config->database->host, | |
| 'username' => $config->database->username, | |
| 'password' => $config->database->password, | |
| 'dbname' => $config->database->dbname | |
| )); | |
| }); | |
| /** | |
| * If the configuration specify the use of metadata adapter use it or use memory otherwise | |
| */ | |
| $di->set('modelsMetadata', function() { | |
| return new MetaDataAdapter(); | |
| }); | |
| /** | |
| * Start the session the first time some component request the session service | |
| */ | |
| $di->set('session', function() { | |
| $session = new SessionAdapter(); | |
| $session->start(); | |
| return $session; | |
| }); | |
| $di->set('router', function () { | |
| $router = new \Phalcon\Mvc\Router(); | |
| $router->setDefaultController('home'); | |
| return $router; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Phalcon\Mvc\Controller; | |
| class ControllerBase extends Controller | |
| { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class HomeController extends \Phalcon\Mvc\Controller | |
| { | |
| public function indexAction() | |
| { | |
| $this->view->title = 'phalcon'; | |
| } | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <!--[if lt IE 7]> | |
| <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> | |
| <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> | |
| <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> | |
| <html class="no-js"> <!--<![endif]--> | |
| <head> | |
| <link rel="stylesheet" type="text/css" href="less/index.less"/> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <title>Mk Chen {{ title }}</title> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> | |
| <link rel="stylesheet" href="css/normalize.css"> | |
| <link rel="stylesheet" href="css/main.css"> | |
| <link rel="stylesheet" href="css/index.css"> | |
| <script src="js/vendor/modernizr-2.6.2.min.js"></script> | |
| </head> | |
| <body> | |
| <!--[if lt IE 7]> | |
| <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade | |
| your browser</a> to improve your experience.</p> | |
| <![endif]--> | |
| <div id="loader"></div> | |
| <div id="background"></div> | |
| <div id="title">MkChen</div> | |
| <div id="contact"> | |
| <form id="contact_me" accept-charset="utf-8" method="post"> | |
| <input id="name" autocomplete="false" required class="input_long input_comman" placeholder="Name" type="text"><br> | |
| <input id="email" autocomplete="false" required class="input_long input_comman" placeholder="E-Mail" type="text"><br> | |
| <textarea class="text_area input_comman" required="required" id="content" placeholder="Write down the messages."></textarea><br> | |
| <input type="submit" value="SEND" class="input_comman"><input type="reset" value="RESET" class="input_comman"> | |
| </form> | |
| </div> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
| <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script> | |
| <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true&key=AIzaSyAIqP9Lcf3MkNyrsZwa5nBad-gNAYSLgtM"></script> | |
| <script src="js/plugins.js"></script> | |
| <script src="js/main.js"></script> | |
| <script src="js/jquery.ba-dotimeout.min.js"></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Phalcon PHP Framework</title> | |
| </head> | |
| <body> | |
| {{ content() }} | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html><body><h1>Mod-Rewrite is not enabled</h1><p>Please enable rewrite module on your web server to continue</body></html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AddDefaultCharset UTF-8 | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] | |
| </IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Page Not Found :(</title> | |
| <style> | |
| ::-moz-selection { | |
| background: #b3d4fc; | |
| text-shadow: none; | |
| } | |
| ::selection { | |
| background: #b3d4fc; | |
| text-shadow: none; | |
| } | |
| html { | |
| padding: 30px 10px; | |
| font-size: 20px; | |
| line-height: 1.4; | |
| color: #737373; | |
| background: #f0f0f0; | |
| -webkit-text-size-adjust: 100%; | |
| -ms-text-size-adjust: 100%; | |
| } | |
| html, | |
| input { | |
| font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
| } | |
| body { | |
| max-width: 500px; | |
| _width: 500px; | |
| padding: 30px 20px 50px; | |
| border: 1px solid #b3b3b3; | |
| border-radius: 4px; | |
| margin: 0 auto; | |
| box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff; | |
| background: #fcfcfc; | |
| } | |
| h1 { | |
| margin: 0 10px; | |
| font-size: 50px; | |
| text-align: center; | |
| } | |
| h1 span { | |
| color: #bbb; | |
| } | |
| h3 { | |
| margin: 1.5em 0 0.5em; | |
| } | |
| p { | |
| margin: 1em 0; | |
| } | |
| ul { | |
| padding: 0 0 0 40px; | |
| margin: 1em 0; | |
| } | |
| .container { | |
| max-width: 380px; | |
| _width: 380px; | |
| margin: 0 auto; | |
| } | |
| /* google search */ | |
| #goog-fixurl ul { | |
| list-style: none; | |
| padding: 0; | |
| margin: 0; | |
| } | |
| #goog-fixurl form { | |
| margin: 0; | |
| } | |
| #goog-wm-qt, | |
| #goog-wm-sb { | |
| border: 1px solid #bbb; | |
| font-size: 16px; | |
| line-height: normal; | |
| vertical-align: top; | |
| color: #444; | |
| border-radius: 2px; | |
| } | |
| #goog-wm-qt { | |
| width: 220px; | |
| height: 20px; | |
| padding: 5px; | |
| margin: 5px 10px 0 0; | |
| box-shadow: inset 0 1px 1px #ccc; | |
| } | |
| #goog-wm-sb { | |
| display: inline-block; | |
| height: 32px; | |
| padding: 0 10px; | |
| margin: 5px 0 0; | |
| white-space: nowrap; | |
| cursor: pointer; | |
| background-color: #f5f5f5; | |
| background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1); | |
| background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1); | |
| background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1); | |
| background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1); | |
| -webkit-appearance: none; | |
| -moz-appearance: none; | |
| appearance: none; | |
| *overflow: visible; | |
| *display: inline; | |
| *zoom: 1; | |
| } | |
| #goog-wm-sb:hover, | |
| #goog-wm-sb:focus { | |
| border-color: #aaa; | |
| box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); | |
| background-color: #f8f8f8; | |
| } | |
| #goog-wm-qt:hover, | |
| #goog-wm-qt:focus { | |
| border-color: #105cb6; | |
| outline: 0; | |
| color: #222; | |
| } | |
| input::-moz-focus-inner { | |
| padding: 0; | |
| border: 0; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>Not found <span>:(</span></h1> | |
| <p>Sorry, but the page you were trying to view does not exist.</p> | |
| <p>It looks like this was the result of either:</p> | |
| <ul> | |
| <li>a mistyped address</li> | |
| <li>an out-of-date link</li> | |
| </ul> | |
| <script> | |
| var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host; | |
| </script> | |
| <script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script> | |
| </div> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| �PNG | |