michaelfox + codeigniter   94

itspriddle's gist: 447639 — Gist
// Based on Jonathon Hill's cron.php From http://codeigniter.com/forums/viewthread/88635/

/*
|--------------------------------------------------------------
| CRON JOB BOOTSTRAPPER
|--------------------------------------------------------------
|
| This section is used to get a cron job going, using standard
| CodeIgniter controllers and functions.
|
| 1) Set the CRON_CI_INDEX constant to the location of your
| CodeIgniter index.php file
| 2) Make this file executable (chmod a+x cron.php)
| 3) You can then use this file to call any controller function:
| ./runner --run=/controller/method [--show-output] [--log-file=logfile] [--time-limit=N]
|
| GOTCHA: Do not load any authentication or session libraries in
| controllers you want to run via cron. If you do, they probably
| won't run right.
|
*/
codeigniter  cron  php 
april 2011 by michaelfox
Wiki | CodeIgniter
I have whipped up a very simple and easy-to-use library for automatically building sitemaps for your CodeIgniter web application.

Features
* NEW: generate() method to build a complete site map
* NEW: easy filtering in case you want to exclude certain controllers or method names (see the sample controller below)
* Supports templates
* Can be used to just show pages in one specific controller via the get_links() method
codeigniter  php  plugins  libraries  sitemap 
march 2011 by michaelfox
Using MongoDB for CodeIgniter Logs | CodeSanity
Anyone who has ever worked in a production environment knows that your users will find errors you have not even dreamed of. They will find your broken links, they will find your missing files, and yes they will find every database connectivity issue you hoped would never occur. Thankfully we are all great developers and sysadmins so we log everything we possibly can to find and remove these errors.

This is great at first but after a while log files become enormous and eat up lots of disk space. The problem multiplies when you start getting into a clustered environment (more than 1 server). You now have to read & maintain logs on 2+ machines which will most likely lead to neglecting your error fixing duties. Fortunately MongoDB recently hit the scene.

MongoDB
MongoDB is a scalable, high-performance, open source, document-oriented database. It’s ability to accept huge amounts of data very quickly make it perfect for application logging. It has built in support for auto-sharding & replication so when your application takes off mongodb will scale with you. It uses a JSON based storage system meaning you can give the database an object (from any programming language with support) and when you pull it back out of the database it will be the exact same as when you put it in. No conversion, no hassle, no bullshit.
codeigniter  mongodb  libraries  logging  debugging  logs 
march 2011 by michaelfox
Cron job bootstrapper | CodeIgniter Forums
ere is a very simple bootstrapper file that you can use to directly run your CodeIgniter controllers from the commandline. It’s a very easy and elegant solution for using CI controllers for cron jobs. It also logs the date/time and output each time it runs.

Download

Please let me know if you find this useful, or have an idea of how to improve this further.

Example:

cron.php --run=/controller/method [--show-output] [--log-file=logfile] 
The default logfile is cron.log, but you can change that with the—log-file switch. It does not show the output by default, but you can force it to using the -S or—show-output switch.
codeigniter  php  plugins  libraries  cron 
march 2011 by michaelfox
CodeIgniter Folder Icons for Leopard | Vicente Russo Neto
Hello there! I decided to play a bit and make some folder icons. So here is my contribution for mac developers on this great framework. I made 3 versions, yellow, red and default blue color.

The icon set includes sizes from 16px to 512px, and real folders (just drag and drop on “get info” dialog). As is the case with any downloads I make available here, please do not redistribute the icons or attempt to pass them off as your own.
codeigniter  php  icons 
march 2011 by michaelfox
dperrymorrow/Fire-Log - GitHub
# Fire Log Spark

Fire Log is a spark that lets you browse all the log files in your application/logs directory.

- You can filter what types of items you would like to view DEBUG, ERROR, INFO
- You can delete logs files from Fire Log to clear out your logs
- Fire log uses a view that you can easily customize in sparks/fire\_log/[version]/views/fire\_log_view.php
- You can change if tags are stripped in logs or not from the config
- Language file for all text used
codeigniter  php  logging  debugging  tools  sparks  library  development 
march 2011 by michaelfox
Question about Matchbox / HMVC | CodeIgniter Forums
Why dont you use an .htaccess

RewriteRule .* - [E=MODULES_PATH:application/modules/]
RewriteRule css\/(.+)\/(.+)\.css$ %{ENV:MODULES_PATH}$1/public/css/$2.css [NC] 
codeigniter  moduels  matchbox  assets  mod_rewrite  apache  redirect  css  javascript  htaccess  php 
march 2011 by michaelfox
mijnpraktijk / AugmentedCI / wiki / Home – Bitbucket
his package contains the default CI system directory but with the following changes:

* CI_Router & CI_Loader classes merged with MY_ versions of Modular Seperation
* CI_Exceptions merged with the MY_ version of UhOh!
* CI's default DB replaced by RapidDataMapper (RDM)
* CI_Profiler and CI_Session were modified to work with RDM
* MP_Cache added to the system libraries
* A couple of default changes to the APP/config/config.php (like the base_url and compression on by default)
* A PHP5 autoloader which is loaded by the CI_Router class when available
* Default directories in APP folder for Exception classes, Abstract classes and interfaces (which are supported by the above autoloader)
* max() and min() functions were added to RDM's DB_Query_Select to return maximum and minimum values, work exactly the same as the count() function
* Objects and descriptors from RDM are "subfoldered" by changing underscores to dashes, so the class Page is in "data_model/page.php" and the class Shop_product is in "data_model/shop/product.php".
* AugmentedCI helper for an alternate CI syntax
* The comprehensive UhOh! errors are only shown to IP's added at the top of APP/config/config.php
* Default .htaccess for the main index.php
* Clean Controller and Models namespace (read more)
php  codeigniter  addons  plugins  framework  base  template  boilerplate  extension 
october 2010 by michaelfox
lirantal's codeigniter-menu at master - GitHub
Menu Navigation extension for CodeIgniter PHP framework
codeigniter  php  menu  mysql  database  hierarchy 
september 2010 by michaelfox
itspriddle's codeigniter-action-mailer at master - GitHub
Usage

Drop ActionMailer.php in your libraries/ directory. Create a new mailer and extend ActionMailer. See ApplicationMailer.php for an example mailer.

To send an email, call ApplicationMailer->deliver_account_notification()
Defining Messages

Each message in a mailer should be it's own method. This method should define $this->to, $this->from, $this->subject, and $this->message. If you need attachments, assign them as an array to $this->attachments.

Messages are delivered by calling ApplicationMailer->deliver_MESSAGE_METHOD_NAME() (replace MESSAGE_METHOD_NAME - See Sending Messages below).
Sending Messages

To deliver a message, call the message method from your Mailer with a prefix of deliver_.

For example: assume you've loaded your mailer to $this->mailer and want to send the message defined in ApplicationMailer->my_message(). From your application, simply call $this->mailer->deliver_my_message().
codeigniter  php  email  mailer  library 
september 2010 by michaelfox
ericbarnes's codeignitor-migrations at master - GitHub
An open source utility for Codeigniter inspired by Ruby on Rails. The one thing Ruby on Rails has that Codeigniter does not have built in is database migrations. That function to keep track of database chages (versions) and migrate your database to what ever version you need. Migrate up or migrate down. With this library you can now do this. This library is not complete, please read http://codeigniter.com/wiki/Migrations for future needs and issues. This "fork" of Mat'as orginal work just tweets something to work better in our work. Both Libraries are powerful and work in nearly the same way. Maybe someday we can create a joint project with Mat'as or even better get this into that core of Codeigniter.
codeigniter  database  migrations  versioncontrol  git  updates  mysql 
september 2010 by michaelfox
CodeIgniter htaccess — Best of the Best
21
CodeIgniter htaccess
CodeIgniter

This is the CI .htaccess file that I use for my CodeIgniter PHP projects (some of these CodeIgniter htaccess rules can be used for any project, keep reading). CodeIgniter uses mod_rewrite to route all requests to the CI front controller. I’ve made some additions in an attempt to canocalize some of the CodeIgniter URL end points. The key benefit of a canocalized URL is that your search engine page ranking (page juice) is not spread across several pages, but instead, targeted to a single page.
htaccess Rule Breakdown

In your CodeIgniter project you will typically have a default controller and you will be able to access this controller at the following URLs:
codeigniter  htaccess  config  apache  php 
july 2010 by michaelfox
dragffy.com » Blog Archive » Making CodeIgniter’s Profiler AJAX compatible
Modern web applications almost all make use of AJAX to enhance their user appeal. However, AJAX can be hard to debug, especially when all the traditional tools do little to help. When doing standard PHP coding CodeIgniter (CI) offers a profiler which will be appended to the bottom of generated pages. This gives you information on the request that was recently processed, including any POST or GET values passed to the script, how long execution took and how long any SQL queries took as well as what those queries actually were. During development I find this information indispensable to make sure my SQL queries are correct and things are working as I want.

However, when coding up AJAX aspects of the application this doesn’t work very well, any page fragments fed back to the JavaScript will have the profiler stuck at the bottom, and since these fragments are usually inserted inside DIVs the profiler cannot be read in it’s entirety, or it breaks the layout, or more likely, both of the above. Therefore I set out to find a way of making it AJAX compatible, so that it would always end up at the bottom of the page, even when it was originally returned appended to a page fragment. In the end this turned out easier than anticipated.
codeigniter  php  profiler  ajax  performance  debugging  javascript  jquery  library 
may 2010 by michaelfox
Codeigniter-Video Wrapper - Gitorious
The “Embedded Video” is a library for CodeIgniter (a PHP framework) intended to embed video and its associated information from various video service providers into application being developed using CodeIgniter. It
codeigniter  video  media  library  tools  php 
may 2010 by michaelfox
PEAR integration | Wiki | CodeIgniter
This is a tutorial how to integrate PEAR into Codeigniter by Fabian Wesner (german specialist for codeigniter )
codeigniter  pear  integration  library  environment  setup  config  php 
may 2010 by michaelfox
Codeigniter: Mixing segment-based URL with querystrings | Ask About PHP
Codeigniter, by default crafts it’s URL in a search engine friendly format. It uses a segment-based approach and does away with the all familiar querystring format that developers have been using for many years to pass parameters via the URL into their applications.

Codeigniter does allow you to turn on the querystring capability, but that would mean you have to use a pure querystring approach, foregoing the segment-based approached.

So, is it possible to mix segments and querystring?

Thankfully, Codeigniter can be configured to mix the segments and querystring, and all it takes are some tweaks in your application/config.php file and perhaps an additional line of code.
codeigniter  url  get  query  querystring  paramaters 
may 2010 by michaelfox
Codeigniter: Handling errors | Ask About PHP
As coders, I’m sure we all know the value of good error handling. So I thought a quick post about how Codeigniter deals with those pesky errors would be a good post.

The way I see it, there are 2 types of errors we have to work with. The ones which are displayed out in nice friendly text to your users, and the type which are hidden and shown only to you as the coder to figure out where something has gone wrong. CI provides the means to do both, thankfully.
codeigniter  errors  exceptions  errorhandling  ux  logging  debugging  php 
may 2010 by michaelfox
Pagination automated | CodeIgniter Forums
Here’s an extension for the pagination class.

It automatically calculates the base_url and uri_segment for the pagination class so you don’t have to set them manually in your controller.

Also, it automatically calculates the offset form the URI and stores it in $this->pagination->offset, which you can use as LIMIT parameter in your database calls.

All you need to do order to calculate these values is to use a distinctive string in your URI, in the segment preceding the offset. For instance: http://www.example.com/blog/overview/Page/12 (in which ‘Page’ would be the distinctive string).
codeigniter  pagination  offset  extension  php  library 
may 2010 by michaelfox
Cache library for CodeIgniter | Phil Sturgeon
CodeIgniter Cache library is a partial caching library for CodeIgniter. It allows you to write and get chunks of data to and from the filesystem. By storing complex or large chunks of data in serialized form on the file system you can relieve stress from the database or simply cache calls to third-party data sources like Twitter.
codeigniter  cache  caching  performance  php 
may 2010 by michaelfox
Template library for CodeIgniter | Phil Sturgeon
Template library

CodeIgniter-Template is a Template library that helps your build complex views with CodeIgniter. It has logic to work with themes & modules and helps add your title, meta-data, breadcrumbs and partial views.
Usage

For any of this to work well, you need some global code running. You can do this by creating a hook or use MY_Controller. I take MY_Controller one step further and have Public_Controller and Admin_Controller, from which all of my controllers inherit shared logic for the frontend or the backend. To find out how to do that, read my article CodeIgniter Base Classes: Keeping it DRY.
codeigniter  template  library 
may 2010 by michaelfox
HVMC: an Introduction and Application | Nettuts+
This tutorial is an introduction to the Hierarchical Model View Controller(HMVC) pattern, and how it applies to web application development. For this tutorial, I will use examples provided from the CodeIgniter from Scratch series and demonstrate how HMVC can be a valuable modification to your development process. This introduction assumes you have an understanding of the Model View Controller (MVC) pattern. We suggest you read our introduction to MVC to get acquainted with the topic before tackling this tutorial.
codeigniter  mvc  hmvc  plugins  structure  project  organization  site 
may 2010 by michaelfox
Extending CodeIgniter’s Exceptions Class at guillermo, out of repose
CodeIgniter, my favorite open-source PHP framework, provides functions (full-on, globally available functions) for dealing with errors. It’s not such a bad thing, because you don’t have to worry too much about variable scope or any other troublesome programming concepts. The downside of having such a simple approach to error handling, at least in CodeIgniter’s default implementation, is that there isn’t much information about your application available once an error is thrown.
codeigniter  error  exceptions  errorhandling  php  CI_Exceptions 
february 2010 by michaelfox
Wiki | CodeIgniter
Would you like to serve up already-existing HTML and PHP pages inside a CI context?
Migrate a site to CI perhaps? This is how I did it with a minimum of fuss.

One brute force way to migrate a site to CI is to write a controller method for every static page. But, if you are using CI already, then you probably like to find efficient ways rather than brute force ways.

Instead of mapping pages to controllers by hand, this code uses _remap() to handle incoming URIs. It uses a base controller that you extend. The base controller first checks if there is a controller method anywhere in the child or parent class. If there is not a controller method, it checks the filesystem for a matching view file. If there is a matching view file, then it loads it through the normal CI load->view() method. If there is no view file, you get the normal CI 404 error.

Drop this base controller in place with a “skeleton” child class (optional but recommended) and you can put static pages in the views directory. Your controller will load them as if they were view files - inside a CI context - without re-writing them or specifically coding a controller for each page. Migrate your existing site in one fell swoop. Then you can piece out the functionality by adding controller methods so that it progressively gets more CI-like.
codeigniter  migrate  library  php  remap 
october 2009 by michaelfox
« earlier      

related tags

*todo  addons  ajax  amazon  apache  api  assets  auth  authentication  authorization  base  bestpractices  boilerplate  bugs  build  bundle  cache  caching  calendar  cart  charactersets  charset  CI_Exceptions  cms  code  codegeneration  codeigniter  collection  config  configuration  connect  connection  contributing  controller  convention  core  cron  crud  css  data  database  datamapper  datamodelling  db  debug  debugging  development  diagram  dom  ecommerce  email  encoding  encryption  environment  error  errorhandling  errors  example  excel  exceptions  extending  extension  facebook  files  filter  flexigrid  forms  framework  gcal  get  gist  gist-243409  gist-257736  git  github  github-user  google  grid  guide  hacks  hash  headers  hierarchy  hmvc  htaccess  icons  image  images  inspiration  integration  javascript  jqgrid  jquery  json  kohana  libraries  library  list  loader  logging  logs  longurl  mail  mailer  matchbox  media  memcache  menu  microformats  migrate  migrations  models  moduels  mod_rewrite  mongodb  mvc  mysql  MY_Controller  MY_Loader  my_model  my_router  naming  nosql  notifications  oauth  offset  optimization  organization  orm  pagination  paramaters  parser  password  paths  pdf  pear  performance  php  phpunit  plugin  plugins  profiler  project  prowl  query  querystring  RAD  rails  rapiddatamapper  redirect  reference  regex  remap  resources  rest  restful  router  routing  ruby  s3  salt  sass  scripting  search  secure  security  seo  session  setup  shopping  simpletest  site  sitemap  socialnetworking  source  spark  sparks  sphinx  sqlinjection  store  structure  swfupload  table  tdd  template  templates  templating  testing  textmate  tips  tools  tree  tutorial  tvdb  twitter  unittesting  updates  url  utf8  ux  validation  versioncontrol  video  views  webdev  wordpress  xhprof  xml  xsl  xslt  xss  yql  zend 

Copy this bookmark:



description:


tags: